Aider AI Coding Assistant Cheatsheet
Aider is an open-source AI coding assistant that runs in the terminal, supports multiple LLM models (Claude, GPT-4o, DeepSeek, etc.), and features automatic Git integration, repository map awareness, and multi-file editing capabilities.
Overview
Aider is an open-source AI coding assistant that runs in the terminal, supporting multiple LLM backends. It features automatic Git integration, repository map awareness, and concurrent multi-file editing — a powerful tool for local AI-assisted coding.
Quick Start
``bash
# Install Aider
pip install aider-chat
# Set up API Key (using Anthropic as example) export ANTHROPIC_API_KEY=your-key-here
# Start an Aider session aider
# Specify a model aider --model claude-sonnet-4-20250514
# Architect mode (two-model collaboration)
aider --architect --model sonnet
`
Refer to the command table below for detailed usage.
Launch Modes
Aider offers various launch modes: standard interactive, architect mode (dual-model), --ask (questions only, no edits), --yes (auto-confirm), --vim (Vim key bindings).
File Management
Use /add, /drop, /read-only to manage file context within the session. /ls lists all active files. /read-only marks files as read-only to prevent AI modification.
Chat Commands
Manage sessions with /help, /clear, /diff, /undo, /tokens, /model, and more. Supports /copy and /copy-context to duplicate content, /voice for speech input, /web to fetch web page content.
Code Editing
Supports multiple edit formats (--edit-format) including diff, udiff, search/replace. Combine with --lint and --test to automatically run linters and tests after edits.
Git Integration
Aider automatically manages Git commits, creating checkpoints before each modification. Use /commit for manual commits and /git to run custom Git commands. Enable with --git.
Advanced
Advanced commands include /run to execute shell commands, /voice for speech-to-code input, /web to fetch web page content for AI reference, /load and /save for session state management, /report for generating reports, and /exit to quit. The .aider.conf.yml` configuration file supports granular model parameters and environment settings.
Startup & Modes(9)
| Command | Level | ||
|---|---|---|---|
aiderStart an Aider interactive session in current directory | Basic | aider | |
aider --modelSpecify which LLM model to use | Basic | aider --model claude-sonnet-4-20250514 | |
aider --model sonnetUse Claude Sonnet model | Basic | aider --model sonnet | |
aider --model gpt-4oUse OpenAI GPT-4o model | Basic | aider --model gpt-4o | |
aider --model deepseekUse DeepSeek model | Basic | aider --model deepseek | |
aider --architectArchitect mode (dual-model collaboration) | Expert | aider --architect --model sonnet | |
aider --askQuestions-only mode, no code modifications | Basic | aider --ask 'Explain the caching strategy' | |
aider --yesAuto-confirm all AI-suggested edits | Intermediate | aider --yes 'Add tests for auth module' | |
aider --vimEnable Vim key binding mode | Intermediate | aider --vim |
File Management(4)
| Command | Level | ||
|---|---|---|---|
/addAdd files to the session context | Basic | /add src/main.py tests/test_main.py | |
/dropRemove files from session context | Basic | /drop src/utils.py | |
/read-onlyAdd files as read-only (AI cannot modify) | Intermediate | /read-only config/settings.py | |
/lsList all active files in the current session | Basic | /ls |
Chat Commands(8)
| Command | Level | ||
|---|---|---|---|
/helpShow help for all available commands | Basic | /help | |
/clearClear the session history display | Basic | /clear | |
/diffShow diff of the most recent changes | Basic | /diff | |
/undoUndo the most recent AI modification | Basic | /undo | |
/tokensShow token usage statistics for current context | Intermediate | /tokens | |
/modelSwitch the model used in the current session | Intermediate | /model gpt-4o | |
/copyCopy last AI response to clipboard | Basic | /copy | |
/copy-contextCopy current session context to clipboard | Intermediate | /copy-context |
Code Editing(6)
| Command | Level | ||
|---|---|---|---|
/codeDescribe code change requests in natural language | Basic | /code Add input validation for email field | |
aider --edit-formatSpecify edit format (diff/udiff/search-replace) | Expert | aider --edit-format diff | |
aider --lintAuto-run linter after edits | Intermediate | aider --lint | |
/lintRun linter on the current file | Intermediate | /lint | |
aider --testAuto-run tests after edits | Intermediate | aider --test | |
/testRun the project's test suite | Intermediate | /test |
Git Integration(5)
| Command | Level | ||
|---|---|---|---|
aider --gitEnable automatic Git integration (default: on) | Basic | aider --git | |
aider --no-gitDisable automatic Git integration | Basic | aider --no-git | |
aider --show-repo-mapShow the project's repository map | Intermediate | aider --show-repo-map | |
/commitManually commit current changes to Git | Basic | /commit | |
/gitExecute a custom Git command | Intermediate | /git log --oneline -5 |
Advanced(9)
| Command | Level | ||
|---|---|---|---|
/runRun a shell command in the terminal | Intermediate | /run npm test | |
/voiceVoice input mode (microphone required) | Intermediate | /voice | |
/webFetch web content and add to context | Intermediate | /web https://docs.python.org/3/library/json.html | |
/loadLoad a saved session state | Expert | /load my-session | |
/saveSave the current session state | Expert | /save my-session | |
/reportReport a bug or issue | Basic | /report | |
/exitExit the Aider session | Basic | /exit | |
.aider.conf.ymlAider configuration file (YAML format) | Intermediate | cat .aider.conf.yml | |
pip install aider-chatInstall Aider via pip | Basic | pip install aider-chat |