mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-10 14:45:00 +00:00
Merge branch 'main' into mixpanel
This commit is contained in:
commit
068fb38a5d
181 changed files with 141428 additions and 1961 deletions
|
@ -19,7 +19,7 @@ and there's a lot
|
|||
of interest about their ability to code compared to the previous versions.
|
||||
With that in mind, I've been benchmarking the new models.
|
||||
|
||||
[Aider](https://github.com/paul-gauthier/aider)
|
||||
[Aider](https://github.com/Aider-AI/aider)
|
||||
is an open source command line chat tool that lets you work with GPT to edit
|
||||
code in your local git repo.
|
||||
To do this, aider needs to be able to reliably recognize when GPT wants to edit
|
||||
|
|
|
@ -20,7 +20,7 @@ and there's a lot
|
|||
of interest about their capabilities and performance.
|
||||
With that in mind, I've been benchmarking the new models.
|
||||
|
||||
[Aider](https://github.com/paul-gauthier/aider)
|
||||
[Aider](https://github.com/Aider-AI/aider)
|
||||
is an open source command line chat tool that lets you work with GPT to edit
|
||||
code in your local git repo.
|
||||
Aider relies on a
|
||||
|
|
|
@ -55,7 +55,7 @@ about prompting GPT for complex tasks like coding. It's beneficial to
|
|||
minimize the "cognitive overhead" of formatting the response, allowing
|
||||
GPT to concentrate on the coding task at hand.
|
||||
|
||||
As a thought experiment, imagine a slack conversation with a junior developer where
|
||||
As a thought experiment, imagine a slack conversation with a editor developer where
|
||||
you ask them to write the code to add some new feature to your app.
|
||||
They're going to type the response back to you by hand in the chat.
|
||||
Should they type out the
|
||||
|
@ -168,7 +168,7 @@ requests:
|
|||
### whole
|
||||
|
||||
The
|
||||
[whole](https://github.com/paul-gauthier/aider/blob/main/aider/coders/wholefile_prompts.py)
|
||||
[whole](https://github.com/Aider-AI/aider/blob/main/aider/coders/wholefile_prompts.py)
|
||||
format asks GPT to return an updated copy of the entire file, including any changes.
|
||||
The file should be
|
||||
formatted with normal markdown triple-backtick fences, inlined with the rest of its response text.
|
||||
|
@ -187,7 +187,7 @@ def main():
|
|||
|
||||
### diff
|
||||
|
||||
The [diff](https://github.com/paul-gauthier/aider/blob/main/aider/coders/editblock_prompts.py)
|
||||
The [diff](https://github.com/Aider-AI/aider/blob/main/aider/coders/editblock_prompts.py)
|
||||
format also asks GPT to return edits as part of the normal response text,
|
||||
in a simple diff format.
|
||||
Each edit is a fenced code block that
|
||||
|
@ -209,7 +209,7 @@ demo.py
|
|||
|
||||
### whole-func
|
||||
|
||||
The [whole-func](https://github.com/paul-gauthier/aider/blob/main/aider/coders/wholefile_func_coder.py)
|
||||
The [whole-func](https://github.com/Aider-AI/aider/blob/main/aider/coders/wholefile_func_coder.py)
|
||||
format requests updated copies of whole files to be returned using the function call API.
|
||||
|
||||
|
||||
|
@ -227,7 +227,7 @@ format requests updated copies of whole files to be returned using the function
|
|||
### diff-func
|
||||
|
||||
The
|
||||
[diff-func](https://github.com/paul-gauthier/aider/blob/main/aider/coders/editblock_func_coder.py)
|
||||
[diff-func](https://github.com/Aider-AI/aider/blob/main/aider/coders/editblock_func_coder.py)
|
||||
format requests a list of
|
||||
original/updated style edits to be returned using the function call API.
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -21,11 +21,28 @@ load whichever is found first.
|
|||
|
||||
{% include env-keys-tip.md %}
|
||||
|
||||
## A note on lists
|
||||
|
||||
Lists of values can be specified either as a bulleted list:
|
||||
|
||||
```
|
||||
read:
|
||||
- CONVENTIONS.md
|
||||
- anotherfile.txt
|
||||
- thirdfile.py
|
||||
```
|
||||
|
||||
Or lists can be specified using commas and square brackets:
|
||||
|
||||
```
|
||||
read: [CONVENTIONS.md, anotherfile.txt, thirdfile.py]
|
||||
```
|
||||
|
||||
## Sample YAML config file
|
||||
|
||||
Below is a sample of the YAML config file, which you
|
||||
can also
|
||||
[download from GitHub](https://github.com/paul-gauthier/aider/blob/main/aider/website/assets/sample.aider.conf.yml).
|
||||
[download from GitHub](https://github.com/Aider-AI/aider/blob/main/aider/website/assets/sample.aider.conf.yml).
|
||||
|
||||
<!--[[[cog
|
||||
from aider.args import get_sample_yaml
|
||||
|
@ -51,30 +68,30 @@ cog.outl("```")
|
|||
# options:
|
||||
|
||||
## show this help message and exit
|
||||
#help:
|
||||
#help: xxx
|
||||
|
||||
#######
|
||||
# Main:
|
||||
|
||||
## Specify the OpenAI API key
|
||||
#openai-api-key:
|
||||
#openai-api-key: xxx
|
||||
|
||||
## Specify the Anthropic API key
|
||||
#anthropic-api-key:
|
||||
#anthropic-api-key: xxx
|
||||
|
||||
## Specify the model to use for the main chat
|
||||
#model:
|
||||
#model: xxx
|
||||
|
||||
## Use claude-3-opus-20240229 model for the main chat
|
||||
#opus: false
|
||||
|
||||
## Use claude-3-5-sonnet-20240620 model for the main chat
|
||||
## Use claude-3-5-sonnet-20241022 model for the main chat
|
||||
#sonnet: false
|
||||
|
||||
## Use gpt-4-0613 model for the main chat
|
||||
#4: false
|
||||
|
||||
## Use gpt-4o model for the main chat
|
||||
## Use gpt-4o-2024-08-06 model for the main chat
|
||||
#4o: false
|
||||
|
||||
## Use gpt-4o-mini model for the main chat
|
||||
|
@ -89,26 +106,32 @@ cog.outl("```")
|
|||
## Use deepseek/deepseek-coder model for the main chat
|
||||
#deepseek: false
|
||||
|
||||
## Use o1-mini model for the main chat
|
||||
#o1-mini: false
|
||||
|
||||
## Use o1-preview model for the main chat
|
||||
#o1-preview: false
|
||||
|
||||
#################
|
||||
# Model Settings:
|
||||
|
||||
## List known models which match the (partial) MODEL name
|
||||
#models:
|
||||
#list-models: xxx
|
||||
|
||||
## Specify the api base url
|
||||
#openai-api-base:
|
||||
#openai-api-base: xxx
|
||||
|
||||
## Specify the api_type
|
||||
#openai-api-type:
|
||||
#openai-api-type: xxx
|
||||
|
||||
## Specify the api_version
|
||||
#openai-api-version:
|
||||
#openai-api-version: xxx
|
||||
|
||||
## Specify the deployment_id
|
||||
#openai-api-deployment-id:
|
||||
#openai-api-deployment-id: xxx
|
||||
|
||||
## Specify the OpenAI organization ID
|
||||
#openai-organization-id:
|
||||
#openai-organization-id: xxx
|
||||
|
||||
## Specify a file with aider model settings for unknown models
|
||||
#model-settings-file: .aider.model.settings.yml
|
||||
|
@ -120,23 +143,50 @@ cog.outl("```")
|
|||
#verify-ssl: true
|
||||
|
||||
## Specify what edit format the LLM should use (default depends on model)
|
||||
#edit-format:
|
||||
#edit-format: xxx
|
||||
|
||||
## Use architect edit format for the main chat
|
||||
#architect: false
|
||||
|
||||
## Specify the model to use for commit messages and chat history summarization (default depends on --model)
|
||||
#weak-model:
|
||||
#weak-model: xxx
|
||||
|
||||
## Specify the model to use for editor tasks (default depends on --model)
|
||||
#editor-model: xxx
|
||||
|
||||
## Specify the edit format for the editor model (default: depends on editor model)
|
||||
#editor-edit-format: xxx
|
||||
|
||||
## Only work with models that have meta-data available (default: True)
|
||||
#show-model-warnings: true
|
||||
|
||||
## Max number of tokens to use for repo map, use 0 to disable (default: 1024)
|
||||
#map-tokens:
|
||||
|
||||
## Maximum number of tokens to use for chat history. If not specified, uses the model's max_chat_history_tokens.
|
||||
#max-chat-history-tokens:
|
||||
## Soft limit on tokens for chat history, after which summarization begins. If unspecified, defaults to the model's max_chat_history_tokens.
|
||||
#max-chat-history-tokens: xxx
|
||||
|
||||
## Specify the .env file to load (default: .env in git root)
|
||||
#env-file: .env
|
||||
|
||||
#################
|
||||
# Cache Settings:
|
||||
|
||||
## Enable caching of prompts (default: False)
|
||||
#cache-prompts: false
|
||||
|
||||
## Number of times to ping at 5min intervals to keep prompt cache warm (default: 0)
|
||||
#cache-keepalive-pings: false
|
||||
|
||||
###################
|
||||
# Repomap Settings:
|
||||
|
||||
## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)
|
||||
#map-tokens: xxx
|
||||
|
||||
## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto)
|
||||
#map-refresh: auto
|
||||
|
||||
## Multiplier for map tokens when no files are specified (default: 2)
|
||||
#map-multiplier-no-files: true
|
||||
|
||||
################
|
||||
# History Files:
|
||||
|
||||
|
@ -150,7 +200,7 @@ cog.outl("```")
|
|||
#restore-chat-history: false
|
||||
|
||||
## Log the conversation with the LLM to this file (for example, .aider.llm.history)
|
||||
#llm-history-file:
|
||||
#llm-history-file: xxx
|
||||
|
||||
##################
|
||||
# Output Settings:
|
||||
|
@ -171,14 +221,29 @@ cog.outl("```")
|
|||
#user-input-color: #00cc00
|
||||
|
||||
## Set the color for tool output (default: None)
|
||||
#tool-output-color:
|
||||
#tool-output-color: xxx
|
||||
|
||||
## Set the color for tool error messages (default: red)
|
||||
## Set the color for tool error messages (default: #FF2222)
|
||||
#tool-error-color: #FF2222
|
||||
|
||||
## Set the color for tool warning messages (default: #FFA500)
|
||||
#tool-warning-color: #FFA500
|
||||
|
||||
## Set the color for assistant output (default: #0088ff)
|
||||
#assistant-output-color: #0088ff
|
||||
|
||||
## Set the color for the completion menu (default: terminal's default text color)
|
||||
#completion-menu-color: xxx
|
||||
|
||||
## Set the background color for the completion menu (default: terminal's default background color)
|
||||
#completion-menu-bg-color: xxx
|
||||
|
||||
## Set the color for the current item in the completion menu (default: terminal's default background color)
|
||||
#completion-menu-current-color: xxx
|
||||
|
||||
## Set the background color for the current item in the completion menu (default: terminal's default text color)
|
||||
#completion-menu-current-bg-color: xxx
|
||||
|
||||
## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light)
|
||||
#code-theme: default
|
||||
|
||||
|
@ -222,11 +287,14 @@ cog.outl("```")
|
|||
#commit: false
|
||||
|
||||
## Specify a custom prompt for generating commit messages
|
||||
#commit-prompt:
|
||||
#commit-prompt: xxx
|
||||
|
||||
## Perform a dry run without modifying files (default: False)
|
||||
#dry-run: false
|
||||
|
||||
## Skip the sanity check for the git repository (default: False)
|
||||
#skip-sanity-check-repo: false
|
||||
|
||||
########################
|
||||
# Fixing and committing:
|
||||
|
||||
|
@ -234,13 +302,18 @@ cog.outl("```")
|
|||
#lint: false
|
||||
|
||||
## Specify lint commands to run for different languages, eg: "python: flake8 --select=..." (can be used multiple times)
|
||||
#lint-cmd: xxx
|
||||
## Specify multiple values like this:
|
||||
#lint-cmd:
|
||||
# - xxx
|
||||
# - yyy
|
||||
# - zzz
|
||||
|
||||
## Enable/disable automatic linting after changes (default: True)
|
||||
#auto-lint: true
|
||||
|
||||
## Specify command to run tests
|
||||
#test-cmd:
|
||||
#test-cmd: xxx
|
||||
|
||||
## Enable/disable automatic testing after changes (default: False)
|
||||
#auto-test: false
|
||||
|
@ -264,19 +337,29 @@ cog.outl("```")
|
|||
# Other Settings:
|
||||
|
||||
## specify a file to edit (can be used multiple times)
|
||||
#file: xxx
|
||||
## Specify multiple values like this:
|
||||
#file:
|
||||
# - xxx
|
||||
# - yyy
|
||||
# - zzz
|
||||
|
||||
## specify a read-only file (can be used multiple times)
|
||||
#read: xxx
|
||||
## Specify multiple values like this:
|
||||
#read:
|
||||
# - xxx
|
||||
# - yyy
|
||||
# - zzz
|
||||
|
||||
## Use VI editing mode in the terminal (default: False)
|
||||
#vim: false
|
||||
|
||||
## Specify the language for voice using ISO 639-1 code (default: auto)
|
||||
#voice-language: en
|
||||
## Specify the language to use in the chat (default: None, uses system settings)
|
||||
#chat-language: xxx
|
||||
|
||||
## Show the version number and exit
|
||||
#version:
|
||||
#version: xxx
|
||||
|
||||
## Check for updates and return status in the exit code
|
||||
#just-check-update: false
|
||||
|
@ -284,11 +367,17 @@ cog.outl("```")
|
|||
## Check for new aider versions on launch
|
||||
#check-update: true
|
||||
|
||||
## Install the latest version from the main branch
|
||||
#install-main-branch: false
|
||||
|
||||
## Upgrade aider to the latest version from PyPI
|
||||
#upgrade: false
|
||||
|
||||
## Apply the changes from the given file instead of running the chat (debug)
|
||||
#apply:
|
||||
#apply: xxx
|
||||
|
||||
## Always say yes to every confirmation
|
||||
#yes: false
|
||||
#yes-always: false
|
||||
|
||||
## Enable verbose output
|
||||
#verbose: false
|
||||
|
@ -303,18 +392,36 @@ cog.outl("```")
|
|||
#exit: false
|
||||
|
||||
## Specify a single message to send the LLM, process reply then exit (disables chat mode)
|
||||
#message:
|
||||
#message: xxx
|
||||
|
||||
## Specify a file containing the message to send the LLM, process reply, then exit (disables chat mode)
|
||||
#message-file:
|
||||
#message-file: xxx
|
||||
|
||||
## Load and execute /commands from a file on launch
|
||||
#load: xxx
|
||||
|
||||
## Specify the encoding for input and output (default: utf-8)
|
||||
#encoding: utf-8
|
||||
|
||||
## Specify the config file (default: search for .aider.conf.yml in git root, cwd or home directory)
|
||||
#config:
|
||||
#config: xxx
|
||||
|
||||
## Run aider in your browser
|
||||
#gui: false
|
||||
|
||||
## Enable/disable suggesting shell commands (default: True)
|
||||
#suggest-shell-commands: true
|
||||
|
||||
## Enable/disable fancy input with history and completion (default: True)
|
||||
#fancy-input: true
|
||||
|
||||
#################
|
||||
# Voice Settings:
|
||||
|
||||
## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg
|
||||
#voice-format: wav
|
||||
|
||||
## Specify the language for voice using ISO 639-1 code (default: auto)
|
||||
#voice-language: en
|
||||
```
|
||||
<!--[[[end]]]-->
|
||||
|
|
|
@ -28,7 +28,7 @@ If the files above exist, they will be loaded in that order. Files loaded last w
|
|||
|
||||
Below is a sample `.env` file, which you
|
||||
can also
|
||||
[download from GitHub](https://github.com/paul-gauthier/aider/blob/main/aider/website/assets/sample.env).
|
||||
[download from GitHub](https://github.com/Aider-AI/aider/blob/main/aider/website/assets/sample.env).
|
||||
|
||||
<!--[[[cog
|
||||
from aider.args import get_sample_dotenv
|
||||
|
@ -75,13 +75,13 @@ cog.outl("```")
|
|||
## Use claude-3-opus-20240229 model for the main chat
|
||||
#AIDER_OPUS=
|
||||
|
||||
## Use claude-3-5-sonnet-20240620 model for the main chat
|
||||
## Use claude-3-5-sonnet-20241022 model for the main chat
|
||||
#AIDER_SONNET=
|
||||
|
||||
## Use gpt-4-0613 model for the main chat
|
||||
#AIDER_4=
|
||||
|
||||
## Use gpt-4o model for the main chat
|
||||
## Use gpt-4o-2024-08-06 model for the main chat
|
||||
#AIDER_4O=
|
||||
|
||||
## Use gpt-4o-mini model for the main chat
|
||||
|
@ -96,11 +96,17 @@ cog.outl("```")
|
|||
## Use deepseek/deepseek-coder model for the main chat
|
||||
#AIDER_DEEPSEEK=
|
||||
|
||||
## Use o1-mini model for the main chat
|
||||
#AIDER_O1_MINI=
|
||||
|
||||
## Use o1-preview model for the main chat
|
||||
#AIDER_O1_PREVIEW=
|
||||
|
||||
#################
|
||||
# Model Settings:
|
||||
|
||||
## List known models which match the (partial) MODEL name
|
||||
#AIDER_MODELS=
|
||||
#AIDER_LIST_MODELS=
|
||||
|
||||
## Specify the api base url
|
||||
#OPENAI_API_BASE=
|
||||
|
@ -129,21 +135,48 @@ cog.outl("```")
|
|||
## Specify what edit format the LLM should use (default depends on model)
|
||||
#AIDER_EDIT_FORMAT=
|
||||
|
||||
## Use architect edit format for the main chat
|
||||
#AIDER_ARCHITECT=
|
||||
|
||||
## Specify the model to use for commit messages and chat history summarization (default depends on --model)
|
||||
#AIDER_WEAK_MODEL=
|
||||
|
||||
## Specify the model to use for editor tasks (default depends on --model)
|
||||
#AIDER_EDITOR_MODEL=
|
||||
|
||||
## Specify the edit format for the editor model (default: depends on editor model)
|
||||
#AIDER_EDITOR_EDIT_FORMAT=
|
||||
|
||||
## Only work with models that have meta-data available (default: True)
|
||||
#AIDER_SHOW_MODEL_WARNINGS=true
|
||||
|
||||
## Max number of tokens to use for repo map, use 0 to disable (default: 1024)
|
||||
#AIDER_MAP_TOKENS=
|
||||
|
||||
## Maximum number of tokens to use for chat history. If not specified, uses the model's max_chat_history_tokens.
|
||||
## Soft limit on tokens for chat history, after which summarization begins. If unspecified, defaults to the model's max_chat_history_tokens.
|
||||
#AIDER_MAX_CHAT_HISTORY_TOKENS=
|
||||
|
||||
## Specify the .env file to load (default: .env in git root)
|
||||
#AIDER_ENV_FILE=.env
|
||||
|
||||
#################
|
||||
# Cache Settings:
|
||||
|
||||
## Enable caching of prompts (default: False)
|
||||
#AIDER_CACHE_PROMPTS=false
|
||||
|
||||
## Number of times to ping at 5min intervals to keep prompt cache warm (default: 0)
|
||||
#AIDER_CACHE_KEEPALIVE_PINGS=false
|
||||
|
||||
###################
|
||||
# Repomap Settings:
|
||||
|
||||
## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)
|
||||
#AIDER_MAP_TOKENS=
|
||||
|
||||
## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto)
|
||||
#AIDER_MAP_REFRESH=auto
|
||||
|
||||
## Multiplier for map tokens when no files are specified (default: 2)
|
||||
#AIDER_MAP_MULTIPLIER_NO_FILES=true
|
||||
|
||||
################
|
||||
# History Files:
|
||||
|
||||
|
@ -180,12 +213,27 @@ cog.outl("```")
|
|||
## Set the color for tool output (default: None)
|
||||
#AIDER_TOOL_OUTPUT_COLOR=
|
||||
|
||||
## Set the color for tool error messages (default: red)
|
||||
## Set the color for tool error messages (default: #FF2222)
|
||||
#AIDER_TOOL_ERROR_COLOR=#FF2222
|
||||
|
||||
## Set the color for tool warning messages (default: #FFA500)
|
||||
#AIDER_TOOL_WARNING_COLOR=#FFA500
|
||||
|
||||
## Set the color for assistant output (default: #0088ff)
|
||||
#AIDER_ASSISTANT_OUTPUT_COLOR=#0088ff
|
||||
|
||||
## Set the color for the completion menu (default: terminal's default text color)
|
||||
#AIDER_COMPLETION_MENU_COLOR=
|
||||
|
||||
## Set the background color for the completion menu (default: terminal's default background color)
|
||||
#AIDER_COMPLETION_MENU_BG_COLOR=
|
||||
|
||||
## Set the color for the current item in the completion menu (default: terminal's default background color)
|
||||
#AIDER_COMPLETION_MENU_CURRENT_COLOR=
|
||||
|
||||
## Set the background color for the current item in the completion menu (default: terminal's default text color)
|
||||
#AIDER_COMPLETION_MENU_CURRENT_BG_COLOR=
|
||||
|
||||
## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light)
|
||||
#AIDER_CODE_THEME=default
|
||||
|
||||
|
@ -234,6 +282,9 @@ cog.outl("```")
|
|||
## Perform a dry run without modifying files (default: False)
|
||||
#AIDER_DRY_RUN=false
|
||||
|
||||
## Skip the sanity check for the git repository (default: False)
|
||||
#AIDER_SKIP_SANITY_CHECK_REPO=false
|
||||
|
||||
########################
|
||||
# Fixing and committing:
|
||||
|
||||
|
@ -279,8 +330,8 @@ cog.outl("```")
|
|||
## Use VI editing mode in the terminal (default: False)
|
||||
#AIDER_VIM=false
|
||||
|
||||
## Specify the language for voice using ISO 639-1 code (default: auto)
|
||||
#AIDER_VOICE_LANGUAGE=en
|
||||
## Specify the language to use in the chat (default: None, uses system settings)
|
||||
#AIDER_CHAT_LANGUAGE=
|
||||
|
||||
## Check for updates and return status in the exit code
|
||||
#AIDER_JUST_CHECK_UPDATE=false
|
||||
|
@ -288,11 +339,17 @@ cog.outl("```")
|
|||
## Check for new aider versions on launch
|
||||
#AIDER_CHECK_UPDATE=true
|
||||
|
||||
## Install the latest version from the main branch
|
||||
#AIDER_INSTALL_MAIN_BRANCH=false
|
||||
|
||||
## Upgrade aider to the latest version from PyPI
|
||||
#AIDER_UPGRADE=false
|
||||
|
||||
## Apply the changes from the given file instead of running the chat (debug)
|
||||
#AIDER_APPLY=
|
||||
|
||||
## Always say yes to every confirmation
|
||||
#AIDER_YES=
|
||||
#AIDER_YES_ALWAYS=
|
||||
|
||||
## Enable verbose output
|
||||
#AIDER_VERBOSE=false
|
||||
|
@ -312,11 +369,29 @@ cog.outl("```")
|
|||
## Specify a file containing the message to send the LLM, process reply, then exit (disables chat mode)
|
||||
#AIDER_MESSAGE_FILE=
|
||||
|
||||
## Load and execute /commands from a file on launch
|
||||
#AIDER_LOAD=
|
||||
|
||||
## Specify the encoding for input and output (default: utf-8)
|
||||
#AIDER_ENCODING=utf-8
|
||||
|
||||
## Run aider in your browser
|
||||
#AIDER_GUI=false
|
||||
|
||||
## Enable/disable suggesting shell commands (default: True)
|
||||
#AIDER_SUGGEST_SHELL_COMMANDS=true
|
||||
|
||||
## Enable/disable fancy input with history and completion (default: True)
|
||||
#AIDER_FANCY_INPUT=true
|
||||
|
||||
#################
|
||||
# Voice Settings:
|
||||
|
||||
## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg
|
||||
#AIDER_VOICE_FORMAT=wav
|
||||
|
||||
## Specify the language for voice using ISO 639-1 code (default: auto)
|
||||
#AIDER_VOICE_LANGUAGE=en
|
||||
```
|
||||
<!--[[[end]]]-->
|
||||
|
||||
|
|
|
@ -27,21 +27,30 @@ cog.out(get_md_help())
|
|||
```
|
||||
usage: aider [-h] [--openai-api-key] [--anthropic-api-key] [--model]
|
||||
[--opus] [--sonnet] [--4] [--4o] [--mini] [--4-turbo]
|
||||
[--35turbo] [--deepseek] [--models] [--openai-api-base]
|
||||
[--openai-api-type] [--openai-api-version]
|
||||
[--openai-api-deployment-id] [--openai-organization-id]
|
||||
[--model-settings-file] [--model-metadata-file]
|
||||
[--35turbo] [--deepseek] [--o1-mini] [--o1-preview]
|
||||
[--list-models] [--openai-api-base] [--openai-api-type]
|
||||
[--openai-api-version] [--openai-api-deployment-id]
|
||||
[--openai-organization-id] [--model-settings-file]
|
||||
[--model-metadata-file]
|
||||
[--verify-ssl | --no-verify-ssl] [--edit-format]
|
||||
[--weak-model]
|
||||
[--architect] [--weak-model] [--editor-model]
|
||||
[--editor-edit-format]
|
||||
[--show-model-warnings | --no-show-model-warnings]
|
||||
[--map-tokens] [--max-chat-history-tokens] [--env-file]
|
||||
[--max-chat-history-tokens] [--env-file]
|
||||
[--cache-prompts | --no-cache-prompts]
|
||||
[--cache-keepalive-pings] [--map-tokens]
|
||||
[--map-refresh] [--map-multiplier-no-files]
|
||||
[--input-history-file] [--chat-history-file]
|
||||
[--restore-chat-history | --no-restore-chat-history]
|
||||
[--llm-history-file] [--dark-mode] [--light-mode]
|
||||
[--pretty | --no-pretty] [--stream | --no-stream]
|
||||
[--user-input-color] [--tool-output-color]
|
||||
[--tool-error-color] [--assistant-output-color]
|
||||
[--code-theme] [--show-diffs] [--git | --no-git]
|
||||
[--tool-error-color] [--tool-warning-color]
|
||||
[--assistant-output-color] [--completion-menu-color]
|
||||
[--completion-menu-bg-color]
|
||||
[--completion-menu-current-color]
|
||||
[--completion-menu-current-bg-color] [--code-theme]
|
||||
[--show-diffs] [--git | --no-git]
|
||||
[--gitignore | --no-gitignore] [--aiderignore]
|
||||
[--subtree-only] [--auto-commits | --no-auto-commits]
|
||||
[--dirty-commits | --no-dirty-commits]
|
||||
|
@ -50,14 +59,20 @@ usage: aider [-h] [--openai-api-key] [--anthropic-api-key] [--model]
|
|||
[--attribute-commit-message-author | --no-attribute-commit-message-author]
|
||||
[--attribute-commit-message-committer | --no-attribute-commit-message-committer]
|
||||
[--commit] [--commit-prompt] [--dry-run | --no-dry-run]
|
||||
[--lint] [--lint-cmd] [--auto-lint | --no-auto-lint]
|
||||
[--test-cmd] [--auto-test | --no-auto-test] [--test]
|
||||
[--skip-sanity-check-repo] [--lint] [--lint-cmd]
|
||||
[--auto-lint | --no-auto-lint] [--test-cmd]
|
||||
[--auto-test | --no-auto-test] [--test]
|
||||
[--analytics | --no-analytics] [--analytics-log]
|
||||
[--analytics-disable] [--file] [--read] [--vim]
|
||||
[--voice-language] [--version] [--just-check-update]
|
||||
[--check-update | --no-check-update] [--apply] [--yes]
|
||||
[-v] [--show-repo-map] [--show-prompts] [--exit]
|
||||
[--message] [--message-file] [--encoding] [-c] [--gui]
|
||||
[--chat-language] [--version] [--just-check-update]
|
||||
[--check-update | --no-check-update]
|
||||
[--install-main-branch] [--upgrade] [--apply]
|
||||
[--yes-always] [-v] [--show-repo-map] [--show-prompts]
|
||||
[--exit] [--message] [--message-file] [--load]
|
||||
[--encoding] [-c] [--gui]
|
||||
[--suggest-shell-commands | --no-suggest-shell-commands]
|
||||
[--fancy-input | --no-fancy-input] [--voice-format]
|
||||
[--voice-language]
|
||||
|
||||
```
|
||||
|
||||
|
@ -88,7 +103,7 @@ Use claude-3-opus-20240229 model for the main chat
|
|||
Environment variable: `AIDER_OPUS`
|
||||
|
||||
### `--sonnet`
|
||||
Use claude-3-5-sonnet-20240620 model for the main chat
|
||||
Use claude-3-5-sonnet-20241022 model for the main chat
|
||||
Environment variable: `AIDER_SONNET`
|
||||
|
||||
### `--4`
|
||||
|
@ -99,7 +114,7 @@ Aliases:
|
|||
- `-4`
|
||||
|
||||
### `--4o`
|
||||
Use gpt-4o model for the main chat
|
||||
Use gpt-4o-2024-08-06 model for the main chat
|
||||
Environment variable: `AIDER_4O`
|
||||
|
||||
### `--mini`
|
||||
|
@ -123,11 +138,22 @@ Aliases:
|
|||
Use deepseek/deepseek-coder model for the main chat
|
||||
Environment variable: `AIDER_DEEPSEEK`
|
||||
|
||||
### `--o1-mini`
|
||||
Use o1-mini model for the main chat
|
||||
Environment variable: `AIDER_O1_MINI`
|
||||
|
||||
### `--o1-preview`
|
||||
Use o1-preview model for the main chat
|
||||
Environment variable: `AIDER_O1_PREVIEW`
|
||||
|
||||
## Model Settings:
|
||||
|
||||
### `--models MODEL`
|
||||
### `--list-models MODEL`
|
||||
List known models which match the (partial) MODEL name
|
||||
Environment variable: `AIDER_MODELS`
|
||||
Environment variable: `AIDER_LIST_MODELS`
|
||||
Aliases:
|
||||
- `--list-models MODEL`
|
||||
- `--models MODEL`
|
||||
|
||||
### `--openai-api-base OPENAI_API_BASE`
|
||||
Specify the api base url
|
||||
|
@ -174,10 +200,22 @@ Aliases:
|
|||
- `--edit-format EDIT_FORMAT`
|
||||
- `--chat-mode EDIT_FORMAT`
|
||||
|
||||
### `--architect`
|
||||
Use architect edit format for the main chat
|
||||
Environment variable: `AIDER_ARCHITECT`
|
||||
|
||||
### `--weak-model WEAK_MODEL`
|
||||
Specify the model to use for commit messages and chat history summarization (default depends on --model)
|
||||
Environment variable: `AIDER_WEAK_MODEL`
|
||||
|
||||
### `--editor-model EDITOR_MODEL`
|
||||
Specify the model to use for editor tasks (default depends on --model)
|
||||
Environment variable: `AIDER_EDITOR_MODEL`
|
||||
|
||||
### `--editor-edit-format EDITOR_EDIT_FORMAT`
|
||||
Specify the edit format for the editor model (default: depends on editor model)
|
||||
Environment variable: `AIDER_EDITOR_EDIT_FORMAT`
|
||||
|
||||
### `--show-model-warnings`
|
||||
Only work with models that have meta-data available (default: True)
|
||||
Default: True
|
||||
|
@ -186,12 +224,8 @@ Aliases:
|
|||
- `--show-model-warnings`
|
||||
- `--no-show-model-warnings`
|
||||
|
||||
### `--map-tokens VALUE`
|
||||
Max number of tokens to use for repo map, use 0 to disable (default: 1024)
|
||||
Environment variable: `AIDER_MAP_TOKENS`
|
||||
|
||||
### `--max-chat-history-tokens VALUE`
|
||||
Maximum number of tokens to use for chat history. If not specified, uses the model's max_chat_history_tokens.
|
||||
Soft limit on tokens for chat history, after which summarization begins. If unspecified, defaults to the model's max_chat_history_tokens.
|
||||
Environment variable: `AIDER_MAX_CHAT_HISTORY_TOKENS`
|
||||
|
||||
### `--env-file ENV_FILE`
|
||||
|
@ -199,6 +233,37 @@ Specify the .env file to load (default: .env in git root)
|
|||
Default: .env
|
||||
Environment variable: `AIDER_ENV_FILE`
|
||||
|
||||
## Cache Settings:
|
||||
|
||||
### `--cache-prompts`
|
||||
Enable caching of prompts (default: False)
|
||||
Default: False
|
||||
Environment variable: `AIDER_CACHE_PROMPTS`
|
||||
Aliases:
|
||||
- `--cache-prompts`
|
||||
- `--no-cache-prompts`
|
||||
|
||||
### `--cache-keepalive-pings VALUE`
|
||||
Number of times to ping at 5min intervals to keep prompt cache warm (default: 0)
|
||||
Default: 0
|
||||
Environment variable: `AIDER_CACHE_KEEPALIVE_PINGS`
|
||||
|
||||
## Repomap Settings:
|
||||
|
||||
### `--map-tokens VALUE`
|
||||
Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)
|
||||
Environment variable: `AIDER_MAP_TOKENS`
|
||||
|
||||
### `--map-refresh VALUE`
|
||||
Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto)
|
||||
Default: auto
|
||||
Environment variable: `AIDER_MAP_REFRESH`
|
||||
|
||||
### `--map-multiplier-no-files VALUE`
|
||||
Multiplier for map tokens when no files are specified (default: 2)
|
||||
Default: 2
|
||||
Environment variable: `AIDER_MAP_MULTIPLIER_NO_FILES`
|
||||
|
||||
## History Files:
|
||||
|
||||
### `--input-history-file INPUT_HISTORY_FILE`
|
||||
|
@ -261,15 +326,36 @@ Set the color for tool output (default: None)
|
|||
Environment variable: `AIDER_TOOL_OUTPUT_COLOR`
|
||||
|
||||
### `--tool-error-color VALUE`
|
||||
Set the color for tool error messages (default: red)
|
||||
Set the color for tool error messages (default: #FF2222)
|
||||
Default: #FF2222
|
||||
Environment variable: `AIDER_TOOL_ERROR_COLOR`
|
||||
|
||||
### `--tool-warning-color VALUE`
|
||||
Set the color for tool warning messages (default: #FFA500)
|
||||
Default: #FFA500
|
||||
Environment variable: `AIDER_TOOL_WARNING_COLOR`
|
||||
|
||||
### `--assistant-output-color VALUE`
|
||||
Set the color for assistant output (default: #0088ff)
|
||||
Default: #0088ff
|
||||
Environment variable: `AIDER_ASSISTANT_OUTPUT_COLOR`
|
||||
|
||||
### `--completion-menu-color COLOR`
|
||||
Set the color for the completion menu (default: terminal's default text color)
|
||||
Environment variable: `AIDER_COMPLETION_MENU_COLOR`
|
||||
|
||||
### `--completion-menu-bg-color COLOR`
|
||||
Set the background color for the completion menu (default: terminal's default background color)
|
||||
Environment variable: `AIDER_COMPLETION_MENU_BG_COLOR`
|
||||
|
||||
### `--completion-menu-current-color COLOR`
|
||||
Set the color for the current item in the completion menu (default: terminal's default background color)
|
||||
Environment variable: `AIDER_COMPLETION_MENU_CURRENT_COLOR`
|
||||
|
||||
### `--completion-menu-current-bg-color COLOR`
|
||||
Set the background color for the current item in the completion menu (default: terminal's default text color)
|
||||
Environment variable: `AIDER_COMPLETION_MENU_CURRENT_BG_COLOR`
|
||||
|
||||
### `--code-theme VALUE`
|
||||
Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light)
|
||||
Default: default
|
||||
|
@ -373,6 +459,11 @@ Aliases:
|
|||
- `--dry-run`
|
||||
- `--no-dry-run`
|
||||
|
||||
### `--skip-sanity-check-repo`
|
||||
Skip the sanity check for the git repository (default: False)
|
||||
Default: False
|
||||
Environment variable: `AIDER_SKIP_SANITY_CHECK_REPO`
|
||||
|
||||
## Fixing and committing:
|
||||
|
||||
### `--lint`
|
||||
|
@ -426,7 +517,7 @@ Specify a file to log analytics events
|
|||
Environment variable: `AIDER_ANALYTICS_LOG`
|
||||
|
||||
### `--analytics-disable`
|
||||
Disable analytics forever
|
||||
Permanently disable analytics
|
||||
Default: False
|
||||
Environment variable: `AIDER_ANALYTICS_DISABLE`
|
||||
|
||||
|
@ -445,10 +536,9 @@ Use VI editing mode in the terminal (default: False)
|
|||
Default: False
|
||||
Environment variable: `AIDER_VIM`
|
||||
|
||||
### `--voice-language VOICE_LANGUAGE`
|
||||
Specify the language for voice using ISO 639-1 code (default: auto)
|
||||
Default: en
|
||||
Environment variable: `AIDER_VOICE_LANGUAGE`
|
||||
### `--chat-language CHAT_LANGUAGE`
|
||||
Specify the language to use in the chat (default: None, uses system settings)
|
||||
Environment variable: `AIDER_CHAT_LANGUAGE`
|
||||
|
||||
### `--version`
|
||||
Show the version number and exit
|
||||
|
@ -466,13 +556,26 @@ Aliases:
|
|||
- `--check-update`
|
||||
- `--no-check-update`
|
||||
|
||||
### `--install-main-branch`
|
||||
Install the latest version from the main branch
|
||||
Default: False
|
||||
Environment variable: `AIDER_INSTALL_MAIN_BRANCH`
|
||||
|
||||
### `--upgrade`
|
||||
Upgrade aider to the latest version from PyPI
|
||||
Default: False
|
||||
Environment variable: `AIDER_UPGRADE`
|
||||
Aliases:
|
||||
- `--upgrade`
|
||||
- `--update`
|
||||
|
||||
### `--apply FILE`
|
||||
Apply the changes from the given file instead of running the chat (debug)
|
||||
Environment variable: `AIDER_APPLY`
|
||||
|
||||
### `--yes`
|
||||
### `--yes-always`
|
||||
Always say yes to every confirmation
|
||||
Environment variable: `AIDER_YES`
|
||||
Environment variable: `AIDER_YES_ALWAYS`
|
||||
|
||||
### `--verbose`
|
||||
Enable verbose output
|
||||
|
@ -512,6 +615,10 @@ Aliases:
|
|||
- `--message-file MESSAGE_FILE`
|
||||
- `-f MESSAGE_FILE`
|
||||
|
||||
### `--load LOAD_FILE`
|
||||
Load and execute /commands from a file on launch
|
||||
Environment variable: `AIDER_LOAD`
|
||||
|
||||
### `--encoding VALUE`
|
||||
Specify the encoding for input and output (default: utf-8)
|
||||
Default: utf-8
|
||||
|
@ -530,4 +637,32 @@ Environment variable: `AIDER_GUI`
|
|||
Aliases:
|
||||
- `--gui`
|
||||
- `--browser`
|
||||
|
||||
### `--suggest-shell-commands`
|
||||
Enable/disable suggesting shell commands (default: True)
|
||||
Default: True
|
||||
Environment variable: `AIDER_SUGGEST_SHELL_COMMANDS`
|
||||
Aliases:
|
||||
- `--suggest-shell-commands`
|
||||
- `--no-suggest-shell-commands`
|
||||
|
||||
### `--fancy-input`
|
||||
Enable/disable fancy input with history and completion (default: True)
|
||||
Default: True
|
||||
Environment variable: `AIDER_FANCY_INPUT`
|
||||
Aliases:
|
||||
- `--fancy-input`
|
||||
- `--no-fancy-input`
|
||||
|
||||
## Voice Settings:
|
||||
|
||||
### `--voice-format VOICE_FORMAT`
|
||||
Audio format for voice recording (default: wav). webm and mp3 require ffmpeg
|
||||
Default: wav
|
||||
Environment variable: `AIDER_VOICE_FORMAT`
|
||||
|
||||
### `--voice-language VOICE_LANGUAGE`
|
||||
Specify the language for voice using ISO 639-1 code (default: auto)
|
||||
Default: en
|
||||
Environment variable: `AIDER_VOICE_LANGUAGE`
|
||||
<!--[[[end]]]-->
|
||||
|
|
|
@ -12,6 +12,7 @@ nav_exclude: true
|
|||
|
||||

|
||||
|
||||
|
||||
## Updated
|
||||
|
||||
Aider no longer uses ctags to build a repo map.
|
||||
|
@ -111,9 +112,9 @@ like functions and methods also include their signatures.
|
|||
|
||||
Here's a
|
||||
sample of the map of the aider repo, just showing the maps of
|
||||
[main.py](https://github.com/paul-gauthier/aider/blob/main/aider/main.py)
|
||||
[main.py](https://github.com/Aider-AI/aider/blob/main/aider/main.py)
|
||||
and
|
||||
[io.py](https://github.com/paul-gauthier/aider/blob/main/aider/io.py)
|
||||
[io.py](https://github.com/Aider-AI/aider/blob/main/aider/io.py)
|
||||
:
|
||||
|
||||
```
|
||||
|
@ -228,7 +229,7 @@ Some possible approaches to reducing the amount of map data are:
|
|||
|
||||
- Distill the global map, to prioritize important symbols and discard "internal" or otherwise less globally relevant identifiers. Possibly enlist `gpt-3.5-turbo` to perform this distillation in a flexible and language agnostic way.
|
||||
- Provide a mechanism for GPT to start with a distilled subset of the global map, and let it ask to see more detail about subtrees or keywords that it feels are relevant to the current coding task.
|
||||
- Attempt to analyize the natural language coding task given by the user and predict which subset of the repo map is relevant. Possibly by analysis of prior coding chats within the specific repo. Work on certain files or types of features may require certain somewhat predictable context from elsewhere in the repo. Vector and keyword search against the chat history, repo map or codebase may help here.
|
||||
- Attempt to analyze the natural language coding task given by the user and predict which subset of the repo map is relevant. Possibly by analysis of prior coding chats within the specific repo. Work on certain files or types of features may require certain somewhat predictable context from elsewhere in the repo. Vector and keyword search against the chat history, repo map or codebase may help here.
|
||||
|
||||
One key goal is to prefer solutions which are language agnostic or
|
||||
which can be easily deployed against most popular code languages.
|
||||
|
|
|
@ -37,7 +37,7 @@ If you still wish to add lots of files to the chat, you can:
|
|||
|
||||
- Use a wildcard when you launch aider: `aider src/*.py`
|
||||
- Use a wildcard with the in-chat `/add` command: `/add src/*.py`
|
||||
- Give the `/add` command a directory name and it will recurisvely add every file under that dir: `/add src`
|
||||
- Give the `/add` command a directory name and it will recursively add every file under that dir: `/add src`
|
||||
|
||||
## Can I use aider in a large (mono) repo?
|
||||
|
||||
|
@ -45,7 +45,14 @@ Aider will work in any size repo, but is not optimized for quick
|
|||
performance and response time in very large repos.
|
||||
There are some things you can do to improve performance.
|
||||
|
||||
Change into a sub directory of your repo that contains the
|
||||
Be sure to check the
|
||||
[general usage tips](/docs/usage/tips.html)
|
||||
before considering this large-repo specific advice.
|
||||
To get the best results from aider you want to
|
||||
be thoughtful about how you add files to the chat,
|
||||
regardless of your repo size.
|
||||
|
||||
You can change into a sub directory of your repo that contains the
|
||||
code you want to work on and use the `--subtree-only` switch.
|
||||
This will tell aider to ignore the repo outside of the
|
||||
directory you start in.
|
||||
|
@ -59,23 +66,85 @@ to use for ignore patterns.
|
|||
You might have a few of these handy for when you want to work on
|
||||
frontend, backend, etc portions of your repo.
|
||||
|
||||
## Can I use aider with multiple git repos at once?
|
||||
|
||||
Currently aider can only work with one repo at a time.
|
||||
|
||||
There are some things you can try if you need to work with
|
||||
multiple interrelated repos:
|
||||
|
||||
- You can run aider in repo-A where you need to make a change
|
||||
and use `/read` to add some files read-only from another repo-B.
|
||||
This can let aider see key functions or docs from the other repo.
|
||||
- You can run `aider --show-repo-map > map.md` within each
|
||||
repo to create repo maps.
|
||||
You could then run aider in repo-A and
|
||||
use `/read ../path/to/repo-B/map.md` to share
|
||||
a high level map of the other repo.
|
||||
- You can use aider to write documentation about a repo.
|
||||
Inside each repo, you could run `aider docs.md`
|
||||
and work with aider to write some markdown docs.
|
||||
Then while using aider to edit repo-A
|
||||
you can `/read ../path/to/repo-B/docs.md` to
|
||||
read in those docs from the other repo.
|
||||
- In repo A, ask aider to write a small script that demonstrates
|
||||
the functionality you want to use in repo B.
|
||||
Then when you're using aider in repo B, you can
|
||||
`/read` in that script.
|
||||
|
||||
## How do I turn on the repository map?
|
||||
|
||||
Depending on the LLM you are using, aider may launch with the repo map disabled by default:
|
||||
|
||||
```
|
||||
Repo-map: disabled
|
||||
```
|
||||
|
||||
This is because weaker models get easily overwhelmed and confused by the content of the
|
||||
repo map. They sometimes mistakenly try to edit the code in the repo map.
|
||||
The repo map is usually disabled for a good reason.
|
||||
|
||||
If you would like to force it on, you can run aider with `--map-tokens 1024`.
|
||||
|
||||
## How do I include the git history in the context?
|
||||
|
||||
When starting a fresh aider session, you can include recent git history in the chat context. This can be useful for providing the LLM with information about recent changes. To do this:
|
||||
|
||||
1. Use the `/run` command with `git diff` to show recent changes:
|
||||
```
|
||||
/run git diff HEAD~1
|
||||
```
|
||||
This will include the diff of the last commit in the chat history.
|
||||
|
||||
2. To include diffs from multiple commits, increase the number after the tilde:
|
||||
```
|
||||
/run git diff HEAD~3
|
||||
```
|
||||
This will show changes from the last three commits.
|
||||
|
||||
Remember, the chat history already includes recent changes made during the current session, so this tip is most useful when starting a new aider session and you want to provide context about recent work.
|
||||
|
||||
{: .tip }
|
||||
The `/git` command will not work for this purpose, as its output is not included in the chat.
|
||||
|
||||
## How can I run aider locally from source code?
|
||||
|
||||
To run the project locally, follow these steps:
|
||||
|
||||
```
|
||||
# Clone the repository:
|
||||
git clone git@github.com:paul-gauthier/aider.git
|
||||
# Clone the repository
|
||||
git clone git@github.com:Aider-AI/aider.git
|
||||
|
||||
# Navigate to the project directory:
|
||||
# Navigate to the project directory
|
||||
cd aider
|
||||
|
||||
# It's recommended to make a virtual environment
|
||||
|
||||
# Install the dependencies listed in the `requirements.txt` file:
|
||||
# Install aider in editable/development mode,
|
||||
# so it runs from the latest copy of these source files
|
||||
python -m pip install -e .
|
||||
|
||||
# Run the local version of Aider:
|
||||
# Run the local version of aider
|
||||
python -m aider
|
||||
```
|
||||
|
||||
|
@ -122,3 +191,32 @@ You can also refer to the
|
|||
[instructions for installing a development version of aider](https://aider.chat/docs/install/optional.html#install-the-development-version-of-aider).
|
||||
|
||||
|
||||
## Can I share my aider chat transcript?
|
||||
|
||||
Yes, you can now share aider chat logs in a pretty way.
|
||||
|
||||
1. Copy the markdown logs you want to share from `.aider.chat.history.md` and make a github gist. Or publish the raw markdown logs on the web any way you'd like.
|
||||
|
||||
```
|
||||
https://gist.github.com/Aider-AI/2087ab8b64034a078c0a209440ac8be0
|
||||
```
|
||||
|
||||
2. Take the gist URL and append it to:
|
||||
|
||||
```
|
||||
https://aider.chat/share/?mdurl=
|
||||
```
|
||||
|
||||
This will give you a URL like this, which shows the chat history like you'd see in a terminal:
|
||||
|
||||
```
|
||||
https://aider.chat/share/?mdurl=https://gist.github.com/Aider-AI/2087ab8b64034a078c0a209440ac8be0
|
||||
```
|
||||
|
||||
## What is Aider AI LLC?
|
||||
|
||||
Aider AI LLC is the company behind the aider AI coding tool.
|
||||
Aider is
|
||||
[open source and available on GitHub](https://github.com/Aider-AI/aider)
|
||||
under an
|
||||
[Apache 2.0 license](https://github.com/Aider-AI/aider/blob/main/LICENSE.txt).
|
||||
|
|
|
@ -22,9 +22,16 @@ This keeps your edits separate from aider's edits, and makes sure you never lose
|
|||
|
||||
## In-chat commands
|
||||
|
||||
Aider also allows you to use in-chat commands to `/diff` or `/undo` the last change.
|
||||
To do more complex management of your git history, you cat use raw `git` commands,
|
||||
either by using `/git` within the chat, or with standard git tools outside of aider.
|
||||
Aider also allows you to use
|
||||
[in-chat commands](/docs/usage/commands.html)
|
||||
to perform git operations:
|
||||
|
||||
- `/diff` will show all the file changes since the last message you sent.
|
||||
- `/undo` will undo and discard the last change.
|
||||
- `/commit` to commit all dirty changes with a sensible commit message.
|
||||
- `/git` will let you run raw git commands to do more complex management of your git history.
|
||||
|
||||
You can also manage your git history outside of aider with your preferred git tools.
|
||||
|
||||
## Disabling git integration
|
||||
|
||||
|
@ -36,15 +43,18 @@ While it is not recommended, you can disable aider's use of git in a few ways:
|
|||
|
||||
## Commit messages
|
||||
|
||||
Aider sends the `--weak-model` a copy of the diffs and the chat history
|
||||
and asks it to produce a commit message.
|
||||
By default, aider creates commit messages which follow
|
||||
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
|
||||
|
||||
You can customize the
|
||||
[commit prompt](https://github.com/paul-gauthier/aider/blob/main/aider/prompts.py#L5)
|
||||
[commit prompt](https://github.com/Aider-AI/aider/blob/main/aider/prompts.py#L5)
|
||||
with the `--commit-prompt` option.
|
||||
You can place that on the command line, or
|
||||
[configure it via a config file or environment variables](https://aider.chat/docs/config.html).
|
||||
|
||||
|
||||
## Commit attribution
|
||||
|
||||
Aider marks commits that it either authored or committed.
|
||||
|
|
|
@ -31,7 +31,7 @@ To work with Anthropic's models like Claude 3.5 Sonnet you need a paid
|
|||
|
||||
```
|
||||
# Install aider
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U --upgrade-strategy only-if-needed aider-chat
|
||||
|
||||
# To work with GPT-4o:
|
||||
$ aider --4o --openai-api-key sk-xxx...
|
||||
|
@ -44,7 +44,7 @@ $ aider --sonnet --anthropic-api-key sk-xxx...
|
|||
|
||||
```
|
||||
# Install aider
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U --upgrade-strategy only-if-needed aider-chat
|
||||
|
||||
# To work with GPT-4o:
|
||||
$ aider --4o --openai-api-key sk-xxx...
|
||||
|
|
|
@ -74,15 +74,11 @@ joshuavial also confirmed that aider works inside a VS Code terminal window.
|
|||
Aider detects if it is running inside VSCode and turns off pretty/color output,
|
||||
since the VSCode terminal doesn't seem to support it well.
|
||||
|
||||
[MattFlower](https://github.com/MattFlower) provided a VSCode plugin for aider:
|
||||
|
||||
[https://marketplace.visualstudio.com/items?itemName=MattFlower.aider](https://marketplace.visualstudio.com/items?itemName=MattFlower.aider)
|
||||
|
||||
### Other editors
|
||||
|
||||
If you are interested in creating an aider plugin for your favorite editor,
|
||||
please let me know by opening a
|
||||
[GitHub issue](https://github.com/paul-gauthier/aider/issues).
|
||||
[GitHub issue](https://github.com/Aider-AI/aider/issues).
|
||||
|
||||
|
||||
## Install the development version of aider
|
||||
|
@ -91,7 +87,7 @@ If you want the very latest development version of aider
|
|||
you can install directly from GitHub:
|
||||
|
||||
```
|
||||
python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git
|
||||
python -m pip install --upgrade git+https://github.com/Aider-AI/aider.git
|
||||
```
|
||||
|
||||
If you've git cloned the aider repository already, you can install "live" from your local copy. This is mostly useful if you are developing aider and want your current modifications to take effect immediately.
|
||||
|
|
|
@ -25,3 +25,9 @@ Install [pipx](https://pipx.pypa.io/stable/) then just do:
|
|||
```
|
||||
pipx install aider-chat
|
||||
```
|
||||
|
||||
|
||||
## pipx on replit
|
||||
|
||||
{% include replit-pipx.md %}
|
||||
|
||||
|
|
|
@ -21,6 +21,33 @@ Aider can currently produce repository maps for many popular
|
|||
mainstream languages, listed below.
|
||||
|
||||
|
||||
## How to add support for another language
|
||||
|
||||
Aider should work quite well for other languages, even those
|
||||
without repo map or linter support.
|
||||
You should really try coding with aider before
|
||||
assuming it needs better support for your language.
|
||||
|
||||
That said, if aider already has support for linting your language,
|
||||
then it should be possible to add repo map support.
|
||||
To build a repo map, aider needs the `tags.scm` file
|
||||
from the given language's tree-sitter grammar.
|
||||
If you can find and share that file in a
|
||||
[GitHub issue](https://github.com/Aider-AI/aider/issues),
|
||||
then it may be possible to add repo map support.
|
||||
|
||||
If aider doesn't support linting, it will be complicated to
|
||||
add linting and repo map support.
|
||||
That is because aider relies on
|
||||
[py-tree-sitter-languages](https://github.com/grantjenks/py-tree-sitter-languages)
|
||||
to provide pre-packaged versions of tree-sitter
|
||||
parsers for many languages.
|
||||
|
||||
Aider needs to be easy for users to install in many environments,
|
||||
and it is probably too complex to add dependencies on
|
||||
additional individual tree-sitter parsers.
|
||||
|
||||
|
||||
<!--[[[cog
|
||||
from aider.repomap import get_supported_languages_md
|
||||
cog.out(get_supported_languages_md())
|
||||
|
@ -81,29 +108,3 @@ cog.out(get_supported_languages_md())
|
|||
<!--[[[end]]]-->
|
||||
|
||||
|
||||
|
||||
## How to add support for another language
|
||||
|
||||
Aider should work quite well for other languages, even those
|
||||
without repo map or linter support.
|
||||
You should really try coding with aider before
|
||||
assuming it needs better support for your language.
|
||||
|
||||
That said, if aider already has support for linting your language,
|
||||
then it should be possible to add repo map support.
|
||||
To build a repo map, aider needs the `tags.scm` file
|
||||
from the given language's tree-sitter grammar.
|
||||
If you can find and share that file in a
|
||||
[GitHub issue](https://github.com/paul-gauthier/aider/issues),
|
||||
then it may be possible to add repo map support.
|
||||
|
||||
If aider doesn't support linting, it will be complicated to
|
||||
add linting and repo map support.
|
||||
That is because aider relies on
|
||||
[py-tree-sitter-languages](https://github.com/grantjenks/py-tree-sitter-languages)
|
||||
to provide pre-packaged versions of tree-sitter
|
||||
parsers for many languages.
|
||||
|
||||
Aider needs to be easy for users to install in many environments,
|
||||
and it is probably too complex to add dependencies on
|
||||
additional individual tree-sitter parsers.
|
||||
|
|
|
@ -150,7 +150,7 @@ The model also has to successfully apply all its changes to the source file with
|
|||
|
||||
## Code refactoring leaderboard
|
||||
|
||||
[Aider's refactoring benchmark](https://github.com/paul-gauthier/refactor-benchmark) asks the LLM to refactor 89 large methods from large python classes. This is a more challenging benchmark, which tests the model's ability to output long chunks of code without skipping sections or making mistakes. It was developed to provoke and measure [GPT-4 Turbo's "lazy coding" habit](/2023/12/21/unified-diffs.html).
|
||||
[Aider's refactoring benchmark](https://github.com/Aider-AI/refactor-benchmark) asks the LLM to refactor 89 large methods from large python classes. This is a more challenging benchmark, which tests the model's ability to output long chunks of code without skipping sections or making mistakes. It was developed to provoke and measure [GPT-4 Turbo's "lazy coding" habit](/2023/12/21/unified-diffs.html).
|
||||
|
||||
The refactoring benchmark requires a large context window to
|
||||
work with large source files.
|
||||
|
@ -291,10 +291,10 @@ since it is the easiest format for an LLM to use.
|
|||
|
||||
Contributions of benchmark results are welcome!
|
||||
See the
|
||||
[benchmark README](https://github.com/paul-gauthier/aider/blob/main/benchmark/README.md)
|
||||
[benchmark README](https://github.com/Aider-AI/aider/blob/main/benchmark/README.md)
|
||||
for information on running aider's code editing benchmarks.
|
||||
Submit results by opening a PR with edits to the
|
||||
[benchmark results data files](https://github.com/paul-gauthier/aider/blob/main/website/_data/).
|
||||
[benchmark results data files](https://github.com/Aider-AI/aider/blob/main/aider/website/_data/).
|
||||
|
||||
|
||||
<p class="post-date">
|
||||
|
@ -321,6 +321,6 @@ mod_dates = [get_last_modified_date(file) for file in files]
|
|||
latest_mod_date = max(mod_dates)
|
||||
cog.out(f"{latest_mod_date.strftime('%B %d, %Y.')}")
|
||||
]]]-->
|
||||
August 14, 2024.
|
||||
October 22, 2024.
|
||||
<!--[[[end]]]-->
|
||||
</p>
|
||||
|
|
111
aider/website/docs/legal/contributor-agreement.md
Normal file
111
aider/website/docs/legal/contributor-agreement.md
Normal file
|
@ -0,0 +1,111 @@
|
|||
|
||||
Individual Contributor License Agreement
|
||||
|
||||
Thank you for your interest in Aider AI LLC ("Aider AI").
|
||||
To clarify the intellectual property license
|
||||
granted with Contributions from any person or entity, Aider AI
|
||||
must have on file a signed Contributor License Agreement ("CLA")
|
||||
from each Contributor, indicating agreement with the license
|
||||
terms below. This agreement is for your protection as a Contributor
|
||||
as well as the protection of Aider AI and its users. It does not
|
||||
change your rights to use your own Contributions for any other purpose.
|
||||
|
||||
Please complete and sign this Agreement. Read this document carefully
|
||||
before signing and keep a copy for your records.
|
||||
|
||||
You accept and agree to the following terms and conditions for Your
|
||||
Contributions (present and future) that you submit to Aider AI.
|
||||
Except for the license granted herein to Aider AI and recipients
|
||||
of software distributed by Aider AI, You reserve all right, title,
|
||||
and interest in and to Your Contributions.
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"You" (or "Your") shall mean the copyright owner or legal entity
|
||||
authorized by the copyright owner that is making this Agreement
|
||||
with Aider AI. For legal entities, the entity making a
|
||||
Contribution and all other entities that control, are controlled
|
||||
by, or are under common control with that entity are considered to
|
||||
be a single Contributor. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"Contribution" shall mean any original work of authorship,
|
||||
including any modifications or additions to an existing work, that
|
||||
is intentionally submitted by You to Aider AI for inclusion
|
||||
in, or documentation of, any of the products owned or managed by
|
||||
Aider AI (the "Work"). For the purposes of this definition,
|
||||
"submitted" means any form of electronic, verbal, or written
|
||||
communication sent to Aider AI or its representatives,
|
||||
including but not limited to communication on electronic mailing
|
||||
lists, source code control systems, and issue tracking systems that
|
||||
are managed by, or on behalf of, Aider AI for the purpose of
|
||||
discussing and improving the Work, but excluding communication that
|
||||
is conspicuously marked or otherwise designated in writing by You
|
||||
as "Not a Contribution."
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this Agreement, You hereby grant to Aider AI and to
|
||||
recipients of software distributed by Aider AI a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare derivative works of,
|
||||
publicly display, publicly perform, sublicense, and distribute Your
|
||||
Contributions and such derivative works.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this Agreement, You hereby grant to Aider AI and to
|
||||
recipients of software distributed by Aider AI a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have
|
||||
made, use, offer to sell, sell, import, and otherwise transfer the
|
||||
Work, where such license applies only to those patent claims
|
||||
licensable by You that are necessarily infringed by Your
|
||||
Contribution(s) alone or by combination of Your Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If any
|
||||
entity institutes patent litigation against You or any other entity
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging
|
||||
that your Contribution, or the Work to which you have contributed,
|
||||
constitutes direct or contributory patent infringement, then any
|
||||
patent licenses granted to that entity under this Agreement for
|
||||
that Contribution or Work shall terminate as of the date such
|
||||
litigation is filed.
|
||||
|
||||
4. You represent that you are legally entitled to grant the above
|
||||
license. If your employer(s) has rights to intellectual property
|
||||
that you create that includes your Contributions, you represent
|
||||
that you have received permission to make Contributions on behalf
|
||||
of that employer, that your employer has waived such rights for
|
||||
your Contributions to Aider AI, or that your employer has
|
||||
executed a separate Corporate CLA with Aider AI.
|
||||
|
||||
5. You represent that each of Your Contributions is Your original
|
||||
creation (see section 7 for submissions on behalf of others). You
|
||||
represent that Your Contribution submissions include complete
|
||||
details of any third-party license or other restriction (including,
|
||||
but not limited to, related patents and trademarks) of which you
|
||||
are personally aware and which are associated with any part of Your
|
||||
Contributions.
|
||||
|
||||
6. You are not expected to provide support for Your Contributions,
|
||||
except to the extent You desire to provide support. You may provide
|
||||
support for free, for a fee, or not at all. Unless required by
|
||||
applicable law or agreed to in writing, You provide Your
|
||||
Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
|
||||
OF ANY KIND, either express or implied, including, without
|
||||
limitation, any warranties or conditions of TITLE, NON-
|
||||
INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
7. Should You wish to submit work that is not Your original creation,
|
||||
You may submit it to Aider AI separately from any
|
||||
Contribution, identifying the complete details of its source and of
|
||||
any license or other restriction (including, but not limited to,
|
||||
related patents, trademarks, and license agreements) of which you
|
||||
are personally aware, and conspicuously marking the work as
|
||||
"Submitted on behalf of a third-party: [named here]".
|
||||
|
||||
8. You agree to notify Aider AI of any facts or circumstances of
|
||||
which you become aware that would make these representations
|
||||
inaccurate in any respect.
|
||||
|
|
@ -14,7 +14,7 @@ Aider has some built in shortcuts for the most popular Anthropic models and
|
|||
has been tested and benchmarked to work well with them:
|
||||
|
||||
```
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U aider-chat
|
||||
|
||||
export ANTHROPIC_API_KEY=<key> # Mac/Linux
|
||||
setx ANTHROPIC_API_KEY <key> # Windows, restart shell after setx
|
||||
|
@ -26,7 +26,7 @@ aider
|
|||
aider --opus
|
||||
|
||||
# List models available from Anthropic
|
||||
aider --models anthropic/
|
||||
aider --list-models anthropic/
|
||||
```
|
||||
|
||||
{: .tip }
|
||||
|
|
|
@ -8,7 +8,7 @@ nav_order: 500
|
|||
Aider can connect to the OpenAI models on Azure.
|
||||
|
||||
```
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U aider-chat
|
||||
|
||||
# Mac/Linux:
|
||||
export AZURE_API_KEY=<key>
|
||||
|
@ -24,7 +24,7 @@ setx AZURE_API_BASE https://myendpt.openai.azure.com
|
|||
aider --model azure/<your_deployment_name>
|
||||
|
||||
# List models available from Azure
|
||||
aider --models azure/
|
||||
aider --list-models azure/
|
||||
```
|
||||
|
||||
Note that aider will also use environment variables
|
||||
|
|
75
aider/website/docs/llms/bedrock.md
Normal file
75
aider/website/docs/llms/bedrock.md
Normal file
|
@ -0,0 +1,75 @@
|
|||
---
|
||||
parent: Connecting to LLMs
|
||||
nav_order: 560
|
||||
---
|
||||
|
||||
# Amazon Bedrock
|
||||
|
||||
Aider can connect to models provided by Amazon Bedrock.
|
||||
You will need to have an AWS account with access to the Bedrock service.
|
||||
|
||||
To configure Aider to use the Amazon Bedrock API, you need to set up your AWS credentials.
|
||||
This can be done using the AWS CLI or by setting environment variables.
|
||||
|
||||
## AWS CLI Configuration
|
||||
|
||||
If you haven't already, install the [AWS CLI](https://aws.amazon.com/cli/) and configure it with your credentials:
|
||||
|
||||
```bash
|
||||
aws configure
|
||||
```
|
||||
|
||||
This will prompt you to enter your AWS Access Key ID, Secret Access Key, and default region.
|
||||
|
||||
## Environment Variables
|
||||
|
||||
Alternatively, you can set the following environment variables:
|
||||
|
||||
```bash
|
||||
export AWS_REGION=your_preferred_region
|
||||
|
||||
# For user authentication
|
||||
export AWS_ACCESS_KEY_ID=your_access_key
|
||||
export AWS_SECRET_ACCESS_KEY=your_secret_key
|
||||
|
||||
# For profile authentication
|
||||
export AWS_PROFILE=your-profile
|
||||
```
|
||||
|
||||
You can add these to your
|
||||
[.env file](/docs/config/dotenv.html).
|
||||
|
||||
## Bedrock with `pipx` installation
|
||||
|
||||
The AWS Bedrock provider requires the `boto3` package in order to function correctly. To use aider installed via `pipx` with AWS Bedrock, you must add the `boto3` dependency to aider's virtual environment by running
|
||||
|
||||
```
|
||||
pipx inject aider boto3
|
||||
```
|
||||
|
||||
|
||||
## Running Aider with Bedrock
|
||||
|
||||
Once your AWS credentials are set up, you can run Aider with the `--model` command line switch, specifying the Bedrock model you want to use:
|
||||
|
||||
```bash
|
||||
aider --model bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0
|
||||
```
|
||||
|
||||
|
||||
## Available Models
|
||||
|
||||
To see some models available via Bedrock, run:
|
||||
|
||||
```
|
||||
aider --list-models bedrock/
|
||||
```
|
||||
|
||||
Make sure you have access to these models in your AWS account before attempting to use them with Aider.
|
||||
|
||||
# More info
|
||||
|
||||
For more information on Amazon Bedrock and its models, refer to the [official AWS documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html).
|
||||
|
||||
Also, see the
|
||||
[litellm docs on Bedrock](https://litellm.vercel.app/docs/providers/bedrock).
|
|
@ -13,13 +13,13 @@ You'll need a [Cohere API key](https://dashboard.cohere.com/welcome/login).
|
|||
To use **Command-R+**:
|
||||
|
||||
```
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U aider-chat
|
||||
|
||||
export COHERE_API_KEY=<key> # Mac/Linux
|
||||
setx COHERE_API_KEY <key> # Windows, restart shell after setx
|
||||
|
||||
aider --model command-r-plus
|
||||
aider --model command-r-plus-08-2024
|
||||
|
||||
# List models available from Cohere
|
||||
aider --models cohere_chat/
|
||||
aider --list-models cohere_chat/
|
||||
```
|
||||
|
|
|
@ -9,7 +9,7 @@ Aider can connect to the DeepSeek.com API.
|
|||
The DeepSeek Coder V2 model has a top score on aider's code editing benchmark.
|
||||
|
||||
```
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U aider-chat
|
||||
|
||||
export DEEPSEEK_API_KEY=<key> # Mac/Linux
|
||||
setx DEEPSEEK_API_KEY <key> # Windows, restart shell after setx
|
||||
|
|
|
@ -12,7 +12,7 @@ with code editing capability that's comparable to GPT-3.5.
|
|||
You'll need a [Gemini API key](https://aistudio.google.com/app/u/2/apikey).
|
||||
|
||||
```
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U aider-chat
|
||||
|
||||
export GEMINI_API_KEY=<key> # Mac/Linux
|
||||
setx GEMINI_API_KEY <key> # Windows, restart shell after setx
|
||||
|
@ -20,6 +20,6 @@ setx GEMINI_API_KEY <key> # Windows, restart shell after setx
|
|||
aider --model gemini/gemini-1.5-pro-latest
|
||||
|
||||
# List models available from Gemini
|
||||
aider --models gemini/
|
||||
aider --list-models gemini/
|
||||
```
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ You'll need a [Groq API key](https://console.groq.com/keys).
|
|||
To use **Llama3 70B**:
|
||||
|
||||
```
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U aider-chat
|
||||
|
||||
export GROQ_API_KEY=<key> # Mac/Linux
|
||||
setx GROQ_API_KEY <key> # Windows, restart shell after setx
|
||||
|
@ -21,7 +21,7 @@ setx GROQ_API_KEY <key> # Windows, restart shell after setx
|
|||
aider --model groq/llama3-70b-8192
|
||||
|
||||
# List models available from Groq
|
||||
aider --models groq/
|
||||
aider --list-models groq/
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ ollama pull <model>
|
|||
ollama serve
|
||||
|
||||
# In another terminal window...
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U aider-chat
|
||||
|
||||
export OLLAMA_API_BASE=http://127.0.0.1:11434 # Mac/Linux
|
||||
setx OLLAMA_API_BASE http://127.0.0.1:11434 # Windows, restart shell after setx
|
||||
|
|
|
@ -8,7 +8,7 @@ nav_order: 500
|
|||
Aider can connect to any LLM which is accessible via an OpenAI compatible API endpoint.
|
||||
|
||||
```
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U aider-chat
|
||||
|
||||
# Mac/Linux:
|
||||
export OPENAI_API_BASE=<endpoint>
|
||||
|
|
|
@ -14,7 +14,7 @@ Aider has some built in shortcuts for the most popular OpenAI models and
|
|||
has been tested and benchmarked to work well with them:
|
||||
|
||||
```
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U aider-chat
|
||||
|
||||
export OPENAI_API_KEY=<key> # Mac/Linux
|
||||
setx OPENAI_API_KEY <key> # Windows, restart shell after setx
|
||||
|
@ -22,14 +22,20 @@ setx OPENAI_API_KEY <key> # Windows, restart shell after setx
|
|||
# Aider uses gpt-4o by default (or use --4o)
|
||||
aider
|
||||
|
||||
# GPT-4 Turbo (1106)
|
||||
aider --4-turbo
|
||||
# GPT-4o
|
||||
aider --4o
|
||||
|
||||
# GPT-3.5 Turbo
|
||||
aider --35-turbo
|
||||
|
||||
# o1-mini
|
||||
aider --model o1-mini
|
||||
|
||||
# o1-preview
|
||||
aider --model o1-preview
|
||||
|
||||
# List models available from OpenAI
|
||||
aider --models openai/
|
||||
aider --list-models openai/
|
||||
```
|
||||
|
||||
You can use `aider --model <model-name>` to use any other OpenAI model.
|
||||
|
|
|
@ -9,7 +9,7 @@ Aider can connect to [models provided by OpenRouter](https://openrouter.ai/model
|
|||
You'll need an [OpenRouter API key](https://openrouter.ai/keys).
|
||||
|
||||
```
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U aider-chat
|
||||
|
||||
export OPENROUTER_API_KEY=<key> # Mac/Linux
|
||||
setx OPENROUTER_API_KEY <key> # Windows, restart shell after setx
|
||||
|
@ -18,13 +18,13 @@ setx OPENROUTER_API_KEY <key> # Windows, restart shell after setx
|
|||
aider --model openrouter/<provider>/<model>
|
||||
|
||||
# List models available from OpenRouter
|
||||
aider --models openrouter/
|
||||
aider --list-models openrouter/
|
||||
```
|
||||
|
||||
In particular, many aider users access Sonnet via OpenRouter:
|
||||
|
||||
```
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U aider-chat
|
||||
|
||||
export OPENROUTER_API_KEY=<key> # Mac/Linux
|
||||
setx OPENROUTER_API_KEY <key> # Windows, restart shell after setx
|
||||
|
|
|
@ -9,14 +9,14 @@ Aider uses the [litellm](https://docs.litellm.ai/docs/providers) package
|
|||
to connect to hundreds of other models.
|
||||
You can use `aider --model <model-name>` to use any supported model.
|
||||
|
||||
To explore the list of supported models you can run `aider --models <model-name>`
|
||||
To explore the list of supported models you can run `aider --list-models <model-name>`
|
||||
with a partial model name.
|
||||
If the supplied name is not an exact match for a known model, aider will
|
||||
return a list of possible matching models.
|
||||
For example:
|
||||
|
||||
```
|
||||
$ aider --models turbo
|
||||
$ aider --list-models turbo
|
||||
|
||||
Aider v0.29.3-dev
|
||||
Models which match "turbo":
|
||||
|
@ -63,6 +63,7 @@ cog.out(''.join(lines))
|
|||
- AZURE_API_KEY
|
||||
- AZURE_OPENAI_API_KEY
|
||||
- BASETEN_API_KEY
|
||||
- CEREBRAS_API_KEY
|
||||
- CLARIFAI_API_KEY
|
||||
- CLOUDFLARE_API_KEY
|
||||
- CODESTRAL_API_KEY
|
||||
|
@ -71,22 +72,19 @@ cog.out(''.join(lines))
|
|||
- DATABRICKS_API_KEY
|
||||
- DEEPINFRA_API_KEY
|
||||
- DEEPSEEK_API_KEY
|
||||
- EMPOWER_API_KEY
|
||||
- FIREWORKSAI_API_KEY
|
||||
- FIREWORKS_AI_API_KEY
|
||||
- FIREWORKS_API_KEY
|
||||
- FRIENDLIAI_API_KEY
|
||||
- GEMINI_API_KEY
|
||||
- GITHUB_API_KEY
|
||||
- GROQ_API_KEY
|
||||
- HUGGINGFACE_API_KEY
|
||||
- MARITALK_API_KEY
|
||||
- MISTRAL_API_KEY
|
||||
- MISTRAL_AZURE_API_KEY
|
||||
- NLP_CLOUD_API_KEY
|
||||
- NVIDIA_NIM_API_KEY
|
||||
- OLLAMA_API_KEY
|
||||
- OPENAI_API_KEY
|
||||
- OPENAI_LIKE_API_KEY
|
||||
- OPENROUTER_API_KEY
|
||||
- OR_API_KEY
|
||||
- PALM_API_KEY
|
||||
|
@ -95,8 +93,6 @@ cog.out(''.join(lines))
|
|||
- PROVIDER_API_KEY
|
||||
- REPLICATE_API_KEY
|
||||
- TOGETHERAI_API_KEY
|
||||
- TOGETHER_AI_API_KEY
|
||||
- TOGETHER_API_KEY
|
||||
- VOLCENGINE_API_KEY
|
||||
- VOYAGE_API_KEY
|
||||
- XINFERENCE_API_KEY
|
||||
|
|
106
aider/website/docs/more/edit-formats.md
Normal file
106
aider/website/docs/more/edit-formats.md
Normal file
|
@ -0,0 +1,106 @@
|
|||
---
|
||||
parent: More info
|
||||
nav_order: 960
|
||||
description: Aider uses various "edit formats" to let LLMs edit source files.
|
||||
---
|
||||
|
||||
# Edit formats
|
||||
|
||||
Aider uses various "edit formats" to let LLMs edit source files.
|
||||
Different models work better or worse with different edit formats.
|
||||
Aider is configured to use the optimal format for most popular, common models.
|
||||
You can always force use of a specific edit format with
|
||||
the `--edit-format` switch.
|
||||
|
||||
## whole
|
||||
|
||||
The "whole" edit format is the simplest possible editing format.
|
||||
The LLM is instructed to return a full, updated
|
||||
copy of each source file that needs changes.
|
||||
While simple, it can be slow and costly because the LLM has to return
|
||||
the *entire file* even if just a few lines are edited.
|
||||
|
||||
The format expects the file path just before the fenced file content:
|
||||
|
||||
````
|
||||
show_greeting.py
|
||||
```
|
||||
import sys
|
||||
|
||||
def greeting(name):
|
||||
print(f"Hey {{name}}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
greeting(sys.argv[1])
|
||||
```
|
||||
````
|
||||
|
||||
|
||||
## diff
|
||||
|
||||
The "diff" edit format asks the LLM to specify file edits as a series of search/replace blocks.
|
||||
This is an efficient format, because the model only needs to return parts of the file
|
||||
which have changes.
|
||||
|
||||
They are formatted using a syntax similar to the git merge conflict resolution markings,
|
||||
with the file path right before a fenced block:
|
||||
|
||||
````
|
||||
mathweb/flask/app.py
|
||||
```
|
||||
<<<<<<< SEARCH
|
||||
from flask import Flask
|
||||
=======
|
||||
import math
|
||||
from flask import Flask
|
||||
>>>>>>> REPLACE
|
||||
```
|
||||
````
|
||||
|
||||
## diff-fenced
|
||||
|
||||
The "diff-fenced" edit format is based on the diff format, but
|
||||
the file path is placed inside the fence.
|
||||
It is primarily used with the Gemini family of models,
|
||||
which often fail to conform to fencing approach specified in the diff format.
|
||||
|
||||
````
|
||||
```
|
||||
mathweb/flask/app.py
|
||||
<<<<<<< SEARCH
|
||||
from flask import Flask
|
||||
=======
|
||||
import math
|
||||
from flask import Flask
|
||||
>>>>>>> REPLACE
|
||||
```
|
||||
````
|
||||
|
||||
## udiff
|
||||
|
||||
The "udiff" edit format is based on the widely used unified diff format,
|
||||
but [modified and simplified](/2023/12/21/unified-diffs.html).
|
||||
This is an efficient format, because the model only needs to return parts of the file
|
||||
which have changes.
|
||||
|
||||
It was mainly used to the GPT-4 Turbo family of models,
|
||||
to reduce their "lazy coding" tendencies with other edit formats.
|
||||
|
||||
|
||||
````
|
||||
```diff
|
||||
--- mathweb/flask/app.py
|
||||
+++ mathweb/flask/app.py
|
||||
@@ ... @@
|
||||
-class MathWeb:
|
||||
+import sympy
|
||||
+
|
||||
+class MathWeb:
|
||||
```
|
||||
````
|
||||
|
||||
## editor-diff and editor-whole
|
||||
|
||||
These are streamlined versions of the diff and whole formats, intended to be used
|
||||
with `--editor-edit-format` when using
|
||||
[architect mode](/docs/usage/modes.html).
|
98
aider/website/docs/more/infinite-output.md
Normal file
98
aider/website/docs/more/infinite-output.md
Normal file
|
@ -0,0 +1,98 @@
|
|||
---
|
||||
parent: More info
|
||||
nav_order: 920
|
||||
description: Aider can handle "infinite output" from models that support prefill.
|
||||
---
|
||||
|
||||
# Infinite output
|
||||
|
||||
LLM providers limit how much output a model can generate from a single request.
|
||||
This is usually called the output token limit.
|
||||
|
||||
Aider is able to work around this limit with models that support
|
||||
"prefilling" the assistant response.
|
||||
When you use aider with a model that supports prefill, you will see
|
||||
"infinite output" noted in the announcement lines displayed at launch:
|
||||
|
||||
```
|
||||
Aider v0.58.0
|
||||
Main model: claude-3-5-sonnet-20240620 with diff edit format, prompt cache, infinite output
|
||||
```
|
||||
|
||||
Models that support prefill can be primed to think they started their response
|
||||
with a specific piece of text.
|
||||
You can put words in their mouth, and they will continue generating
|
||||
text from that point forward.
|
||||
|
||||
When aider is collecting code edits from a model and
|
||||
it hits the output token limit,
|
||||
aider simply initiates another LLM request with the partial
|
||||
response prefilled.
|
||||
This prompts the model to continue where it left off,
|
||||
generating more of the desired response.
|
||||
This prefilling of the partially completed response can be repeated,
|
||||
allowing for very long outputs.
|
||||
Joining the text across these output limit boundaries
|
||||
requires some heuristics, but is typically fairly reliable.
|
||||
|
||||
Aider supports "infinite output" for models that support "prefill",
|
||||
such as:
|
||||
|
||||
<!--[[[cog
|
||||
import requests
|
||||
import json
|
||||
|
||||
# Fetch the JSON data
|
||||
url = "https://raw.githubusercontent.com/BerriAI/litellm/refs/heads/main/model_prices_and_context_window.json"
|
||||
response = requests.get(url)
|
||||
data = json.loads(response.text)
|
||||
|
||||
# Process the JSON to find models with supports_assistant_prefill=true
|
||||
prefill_models = [model for model, info in data.items() if info.get('supports_assistant_prefill') == True]
|
||||
|
||||
# Generate the list of models
|
||||
model_list = "\n".join(f"- {model}" for model in sorted(prefill_models))
|
||||
|
||||
cog.out(model_list)
|
||||
]]]-->
|
||||
- anthropic.claude-3-5-sonnet-20241022-v2:0
|
||||
- anthropic/claude-3-5-sonnet-20241022
|
||||
- claude-3-5-sonnet-20240620
|
||||
- claude-3-5-sonnet-20241022
|
||||
- claude-3-haiku-20240307
|
||||
- claude-3-opus-20240229
|
||||
- claude-3-sonnet-20240229
|
||||
- codestral/codestral-2405
|
||||
- codestral/codestral-latest
|
||||
- deepseek-chat
|
||||
- deepseek-coder
|
||||
- eu.anthropic.claude-3-5-sonnet-20241022-v2:0
|
||||
- mistral/codestral-2405
|
||||
- mistral/codestral-latest
|
||||
- mistral/codestral-mamba-latest
|
||||
- mistral/mistral-large-2402
|
||||
- mistral/mistral-large-2407
|
||||
- mistral/mistral-large-latest
|
||||
- mistral/mistral-medium
|
||||
- mistral/mistral-medium-2312
|
||||
- mistral/mistral-medium-latest
|
||||
- mistral/mistral-small
|
||||
- mistral/mistral-small-latest
|
||||
- mistral/mistral-tiny
|
||||
- mistral/open-codestral-mamba
|
||||
- mistral/open-mistral-7b
|
||||
- mistral/open-mistral-nemo
|
||||
- mistral/open-mistral-nemo-2407
|
||||
- mistral/open-mixtral-8x22b
|
||||
- mistral/open-mixtral-8x7b
|
||||
- mistral/pixtral-12b-2409
|
||||
- openrouter/anthropic/claude-3.5-sonnet
|
||||
- us.anthropic.claude-3-5-sonnet-20241022-v2:0
|
||||
- vertex_ai/claude-3-5-sonnet-v2@20241022
|
||||
- vertex_ai/claude-3-5-sonnet@20240620
|
||||
- vertex_ai/claude-3-haiku@20240307
|
||||
- vertex_ai/claude-3-opus@20240229
|
||||
- vertex_ai/claude-3-sonnet@20240229
|
||||
<!--[[[end]]]-->
|
||||
|
||||
|
|
@ -29,9 +29,9 @@ It shows how each of these symbols are defined, by including the critical lines
|
|||
|
||||
Here's a part of
|
||||
the repo map of aider's repo, for
|
||||
[base_coder.py](https://github.com/paul-gauthier/aider/blob/main/aider/coders/base_coder.py)
|
||||
[base_coder.py](https://github.com/Aider-AI/aider/blob/main/aider/coders/base_coder.py)
|
||||
and
|
||||
[commands.py](https://github.com/paul-gauthier/aider/blob/main/aider/commands.py)
|
||||
[commands.py](https://github.com/Aider-AI/aider/blob/main/aider/commands.py)
|
||||
:
|
||||
|
||||
```
|
||||
|
|
|
@ -26,7 +26,9 @@ for FILE in *.py ; do
|
|||
done
|
||||
```
|
||||
|
||||
User `aider --help` to see all the command line options, but these are useful for scripting:
|
||||
Use `aider --help` to see all the
|
||||
[command line options](/docs/config/options.html),
|
||||
but these are useful for scripting:
|
||||
|
||||
```
|
||||
--stream, --no-stream
|
||||
|
@ -81,7 +83,7 @@ coder.run("/tokens")
|
|||
```
|
||||
|
||||
See the
|
||||
[Coder.create() and Coder.__init__() methods](https://github.com/paul-gauthier/aider/blob/main/aider/coders/base_coder.py)
|
||||
[Coder.create() and Coder.__init__() methods](https://github.com/Aider-AI/aider/blob/main/aider/coders/base_coder.py)
|
||||
for all the supported arguments.
|
||||
|
||||
It can also be helpful to set the equivalent of `--yes` by doing this:
|
||||
|
|
|
@ -17,7 +17,7 @@ You may see an error message like this:
|
|||
Below is the most fail safe way to install and run aider in these situations:
|
||||
|
||||
```
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U aider-chat
|
||||
python -m aider
|
||||
```
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ This usually happens because the LLM is disobeying the system prompts
|
|||
and trying to make edits in a format that aider doesn't expect.
|
||||
Aider makes every effort to get the LLM
|
||||
to conform, and works hard to deal with
|
||||
LLMM edits that are "almost" correctly formatted.
|
||||
LLM edits that are "almost" correctly formatted.
|
||||
|
||||
But sometimes the LLM just won't cooperate.
|
||||
In these cases, here are some things you might try.
|
||||
|
@ -30,16 +30,30 @@ disobeying the system prompt instructions.
|
|||
Most local models are just barely capable of working with aider,
|
||||
so editing errors are probably unavoidable.
|
||||
|
||||
Local models which have been quantized are even more likely to have problems
|
||||
because they are not capable enough to follow aider's system prompts.
|
||||
|
||||
## Try the whole format
|
||||
|
||||
Run aider with `--edit-format whole` if the model is using a different edit format.
|
||||
You can see which edit format it is using in the announce lines:
|
||||
|
||||
```
|
||||
Aider v0.50.2-dev
|
||||
Models: claude-3-5-sonnet-20240620 with ♾️ diff edit format
|
||||
```
|
||||
|
||||
## Reduce distractions
|
||||
|
||||
Many LLM now have very large context windows,
|
||||
Many LLMs now have very large context windows,
|
||||
but filling them with irrelevant code or conversation
|
||||
can cofuse the model.
|
||||
can confuse the model.
|
||||
|
||||
- Don't add too many files to the chat, *just* add the files you think need to be edited.
|
||||
Aider also sends the LLM a [map of your entire git repo](https://aider.chat/docs/repomap.html), so other relevant code will be included automatically.
|
||||
- Use `/drop` to remove files from the chat session which aren't needed for the task at hand. This will reduce distractions and may help GPT produce properly formatted edits.
|
||||
- Use `/clear` to remove the conversation history, again to help GPT focus.
|
||||
- Use `/drop` to remove files from the chat session which aren't needed for the task at hand. This will reduce distractions and may help the LLM produce properly formatted edits.
|
||||
- Use `/clear` to remove the conversation history, again to help the LLM focus.
|
||||
- Use `/tokens` to see how many tokens you are using for each message.
|
||||
|
||||
## More help
|
||||
|
||||
|
|
72
aider/website/docs/troubleshooting/imports.md
Normal file
72
aider/website/docs/troubleshooting/imports.md
Normal file
|
@ -0,0 +1,72 @@
|
|||
---
|
||||
parent: Troubleshooting
|
||||
nav_order: 28
|
||||
---
|
||||
|
||||
# Dependency versions
|
||||
|
||||
Aider expects to be installed via `pip` or `pipx`, which will install
|
||||
correct versions of all of its required dependencies.
|
||||
|
||||
If you've been linked to this doc from a GitHub issue,
|
||||
or if aider is reporting `ImportErrors`
|
||||
it is likely that your
|
||||
aider install is using incorrect dependencies.
|
||||
|
||||
## Install with pipx
|
||||
|
||||
If you are having dependency problems you should consider
|
||||
[installing aider using pipx](/docs/install/pipx.html).
|
||||
This will ensure that aider is installed in its own python environment,
|
||||
with the correct set of dependencies.
|
||||
|
||||
Try re-installing cleanly:
|
||||
|
||||
```
|
||||
pipx uninstall aider-chat
|
||||
pipx install aider-chat
|
||||
```
|
||||
|
||||
## Package managers like Homebrew, AUR, ports
|
||||
|
||||
Package managers often install aider with the wrong dependencies, leading
|
||||
to import errors and other problems.
|
||||
|
||||
The recommended way to
|
||||
install aider is with
|
||||
[pip](/docs/install/install.html).
|
||||
Be sure to use the `--upgrade-strategy only-if-needed` switch so that the correct
|
||||
versions of dependencies will be installed.
|
||||
|
||||
```
|
||||
python -m pip install -U --upgrade-strategy only-if-needed aider-chat
|
||||
```
|
||||
|
||||
A very safe way is to
|
||||
[install aider using pipx](/docs/install/pipx.html),
|
||||
which will ensure it is installed in a stand alone virtual environment.
|
||||
|
||||
## Dependency versions matter
|
||||
|
||||
Aider pins its dependencies and is tested to work with those specific versions.
|
||||
If you are installing aider with pip (rather than pipx),
|
||||
you should be careful about upgrading or downgrading the python packages that
|
||||
aider uses.
|
||||
|
||||
In particular, be careful with the packages with pinned versions
|
||||
noted at the end of
|
||||
[aider's requirements.in file](https://github.com/Aider-AI/aider/blob/main/requirements/requirements.in).
|
||||
These versions are pinned because aider is known not to work with the
|
||||
latest versions of these libraries.
|
||||
|
||||
Also be wary of upgrading `litellm`, as it changes versions frequently
|
||||
and sometimes introduces bugs or backwards incompatible changes.
|
||||
|
||||
## Replit
|
||||
|
||||
You can `pip install -U aider-chat` on replit.
|
||||
|
||||
Or you can install aider with
|
||||
pipx as follows:
|
||||
|
||||
{% include replit-pipx.md %}
|
|
@ -68,7 +68,7 @@ To avoid hitting output token limits:
|
|||
- Ask for smaller changes in each request.
|
||||
- Break your code into smaller source files.
|
||||
- Use a strong model like gpt-4o, sonnet or opus that can return diffs.
|
||||
|
||||
- Use a model that supports [infinite output](/docs/more/infinite-output.html).
|
||||
|
||||
## Other causes
|
||||
|
||||
|
|
|
@ -317,7 +317,7 @@ the ones with the most code and which involve refactoring.
|
|||
Based on this observation, I set out to build a benchmark based on refactoring
|
||||
a non-trivial amount of code found in fairly large files.
|
||||
To do this, I used python's `ast` module to analyze
|
||||
[9 popular open source python repositories](https://github.com/paul-gauthier/refactor-benchmark)
|
||||
[9 popular open source python repositories](https://github.com/Aider-AI/refactor-benchmark)
|
||||
to identify challenging refactoring tasks.
|
||||
The goal was to find:
|
||||
|
||||
|
@ -332,7 +332,7 @@ where we ask GPT to do something like:
|
|||
> Name the new function `_set_csrf_cookie`, exactly the same name as the existing method.
|
||||
> Update any existing `self._set_csrf_cookie` calls to work with the new `_set_csrf_cookie` function.
|
||||
|
||||
A [simple python AST scanning script](https://github.com/paul-gauthier/aider/blob/main/benchmark/refactor_tools.py)
|
||||
A [simple python AST scanning script](https://github.com/Aider-AI/aider/blob/main/benchmark/refactor_tools.py)
|
||||
found 89 suitable files
|
||||
and packaged them up as benchmark tasks.
|
||||
Each task has a test
|
||||
|
@ -351,7 +351,7 @@ gathered during benchmarking like the
|
|||
introduction of new comments that contain "...".
|
||||
|
||||
The result is a pragmatic
|
||||
[benchmark suite that provokes, detects and quantifies GPT coding laziness](https://github.com/paul-gauthier/refactor-benchmark).
|
||||
[benchmark suite that provokes, detects and quantifies GPT coding laziness](https://github.com/Aider-AI/refactor-benchmark).
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ It also supports [connecting to almost any LLM](https://aider.chat/docs/llms.htm
|
|||
Use the `--browser` switch to launch the browser version of aider:
|
||||
|
||||
```
|
||||
python -m pip install aider-chat
|
||||
python -m pip install -U aider-chat
|
||||
|
||||
export OPENAI_API_KEY=<key> # Mac/Linux
|
||||
setx OPENAI_API_KEY <key> # Windows, restart shell after setx
|
||||
|
|
51
aider/website/docs/usage/caching.md
Normal file
51
aider/website/docs/usage/caching.md
Normal file
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
title: Prompt caching
|
||||
highlight_image: /assets/prompt-caching.jpg
|
||||
parent: Usage
|
||||
nav_order: 750
|
||||
description: Aider supports prompt caching for cost savings and faster coding.
|
||||
|
||||
---
|
||||
|
||||
# Prompt caching
|
||||
|
||||
Aider supports prompt caching for cost savings and faster coding.
|
||||
Currently Anthropic provides caching for Sonnet and Haiku,
|
||||
and DeepSeek provides caching for Coder.
|
||||
|
||||
Aider organizes the chat history to try and cache:
|
||||
|
||||
- The system prompt.
|
||||
- Read only files added with `--read` or `/read-only`.
|
||||
- The repository map.
|
||||
- The editable files that have been added to the chat.
|
||||
|
||||

|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Run aider with `--cache-prompts` or add that setting to your
|
||||
[configuration files](/docs/config.html).
|
||||
|
||||
Due to limitations in the provider APIs, caching statistics and costs
|
||||
are not available when streaming responses.
|
||||
To turn off streaming, use `--no-stream`.
|
||||
|
||||
When caching is enabled, it will be noted for the main model when aider launches:
|
||||
|
||||
```
|
||||
Main model: claude-3-5-sonnet-20240620 with diff edit format, prompt cache, infinite output
|
||||
```
|
||||
|
||||
## Preventing cache expiration
|
||||
|
||||
Aider can ping the provider to keep your prompt cache warm and prevent
|
||||
it from expiring.
|
||||
By default, Anthropic keeps your cache for 5 minutes.
|
||||
Use `--cache-keepalive-pings N` to tell aider to ping
|
||||
every 5 minutes to keep the cache warm.
|
||||
Aider will ping up to `N` times over a period of `N*5` minutes
|
||||
after each message you send.
|
||||
|
||||
|
|
@ -14,31 +14,39 @@ cog.out(get_help_md())
|
|||
|
||||
|Command|Description|
|
||||
|:------|:----------|
|
||||
| **/add** | Add files to the chat so GPT can edit them or review them in detail |
|
||||
| **/add** | Add files to the chat so aider can edit them or review them in detail |
|
||||
| **/architect** | Enter architect mode to discuss high-level design and architecture |
|
||||
| **/ask** | Ask questions about the code base without editing any files |
|
||||
| **/chat-mode** | Switch to a new chat mode |
|
||||
| **/clear** | Clear the chat history |
|
||||
| **/clipboard** | Add image/text from the clipboard to the chat (optionally provide a name for the image) |
|
||||
| **/code** | Ask for changes to your code |
|
||||
| **/commit** | Commit edits to the repo made outside the chat (commit message optional) |
|
||||
| **/copy** | Copy the last assistant message to the clipboard |
|
||||
| **/diff** | Display the diff of changes since the last message |
|
||||
| **/drop** | Remove files from the chat session to free up context space |
|
||||
| **/exit** | Exit the application |
|
||||
| **/git** | Run a git command |
|
||||
| **/git** | Run a git command (output excluded from chat) |
|
||||
| **/help** | Ask questions about aider |
|
||||
| **/lint** | Lint and fix provided files or in-chat files if none provided |
|
||||
| **/lint** | Lint and fix in-chat files or all dirty files if none in chat |
|
||||
| **/load** | Load and execute commands from a file |
|
||||
| **/ls** | List all known files and indicate which are included in the chat session |
|
||||
| **/map** | Print out the current repository map |
|
||||
| **/map-refresh** | Force a refresh of the repository map |
|
||||
| **/model** | Switch to a new LLM |
|
||||
| **/models** | Search the list of available models |
|
||||
| **/paste** | Paste image/text from the clipboard into the chat. Optionally provide a name for the image. |
|
||||
| **/quit** | Exit the application |
|
||||
| **/read** | Add a file to the chat that is for reference, not to be edited |
|
||||
| **/read-only** | Add files to the chat that are for reference, not to be edited |
|
||||
| **/report** | Report a problem by opening a GitHub Issue |
|
||||
| **/reset** | Drop all files and clear the chat history |
|
||||
| **/run** | Run a shell command and optionally add the output to the chat (alias: !) |
|
||||
| **/save** | Save commands to a file that can reconstruct the current chat session's files |
|
||||
| **/settings** | Print out the current settings |
|
||||
| **/test** | Run a shell command and add the output to the chat on non-zero exit code |
|
||||
| **/tokens** | Report on the number of tokens used by the current chat context |
|
||||
| **/undo** | Undo the last git commit if it was done by aider |
|
||||
| **/voice** | Record and transcribe voice input |
|
||||
| **/web** | Scrape a webpage, convert to markdown and add to the chat |
|
||||
| **/web** | Scrape a webpage, convert to markdown and send in a message |
|
||||
|
||||
<!--[[[end]]]-->
|
||||
|
||||
|
|
|
@ -21,10 +21,35 @@ For example, say we want our python code to:
|
|||
|
||||
We would simply create a file like `CONVENTIONS.md` with those lines
|
||||
and then we can add it to the aider chat, along with the file(s)
|
||||
that we want to edit:
|
||||
that we want to edit.
|
||||
|
||||
It's best to load the conventions file with `/read CONVENTIONS.md`
|
||||
or `aider --read CONVENTIONS.md`.
|
||||
This way it is marked as read-only, and cached if prompt caching
|
||||
is enabled.
|
||||
|
||||
## Always load conventions
|
||||
|
||||
You can also configure aider to always load your conventions file
|
||||
in the [`.aider.conf.yml` config file](https://aider.chat/docs/config/aider_conf.html):
|
||||
|
||||
|
||||
```yaml
|
||||
# alone
|
||||
read: CONVENTIONS.md
|
||||
|
||||
# multiple files
|
||||
read: [CONVENTIONS.md, anotherfile.txt]
|
||||
```
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
See below for an example of how the conventions can affect the code
|
||||
that aider writes.
|
||||
|
||||
<div class="chat-transcript" markdown="1">
|
||||
> $ aider CONVENTIONS.md useragent.py
|
||||
> $ aider --read CONVENTIONS.md useragent.py
|
||||
>
|
||||
> Aider v0.24.2-dev
|
||||
> Added CONVENTIONS.md to the chat.
|
||||
|
@ -85,3 +110,5 @@ which is perhaps more typical in small python scripts.
|
|||
|
||||
> Applied edit to useragent.py
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ You can add images to the chat just like you would
|
|||
add any other file:
|
||||
|
||||
- Use `/add <image-filename>` from within the chat
|
||||
- Use `/clipboard` to paste an image from your clipboard into the chat.
|
||||
- Use `/paste` to paste an image from your clipboard into the chat.
|
||||
- Launch aider with image filenames on the command line: `aider <image-filename>` along with any other command line arguments you need.
|
||||
|
||||
## Web pages
|
||||
|
@ -40,4 +40,9 @@ To add URLs to the chat:
|
|||
- Use `/web <url>`
|
||||
- Just paste the URL into the chat and aider will ask if you want to add it.
|
||||
|
||||
You can also scrape web pages from the command line to see the markdown version that aider produces:
|
||||
|
||||
|
||||
```
|
||||
python -m aider.scrape https://aider.chat/docs/usage/tips.html
|
||||
```
|
||||
|
|
|
@ -31,18 +31,21 @@ You can disable this with the `--no-auto-lint` switch.
|
|||
|
||||
## Testing
|
||||
|
||||
You can configure aider to run your test suite
|
||||
after each time the AI edits your code
|
||||
using the `--test-cmd <cmd>` switch.
|
||||
|
||||
You can run tests with `/test <test-command>`.
|
||||
Aider will run the test command without any arguments.
|
||||
If there are test errors, aider expects the
|
||||
command to print them on stdout/stderr
|
||||
and return a non-zero exit code.
|
||||
This is how most test tools normally operate.
|
||||
|
||||
To have aider automatically run the test command,
|
||||
use the `--auto-test` switch.
|
||||
Aider will try and fix any errors
|
||||
if the command returns a non-zero exit code.
|
||||
|
||||
You can configure aider to run your test suite
|
||||
after each time the AI edits your code
|
||||
using the `--test-cmd <test-command>` and
|
||||
`--auto-test` switch.
|
||||
|
||||
|
||||
|
||||
## Compiled languages
|
||||
|
||||
|
|
|
@ -6,15 +6,17 @@ description: Using the chat, ask and help chat modes.
|
|||
|
||||
# Chat modes
|
||||
|
||||
Aider has 3 different chat modes:
|
||||
Aider has a few different chat modes:
|
||||
|
||||
- `code` - Aider will make changes to your code to satisfy your requests.
|
||||
- `architect` - Aider will first propose a solution, then ask if you want it to turn that proposal into edits to your files.
|
||||
- `ask` - Aider will answer questions about your code, but never edit it.
|
||||
- `help` - Aider will answer questions about using aider, configuring, troubleshooting, etc.
|
||||
|
||||
By default, aider starts in "code" mode. As you are talking, you can
|
||||
send individual messages in a specific mode using `/code`, `/ask`, and `/help` commands:
|
||||
Using `/code`, `/ask`, and `/help` applies just to that particular message.
|
||||
send individual messages in a specific mode using
|
||||
`/code`, `/architect`, `/ask`, and `/help` commands:
|
||||
Using these `/`-commands applies just to that particular message.
|
||||
Your next message will go back to the active mode (usually "code" mode by default).
|
||||
|
||||
You can switch the active mode in a sticky way
|
||||
|
@ -22,11 +24,53 @@ with the `/chat-mode <mode>` command:
|
|||
|
||||
```
|
||||
/chat-mode code
|
||||
/chat-mode architect
|
||||
/chat-mode ask
|
||||
/chat-mode help
|
||||
```
|
||||
|
||||
Or you can launch aider in one of the modes with the `--chat-mode <mode>` switch.
|
||||
There is also a special shortcut `--architect` to launch in `--chat-mode architect`.
|
||||
|
||||
## Architect mode and the editor model
|
||||
|
||||
When you are in architect mode, aider sends your request to two models:
|
||||
|
||||
1. First, it sends your request to the main active model.
|
||||
The main model is configured with `/model`, `--model` or the shortcut switches like `--sonnet`.
|
||||
After the main model replies, aider will offer to edit the files based on the response.
|
||||
|
||||
2. To edit the files, aider sends a second LLM request asking for specific code editing instructions.
|
||||
This request goes to the "editor" model.
|
||||
Aider has built in defaults to select an editor model based on your main model.
|
||||
Or, you can choose an editor model yourself with `--editor-model <model>`.
|
||||
|
||||
Architect mode produces better results than code mode, but uses two LLM requests.
|
||||
This probably makes it slower and more expensive than using code mode.
|
||||
|
||||
Architect mode is especially useful with OpenAI's o1 models, which are strong at
|
||||
reasoning but less capable at editing files.
|
||||
Pairing an o1 architect with an editor model like GPT-4o or Sonnet will
|
||||
give the best results.
|
||||
|
||||
But architect mode is also quite helpful when you use GPT-4o or Sonnet
|
||||
at both the architect and the editor.
|
||||
Allowing the model two requests to solve the problem and edit the files
|
||||
usually provides a better result.
|
||||
|
||||
The editor model uses one of aider's edit formats to let the LLM
|
||||
edit source files.
|
||||
Aider will pick a suitable edit format by default,
|
||||
but you can customize it with `--editor-edit-format <format>`.
|
||||
The
|
||||
["editor-diff" and "editor-whole" edit formats](/docs/more/edit-formats.html#editor-diff-and-editor-whole)
|
||||
are the recommended edit formats when using architect mode.
|
||||
See this article on
|
||||
[aider's architect/editor mode](/2024/09/26/architect.html)
|
||||
for more details.
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
<div class="chat-transcript" markdown="1">
|
||||
|
||||
|
@ -63,5 +107,26 @@ print(factorial(5)) # Output: 120
|
|||
|
||||
This function uses recursion to calculate the factorial. It's been added to your code.
|
||||
|
||||
#### /architect Can we make this simpler?
|
||||
|
||||
Yes, you could replace the `factorial()` function with a call to the `math.factorial()`
|
||||
builtin.
|
||||
This way you don't have to maintain a custom factorial implementation,
|
||||
and the builtin function is well optimized.
|
||||
|
||||
> Edit the files? (Y)es/(N)o [Yes]: Yes
|
||||
|
||||
```python
|
||||
<<<<<<< SEARCH
|
||||
def factorial(n):
|
||||
if n == 0 or n == 1:
|
||||
return 1
|
||||
else:
|
||||
return n * factorial(n - 1)
|
||||
=======
|
||||
from math import factorial
|
||||
>>>>>>> REPLACE
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -6,21 +6,74 @@ description: Tips for AI pair programming with aider.
|
|||
|
||||
# Tips
|
||||
|
||||
- Think about which files need to be edited to make your change and add them to the chat.
|
||||
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.
|
||||
- Don't add *everything* to the chat, just the files you think need to be edited.
|
||||
Aider also sends the LLM a [map of your entire git repo](https://aider.chat/docs/repomap.html).
|
||||
So the LLM can see all the other relevant parts of your code base.
|
||||
- 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.
|
||||
- It's always safe to use Control-C to interrupt aider 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.
|
||||
- If your code is throwing an error,
|
||||
use the `/run` [in-chat command](/docs/usage/commands.html)
|
||||
## Just add the files that need to be changed to the chat
|
||||
|
||||
Take a moment and think about which files will need to be changed.
|
||||
Aider can often figure out which files to edit all by itself, but the most efficient approach is for you to add the files to the chat.
|
||||
|
||||
## Don't add lots of files to the chat
|
||||
|
||||
Just add the files you think need to be edited.
|
||||
Too much irrelevant code will distract and confuse the LLM.
|
||||
Aider uses a [map of your entire git repo](https://aider.chat/docs/repomap.html)
|
||||
so is usually aware of relevant classes/functions/methods elsewhere in your code base.
|
||||
It's ok to add 1-2 highly relevant files that don't need to be edited,
|
||||
but be selective.
|
||||
|
||||
## Break your goal down into bite sized steps
|
||||
|
||||
Do them one at a time.
|
||||
Adjust the files added to the chat as you go: `/drop` files that don't need any more changes, `/add` files that need changes for the next step.
|
||||
|
||||
## For complex changes, discuss a plan first
|
||||
|
||||
Use the [`/ask` command](modes.html) to make a plan with aider.
|
||||
Once you are happy with the approach, just say "go ahead" without the `/ask` prefix.
|
||||
|
||||
## If aider gets stuck
|
||||
|
||||
- Use `/clear` to discard the chat history and make a fresh start.
|
||||
- Can you `/drop` any extra files?
|
||||
- Use `/ask` to discuss a plan before aider starts editing code.
|
||||
- Use the [`/model` command](commands.html) to switch to a different model and try again. Switching between GPT-4o and Sonnet will often get past problems.
|
||||
- If aider is hopelessly stuck,
|
||||
just code the next step yourself and try having aider code some more after that.
|
||||
Take turns and pair program with aider.
|
||||
|
||||
## Creating new files
|
||||
|
||||
If you want aider to create a new file, add it to the repository first with `/add <file>`.
|
||||
This way aider knows this file exists and will write to it.
|
||||
Otherwise, aider might write the changes to an existing file.
|
||||
This can happen even if you ask for a new file, as LLMs tend to focus a lot
|
||||
on the existing information in their contexts.
|
||||
|
||||
## Fixing bugs and errors
|
||||
|
||||
If your code is throwing an error,
|
||||
use the [`/run` command](commands.html)
|
||||
to share the error output with the aider.
|
||||
Or just paste the errors into the chat. Let the aider figure out and fix the bug.
|
||||
- If test are failing, use the `/test` [in-chat command](/docs/usage/commands.html)
|
||||
Or just paste the errors into the chat. Let the aider figure out how to fix the bug.
|
||||
|
||||
If test are failing, use the [`/test` command](lint-test.html)
|
||||
to run tests and
|
||||
share the error output with the aider.
|
||||
- {% include multi-line.md %}
|
||||
- LLMs know about a lot of standard tools and libraries, but may get some of the fine details wrong about API versions and function arguments.
|
||||
You can paste doc snippets into the chat to resolve these issues.
|
||||
|
||||
## Providing docs
|
||||
|
||||
LLMs know about a lot of standard tools and libraries, but may get some of the fine details wrong about API versions and function arguments.
|
||||
|
||||
You can provide up-to-date documentation in a few ways:
|
||||
|
||||
- Paste doc snippets into the chat.
|
||||
- Include a URL to docs in your chat message
|
||||
and aider will scrape and read it. For example: `Add a submit button like this https://ui.shadcn.com/docs/components/button`.
|
||||
- Use the [`/read` command](commands.html) to read doc files into the chat from anywhere on your filesystem.
|
||||
- If you have coding conventions or standing instructions you want aider to follow, consider using a [conventions file](conventions.html).
|
||||
|
||||
## Interrupting & inputting
|
||||
|
||||
Use Control-C to interrupt aider if it isn't providing a useful response. The partial response remains in the conversation, so you can refer to it when you reply with more information or direction.
|
||||
|
||||
{% include multi-line.md %}
|
||||
|
||||
|
|
|
@ -8,6 +8,11 @@ description: Intro and tutorial videos made by aider users.
|
|||
|
||||
Here are some tutorial videos made by aider users:
|
||||
|
||||
- [Using Architect/Editor mode](https://www.youtube.com/watch?v=OPXslklVBZc) -- AICodeKing
|
||||
- [Using aider to incrementally build a non-trivial app](https://youtu.be/QlUt06XLbJE) -- IndyDevDan
|
||||
- [Aider and Replit on mobile with your voice](https://x.com/itsPaulAi/status/1830987090617831810) -- Paul Couvert
|
||||
- [Aider is the OG AI Coding King (Mermaid Diagram AI Agent)](https://www.youtube.com/watch?v=ag-KxYS8Vuw) -- IndyDevDan
|
||||
- [Installing aider in replit and making a Trello clone](https://x.com/itspaulai/status/1828834199597633724) -- Paul Couvert
|
||||
- [Step-by-Step Development Environment Setup for AI-Assisted Coding](https://www.youtube.com/watch?v=DnBVgfe6ZQM) -- Coding the Future With AI
|
||||
- [Generate FULL-STACK Apps with Claude 3.5 Sonnet](https://youtu.be/sKeIZGW8xzg) -- AICodeKing
|
||||
- [Creating Games with AI from Start-To-End](https://youtu.be/sOd2YYZFMUs) -- AICodeKing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue