Command Palette

Search for a command to run...

GitHubGitHub

Aider Installation Guide

Install Aider with the one-line installer, uv or pipx, connect it to a model provider and let it commit your changes to git as it works.

Aider is AI pair programming in your terminal. It edits files, runs your tests and commits each change to git, so you always have a clean undo.

System Requirements

  • Python 3.8 to 3.13 (Aider installs Python 3.12 for itself if you need it)
  • git — Aider works in a repository and commits as it goes
  • An API key for one of the supported providers, or a local model through Ollama or LM Studio

Installation Instructions

# macOS and Linux
curl -LsSf https://aider.chat/install.sh | sh
 
# Windows PowerShell
powershell -ExecutionPolicy ByPass -c "irm https://aider.chat/install.ps1 | iex"

The script installs Aider in its own separate Python environment, and installs Python 3.12 for it if the system does not have a suitable version.

With uv

python -m pip install uv
uv tool install --force --python python3.12 --with pip aider-chat@latest

With pipx

python -m pip install pipx
pipx install aider-chat

With pip

Use a virtual environment, otherwise you will fight with dependencies:

python -m venv ~/.venvs/aider
source ~/.venvs/aider/bin/activate
python -m pip install -U --upgrade-strategy only-if-needed aider-chat

Connecting a Model

# Anthropic
export ANTHROPIC_API_KEY=sk-ant-...
aider --model sonnet
 
# OpenAI
export OPENAI_API_KEY=sk-...
aider --model gpt-4o
 
# Google Gemini
export GEMINI_API_KEY=...
aider --model gemini/gemini-2.5-pro
 
# DeepSeek
export DEEPSEEK_API_KEY=...
aider --model deepseek
 
# A local model through Ollama
aider --model ollama/qwen2.5-coder:32b
 
# GitHub Copilot
aider --model copilot/sonnet
# List everything Aider can talk to
aider --models

Put the keys in a .env file next to your project — Aider reads it automatically — and add it to .gitignore:

echo ".env" >> .gitignore

Your First Session

cd /to/your/project
aider --model sonnet --api-key anthropic=$ANTHROPIC_API_KEY
# In the chat
Add a --verbose flag to the CLI that prints the current config on startup.

Aider will:

  1. Read the relevant files
  2. Show you the diff it proposes
  3. Apply the change and commit it

Useful Flags

# Add files explicitly to the context
aider src/parser.py
 
# Let Aider find the relevant files itself
aider --read docs/architecture.md
 
# Skip the git repo (Aider warns when you are not in one)
aider --no-git
 
# Use a specific file to describe the style you want
aider --edit-format diff
 
# Run your test command after every change
aider --test-cmd "pytest -q"

In-Chat Commands

CommandWhat it does
/addAdd files to the chat context
/dropRemove files from the context
/undoUndo the last change (and its commit)
/diffShow the pending changes
/commitCommit manually
/runRun a shell command
/askAsk a question without editing anything
/architectSwitch to the architect model for planning
/codeSwitch back to the coding model
/helpList every command

Architect Mode

For bigger changes, let a stronger model plan and a cheaper model implement:

/architect Design a caching layer for the API and write out the plan.
/code Now implement that plan.

Troubleshooting

Best Practices

  1. Always work in a git repository — Aider commits every change, so you always have an undo.
  2. Commit your work before you start so the history is readable.
  3. Set the test command with --test-cmd so Aider can verify its own changes.
  4. Keep a .env file for keys and add it to .gitignore.
  5. Use architect mode for anything that touches more than two files.
  6. Review the diff before you accept a change.
  7. Be specific — describe the behaviour you want, not just the function names.
  8. Use /undo freely; it is cheap.

Next Steps