mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
copy
This commit is contained in:
parent
05375fe279
commit
2eced6ce12
2 changed files with 24 additions and 39 deletions
50
README.md
50
README.md
|
@ -8,9 +8,8 @@ and [git commit the changes](https://aider.chat/docs/faq.html#how-does-aider-use
|
|||
with sensible commit messages.
|
||||
You can start a new project or work with an existing git repo.
|
||||
Aider is unique in that it lets you ask for changes to [pre-existing, larger codebases](https://aider.chat/docs/repomap.html).
|
||||
Aider works well with GPT 3.5, GPT-4o, GPT-4 Turbo with Vision,
|
||||
and Claude 3 Opus.
|
||||
It also supports [connecting to almost any LLM](https://aider.chat/docs/llms.html).
|
||||
Aider works well with GPT-4o, Claude 3 Opus, GPT-3.5
|
||||
and supports [connecting to almost any LLM](https://aider.chat/docs/llms.html).
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/screencast.svg" alt="aider screencast">
|
||||
|
@ -62,44 +61,26 @@ $ aider --opus
|
|||
|
||||
* Chat with aider about your code by launching `aider` from the command line with set of source files to discuss and edit together. Aider lets the LLM see and edit the content of those files.
|
||||
* Aider can write and edit code in most popular languages: python, javascript, typescript, php, html, css, etc.
|
||||
* Aider works well with GPT 3.5, GPT-4o, GPT-4 Turbo with Vision,
|
||||
and Claude 3 Opus. It also supports [connecting to almost any LLM](https://aider.chat/docs/llms.html).
|
||||
* Aider works well with GPT-4o, Claude 3 Opus, GPT-3.5 and supports [connecting to almost any LLM](https://aider.chat/docs/llms.html).
|
||||
* Request new features, changes, improvements, or bug fixes to your code. Ask for new test cases, updated documentation or code refactors.
|
||||
* Aider will apply the edits suggested by the LLM directly to your source files.
|
||||
* Aider will [automatically commit each changeset to your local git repo](https://aider.chat/docs/faq.html#how-does-aider-use-git) with a descriptive commit message. These frequent, automatic commits provide a safety net. It's easy to undo changes or use standard git workflows to manage longer sequences of changes.
|
||||
* You can use aider with multiple source files at once, so aider can make coordinated code changes across all of them in a single changeset/commit.
|
||||
* Aider can [give the LLM a map of your entire git repo](https://aider.chat/docs/repomap.html), which helps it understand and modify large codebases.
|
||||
* You can also edit files by hand using your editor while chatting with aider. Aider will notice these out-of-band edits and keep up to date with the latest versions of your files. This lets you bounce back and forth between the aider chat and your editor, to collaboratively code with an LLM.
|
||||
* If you are using gpt-4 through openai directly, you can add image files to your context which will automatically switch you to the gpt-4-vision-preview model
|
||||
* You can add images files to your chat if you are working with a vision capable OpenAI model (GPT-4o, GPT-4 Turbo, etc).
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Run the `aider` tool by executing the following command:
|
||||
Run the `aider` tool by executing the following command with the source code files you want to edit.
|
||||
These files will be "added to the chat session", so that the LLM can see their
|
||||
contents and edit them according to your instructions.
|
||||
|
||||
```
|
||||
aider <file1> <file2> ...
|
||||
```
|
||||
|
||||
If your pip install did not place the `aider` executable on your path, you can invoke aider like this:
|
||||
|
||||
```
|
||||
python -m aider.main <file1> <file2>
|
||||
```
|
||||
|
||||
Replace `<file1>`, `<file2>`, etc., with the paths to the source code files you want to work on.
|
||||
These files will be "added to the chat session", so that the LLM can see their contents and edit them according to your instructions.
|
||||
|
||||
You can also just launch `aider` anywhere in a git repo without naming
|
||||
files on the command line. It will discover all the files in the
|
||||
repo. You can then add and remove individual files in the chat
|
||||
session with the `/add` and `/drop` chat commands described below.
|
||||
If you or the LLM mention one of the repo's filenames in the conversation,
|
||||
aider will ask if you'd like to add it to the chat.
|
||||
|
||||
Think about the change you want to make and which files will need
|
||||
to be edited -- add those files to the chat.
|
||||
Don't add *all* the files in your repo to the chat.
|
||||
Be selective, and just add the files that the LLM will need to edit.
|
||||
If you add a bunch of unrelated files, the LLM can get overwhelmed
|
||||
and confused (and it costs more tokens).
|
||||
|
@ -107,16 +88,23 @@ Aider will automatically
|
|||
share snippets from other, related files with the LLM so it can
|
||||
[understand the rest of your code base](https://aider.chat/docs/repomap.html).
|
||||
|
||||
Aider also has many
|
||||
additional command-line options, environment variables or configuration file
|
||||
to set many options. See `aider --help` for details.
|
||||
You can also just launch `aider` anywhere in a git repo without naming
|
||||
files on the command line. It will discover all the files in the
|
||||
repo. You can then add and remove individual files in the chat
|
||||
session with the `/add` and `/drop` chat commands described below.
|
||||
If you or the LLM mention any of the repo's filenames in the conversation,
|
||||
aider will ask if you'd like to add them to the chat.
|
||||
|
||||
Aider also has many other options which can be set with
|
||||
command line switches, environment variables or via a configuration file.
|
||||
See `aider --help` for details.
|
||||
|
||||
|
||||
## In-chat commands
|
||||
|
||||
Aider supports commands from within the chat, which all start with `/`. Here are some of the most useful in-chat commands:
|
||||
|
||||
* `/add <file>`: Add matching files to the chat session.
|
||||
* `/add <file>`: Add matching files to the chat session, including image files.
|
||||
* `/drop <file>`: Remove matching files from the chat session.
|
||||
* `/undo`: Undo the last git commit if it was done by aider.
|
||||
* `/diff`: Display the diff of the last aider commit.
|
||||
|
@ -130,7 +118,7 @@ See the [full command docs](https://aider.chat/docs/commands.html) for more info
|
|||
## Tips
|
||||
|
||||
* Think about which files need to be edited to make your change and add them to the chat.
|
||||
Aider has some ability to help the LLM figure out which files to edit all by itself, but the most effective approach is to explicitly add the needed files to the chat yourself.
|
||||
Aider can help the LLM figure out which files to edit all by itself, but the most efficient approach is to add the needed files to the chat yourself.
|
||||
* Large changes are best performed as a sequence of thoughtful bite sized steps, where you plan out the approach and overall design. Walk the LLM through changes like you might with a junior dev. Ask for a refactor to prepare, then ask for the actual change. Spend the time to ask for code quality/structure improvements.
|
||||
* Use Control-C to safely interrupt the LLM if it isn't providing a useful response. The partial response remains in the conversation, so you can refer to it when you reply to the LLM with more information or direction.
|
||||
* Use the `/run` command to run tests, linters, etc and show the output to the LLM so it can fix any issues.
|
||||
|
|
|
@ -29,8 +29,8 @@ To work with Anthropic's models like Claude 3 Opus you need a paid
|
|||
# Install aider
|
||||
py -m pip install aider-chat
|
||||
|
||||
# To work with GPT-4 Turbo:
|
||||
$ aider --openai-api-key sk-xxx... --4turbo
|
||||
# To work with GPT-4o:
|
||||
$ aider --openai-api-key sk-xxx...
|
||||
|
||||
# To work with Claude 3 Opus:
|
||||
$ aider --anthropic-api-key sk-xxx... --opus
|
||||
|
@ -42,8 +42,8 @@ $ aider --anthropic-api-key sk-xxx... --opus
|
|||
# Install aider
|
||||
python -m pip install aider-chat
|
||||
|
||||
# To work with GPT-4 Turbo:
|
||||
$ aider --openai-api-key sk-xxx... --4turbo
|
||||
# To work with GPT-4o:
|
||||
$ aider --openai-api-key sk-xxx...
|
||||
|
||||
# To work with Claude 3 Opus:
|
||||
$ aider --anthropic-api-key sk-xxx... --opus
|
||||
|
@ -51,10 +51,7 @@ $ aider --anthropic-api-key sk-xxx... --opus
|
|||
|
||||
## Working with other LLMs
|
||||
|
||||
Aider works well with GPT 3.5, GPT-4, GPT-4 Turbo with Vision,
|
||||
and Claude 3 Opus.
|
||||
It also has support for [connecting to almost any LLM](https://aider.chat/docs/llms.html).
|
||||
|
||||
Aider works well with GPT-4o, Claude 3 Opus, GPT-3.5 and supports [connecting to almost any LLM](https://aider.chat/docs/llms.html).
|
||||
|
||||
## Tutorial videos
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue