Commit graph

724 commits

Author SHA1 Message Date
Paul Gauthier
9969641a69 copy 2023-05-14 16:45:57 -07:00
Paul Gauthier
2081711660 initial 2023-05-14 16:39:56 -07:00
Paul Gauthier
8c2d01b0b3 copy 2023-05-14 16:21:50 -07:00
Paul Gauthier
967607aba4 copy 2023-05-14 16:21:34 -07:00
Paul Gauthier
6a456cbfd5 copy 2023-05-14 15:13:19 -07:00
Paul Gauthier
bb596db9e4 copy 2023-05-14 15:11:48 -07:00
Paul Gauthier
37a4c47282 Refactor apply_updates method to return edit_error instead of err. 2023-05-14 15:01:50 -07:00
Paul Gauthier
28533ad23e aider: Refactored try/except block around self.update_files() call into a new method called apply_updates(). 2023-05-14 14:57:57 -07:00
Paul Gauthier
3374ae19be wip: Changed prompt messages to use proper grammar and formatting. 2023-05-14 14:54:55 -07:00
Paul Gauthier
ddc8fa6f0b Merge branch 'main' into dotdotdot 2023-05-14 14:50:36 -07:00
Paul Gauthier
c1242bd961 copy 2023-05-14 14:47:56 -07:00
Paul Gauthier
fc7eecdc44 copy 2023-05-14 14:41:17 -07:00
Paul Gauthier
90f9c53480 copy 2023-05-14 14:33:01 -07:00
Paul Gauthier
451f257573 copy 2023-05-14 14:32:12 -07:00
Paul Gauthier
f4cdbbf2e3 copy 2023-05-14 14:25:31 -07:00
Paul Gauthier
7b4c9079c3 copy 2023-05-14 14:24:27 -07:00
Paul Gauthier
5bc835cb31 copy 2023-05-14 14:23:17 -07:00
Paul Gauthier
0c05e3d957 Handle case where part="" and replace is non-empty 2023-05-14 11:07:22 -07:00
Paul Gauthier
e9debe71e8 Attempt to honot edit blocks which elide content using ... 2023-05-14 11:00:45 -07:00
Paul Gauthier
ed138d1940 changed output if dryrun 2023-05-14 10:16:43 -07:00
Paul Gauthier
ab68022fb9 wip: Added a dry-run option to do_replace function. 2023-05-14 10:15:08 -07:00
Paul Gauthier
0b8690654e aider: Added dry_run parameter to do_replace function and passed it from Coder class.
# Context:
USER: pass dry run into do_replace and only write to the file if false
ASSISTANT: To implement this change, we need to modify the `do_replace` function in the `aider/utils.py` file. We will add a new parameter `dry_run` to the function and only write to the file if `dry_run` is `False`.

Here's the change:

```python
aider/utils.py
<<<<<<< ORIGINAL
def do_replace(fname, before_text, after_text):
=======
def do_replace(fname, before_text, after_text, dry_run=False):
>>>>>>> UPDATED
    before_text = strip_quoted_wrapping(before_text, fname)
    after_text = strip_quoted_wrapping(after_text, fname)
    fname = Path(fname)

    # does it want to make a new file?
    if not fname.exists() and not before_text.strip():
        fname.touch()

    content = fname.read_text()

    if not before_text.strip():
        if content:
            new_content = content + after_text
        else:
            # first populating an empty file
            new_content = after_text
    else:
        new_content = replace_most_similar_chunk(content, before_text, after_text)
        if not new_content:
            return

    if not dry_run:
        fname.write_text(new_content)
    return True
```

Now, you need to pass the `dry_run` parameter from the `Coder` class in the `aider/coder.py` file to the `do_replace` function. Here's the change:

```python
aider/coder.py
<<<<<<< ORIGINAL
if utils.do_replace(full_path, original, updated):
=======
if utils.do_replace(full_path, original, updated, self.dry_run):
>>>>>>> UPDATED
    self.io.tool(f"Applied edit to {path}")
else:
    self.io.tool_error(f"Failed to apply edit to {path}")
```

These changes will ensure that the file is only written to when `dry_run` is `False`.
2023-05-14 10:14:20 -07:00
Paul Gauthier
a8acca9366 aider: Added a --dry-run argument to the main.py file and passed it to the Coder class, setting the self.dry_run attribute in the Coder class.
# Context:
USER: add a --dry-run arg, no env, default false. pass it into Coder and set self.dry_run
ASSISTANT: I will add a `--dry-run` argument to the `main.py` file and pass it to the `Coder` class. Then, I will set the `self.dry_run` attribute in the `Coder` class.

Here are the changes:

```python
aider/main.py
<<<<<<< ORIGINAL
    parser.add_argument(
        "--show-diffs",
        action="store_true",
        help=f"Show diffs when committing changes (default: False, ${env_prefix}SHOW_DIFFS)",
        default=bool(int(os.environ.get(f"{env_prefix}SHOW_DIFFS", 0))),
    )
=======
    parser.add_argument(
        "--dry-run",
        action="store_true",
        help="Perform a dry run without applying changes (default: False)",
        default=False,
    )
    parser.add_argument(
        "--show-diffs",
        action="store_true",
        help=f"Show diffs when committing changes (default: False, ${env_prefix}SHOW_DIFFS)",
        default=bool(int(os.environ.get(f"{env_prefix}SHOW_DIFFS", 0))),
    )
>>>>>>> UPDATED
```

```python
aider/main.py
<<<<<<< ORIGINAL
    io = InputOutput(
        args.pretty,
        args.yes,
        args.input_history_file,
        args.chat_history_file,
        input=input,
        output=output,
    )

    coder = Coder(
        args.model,
        fnames,
        pretty,
        args.show_diffs,
        args.auto_commits,
        io,
    )
=======
    io = InputOutput(
        args.pretty,
        args.yes,
        args.input_history_file,
        args.chat_history_file,
        input=input,
        output=output,
    )

    coder = Coder(
        args.model,
        fnames,
        pretty,
        args.show_diffs,
        args.auto_commits,
        io,
        args.dry_run,
    )
>>>>>>> UPDATED
```

```python
aider/coder.py
<<<<<<< ORIGINAL
    def __init__(self, main_model, fnames, pretty, show_diffs, auto_commits, io):
        self.abs_fnames = set()

        self.io = io

        self.auto_commits = auto_commits
=======
    def __init__(self, main_model, fnames, pretty, show_diffs, auto_commits, io, dry_run):
        self.abs_fnames = set()

        self.io = io

        self.auto_commits = auto_commits
        self.dry_run = dry_run
>>>>>>> UPDATED
```

Please review the changes and let me know if you need any further modifications.
2023-05-14 10:06:16 -07:00
Paul Gauthier
708653290f Creating empty file 2023-05-14 09:09:37 -07:00
Paul Gauthier
3f26a3ec05 main prompt in normal mixed case 2023-05-14 08:19:32 -07:00
Paul Gauthier
70ea500783 improved --no-auto-commits support 2023-05-14 07:37:04 -07:00
Paul Gauthier
78b1296e0e Added auto_commit method to Coder class. 2023-05-14 07:23:20 -07:00
Paul Gauthier
57fff7f360 copy 2023-05-14 07:12:01 -07:00
Paul Gauthier
d55f8a94e3 Changed the name of the project to "aider". 2023-05-14 07:02:32 -07:00
Paul Gauthier
6ffbd5f2cc aider: Updated main title to "GPT-4 powered coding in your terminal.
# Context:
USER: suggest a bunch of taglines for this tool
ASSISTANT: Here are some taglines for the `aider` tool:

1. "Code smarter, not harder with aider."
2. "Collaborate with AI to elevate your code."
3. "Unleash the power of GPT-4 in your coding workflow."
4. "Revolutionize your development process with AI-driven code editing."
5. "Transform your codebase with the help of AI expertise."
6. "Empower your programming with AI-assisted code collaboration."
7. "Supercharge your coding experience with AI-driven insights."
8. "Elevate your code quality with AI-powered assistance."
9. "Experience the future of coding with aider and GPT-4."
10. "Code like a pro with AI-driven code editing and collaboration."

Feel free to choose any of these taglines or let me know if you need more suggestions.
USER: more suggestions. shorter.
ASSISTANT: Here are some shorter taglines for the `aider` tool:

1. "AI-powered coding."
2. "Code with AI insight."
3. "AI-assisted development."
4. "Smarter coding, together."
5. "Collaborative AI coding."
6. "AI-enhanced programming."
7. "Code collaboration reimagined."
8. "Unleash AI in your code."
9. "Revolutionize coding with AI."
10. "AI-driven code evolution."

Feel free to choose any of these taglines or let me know if you need more suggestions.
USER: include a mention of cmd line
ASSISTANT: Here are some taglines for the `aider` tool that mention the command line:

1. "Command line AI for smarter coding."
2. "AI-powered coding at your command."
3. "AI-enhanced command line collaboration."
4. "Code with AI insight from the command line."
5. "Command line meets AI-driven development."
6. "AI-assisted coding from your terminal."
7. "Revolutionize your command line coding with AI."
8. "Unleash AI in your code from the command line."
9. "AI-driven code evolution at the command line."
10. "Command line coding reimagined with AI."

Feel free to choose any of these taglines or let me know if you need more suggestions.
USER: maybe reference terminal instead
ASSISTANT: Here are some taglines for the `aider` tool that reference the terminal:

1. "AI-powered coding in your terminal."
2. "Terminal collaboration with AI insight."
3. "AI-enhanced development from your terminal."
4. "Code smarter with AI in your terminal."
5. "Terminal meets AI-driven coding."
6. "AI-assisted programming in your terminal."
7. "Revolutionize terminal coding with AI."
8. "Unleash AI in your code from the terminal."
9. "AI-driven code evolution in your terminal."
10. "Terminal coding reimagined with AI."

Feel free to choose any of these taglines or let me know if you need more suggestions.
USER: maybe mention both gpt-4 and termainl
ASSISTANT: Here are some taglines for the `aider` tool that mention both GPT-4 and the terminal:

1. "GPT-4 powered coding in your terminal."
2. "Terminal collaboration with GPT-4 assistance."
3. "AI-enhanced development with GPT-4 in your terminal."
4. "Code smarter with GPT-4 in your terminal."
5. "GPT-4 meets terminal-driven coding."
6. "GPT-4 assisted programming in your terminal."
7. "Revolutionize terminal coding with GPT-4."
8. "Unleash GPT-4 in your code from the terminal."
9. "GPT-4 driven code evolution in your terminal."
10. "Terminal coding reimagined with GPT-4."

Feel free to choose any of these taglines or let me know if you need more suggestions.
USER: make this the main title: "GPT-4 powered coding in your terminal."
ASSISTANT: To update the main title in the `README.md` file, you can use the following *EDIT BLOCK*:

```markdown
README.md
<<<<<<< ORIGINAL
# aider
=======
# GPT-4 powered coding in your terminal.
>>>>>>> UPDATED
```

This change will replace the current title "aider" with "GPT-4 powered coding in your terminal."
2023-05-14 07:00:01 -07:00
Paul Gauthier
608bbec7c0 copy 2023-05-13 15:27:03 -07:00
Paul Gauthier
9c2f8e22d8 wip: Refactor file mentions check in Coder class to strip away all kinds of quotes and drop sentence punctuation. 2023-05-13 15:21:26 -07:00
Paul Gauthier
4d800b1e31 adopt EDIT BLOCK as the nomenclature in the prompt 2023-05-13 15:13:40 -07:00
Paul Gauthier
67148aab3e copy 2023-05-13 14:56:37 -07:00
Paul Gauthier
a22e5af69d copy 2023-05-13 14:49:13 -07:00
Paul Gauthier
487dec4688 copy 2023-05-13 14:48:04 -07:00
Paul Gauthier
1311853c57 copy 2023-05-13 14:45:44 -07:00
Paul Gauthier
89ac431f1d copy 2023-05-13 14:45:28 -07:00
Paul Gauthier
7e813329ab copy 2023-05-13 14:44:11 -07:00
Paul Gauthier
ed6efbcfb3 wip: Removed suggested commit message prompt. 2023-05-13 13:19:36 -07:00
Paul Gauthier
b9d07e5eec wip: Refactor coder.py to improve commit message display. 2023-05-13 13:18:58 -07:00
Paul Gauthier
06818156cf wip: Changed append_chat_history to use blockquote instead of italics. 2023-05-13 13:17:40 -07:00
Paul Gauthier
da19845706 copy 2023-05-13 13:06:43 -07:00
Paul Gauthier
5fe853f9ca copy 2023-05-13 13:03:16 -07:00
Paul Gauthier
0d7813f09c copy 2023-05-13 12:59:13 -07:00
Paul Gauthier
d77c45929b copy 2023-05-13 12:56:51 -07:00
Paul Gauthier
069cecb3c9 copy 2023-05-13 12:56:40 -07:00
Paul Gauthier
2f363d6198 copy 2023-05-13 12:55:42 -07:00
Paul Gauthier
9ae8cc0096 copy 2023-05-13 12:55:24 -07:00
Paul Gauthier
ee56ba1f50 copy 2023-05-13 12:54:52 -07:00