Aider¶
Official Docs: aider.chat Category: CLI
Aider is an open-source AI pair programming tool that works in your terminal. It supports multiple AI models and integrates with git.
Quick Links¶
Configuration¶
See Understanding Config Directories for general concepts.
Aider can be configured via:
| Method | Location |
|---|---|
| Command line flags | Per-session |
| Environment variables | AIDER_* variables |
| Config file | .aider.conf.yml in project or home |
| Git config | .aider section in .git/config |
Configuration File¶
# ~/.aider.conf.yml or project/.aider.conf.yml
model: claude-3-5-sonnet-20241022
auto-commits: true
dark-mode: true
Environment Variables¶
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."
export AIDER_MODEL="claude-3-5-sonnet-20241022"
Tips & Tricks¶
Community Tips
This section collects tips from real users. Contribute your tips!
Useful commands:
/add file.py- Add file to context/drop file.py- Remove file from context/undo- Undo last change/diff- Show pending changes/commit- Commit changes
Workflow tips:
- Start with small, focused changes
- Use
/addto give Aider context about related files - Review diffs before committing
- Aider auto-commits by default - use
--no-auto-commitsif you prefer manual control
Model selection:
# Use Claude
aider --model claude-3-5-sonnet-20241022
# Use GPT-4
aider --model gpt-4-turbo
# Use local model via Ollama
aider --model ollama/codellama
Common Issues¶
"Model not found"
- Check you have the correct API key set
- Verify the model name is correct
- For Ollama, ensure the model is downloaded
"Git repository required"
- Aider works best in git repos
- Initialize with
git initif needed - Or use
--no-gitflag
"Context too large"
- Use
/dropto remove unnecessary files - Be selective about which files to
/add - Consider using a model with larger context
Community Resources¶
- Aider Discord - Active community
- GitHub Discussions
- Aider Blog
Help Improve This Page
Know a tip that's not listed? Found a helpful video tutorial? Contribute to this page.