cheat-sheets

Aider

Terminal pair-programming tool that edits files in a Git repo and commits each change. It works with Anthropic, OpenAI and local models, so it suits switching providers.

Project: Aider Documentation: aider.chat/docs

Verification: commands and options are from the official docs as remembered; Aider was not installed here and nothing was executed. Check aider --help. Items marked (unverified) need confirming.

Install and Start #

COMMANDDESCRIPTION
uv tool install aider-chatInstall (unverified: the docs also show the aider-install package)
aiderStart in the current Git repo
aider FILE...Start with files added to the chat
aider --model MODELChoose a model
aider --message "PROMPT"Run one instruction and exit
aider --helpList every option

Models and Keys #

bash
export ANTHROPIC_API_KEY="YOUR_API_KEY"
aider --model sonnet

export OPENAI_API_KEY="YOUR_API_KEY"
aider --model MODEL_NAME

export OLLAMA_API_BASE="http://127.0.0.1:11434"
aider --model ollama_chat/llama3.2:3b

Local models need a large context (num_ctx) set in Ollama or edits degrade (unverified).

Useful Flags #

FLAGMEANING
--no-auto-commitsDo not commit after every change
--read FILEAdd a file as read-only context
--architectUse a planner model and an editor model
--watch-filesAct on AI! and AI? comments you add in files
--yesAuto-confirm prompts; use carefully
--dark-modeColours for a dark terminal

In-Chat Commands #

COMMANDDESCRIPTION
/add FILEAdd a file for editing
/read-only FILEAdd as reference only
/drop FILERemove from chat
/lsList files in play
/diffShow changes since the last message
/undoUndo the last Aider commit
/commitCommit outside changes
/run COMMANDRun a command and offer its output to the chat
/test COMMANDRun tests and fix failures
/ask / /code / /architectSwitch chat mode
/model MODELChange the main model
/tokensShow context use
/clearClear chat history
/exitQuit

Configuration #

.aider.conf.yml in the repo or home directory; keys mirror the long flag names. Keep API keys in the environment or an untracked .env.

yaml
model: sonnet
auto-commits: false
read:
  - CONVENTIONS.md

See Also #

Search all sheets

Tip: / or Ctrl/Cmd+K to open, Esc to close.