AIDER MASTERY
Aider Expert Guide
Git-native AI coding, multi-model support, TDD automation, and CI/CD integration — master the terminal-based AI pair programmer.
AIDER SETUP
Install and configure Aider — the terminal-based AI pair programmer with git-native workflow.
1
Install Aider
# Via pip (recommended):
pip install aider-chat
# Or via Homebrew:
brew install aider
# Or pipx for isolated install:
pipx install aider-chatAider is a terminal-based AI pair programmer. Works with any editor — it edits files directly.
2
Configure API Key
# Set your API key:
export ANTHROPIC_API_KEY=sk-ant-...
# Or:
export OPENAI_API_KEY=sk-...
# Add to ~/.bashrc or ~/.zshrc for persistenceAider supports 20+ LLM providers: Anthropic, OpenAI, Ollama, Azure, Google, and more.
3
Start Aider in Your Project
cd /path/to/project
aider
# Or with specific model:
aider --model claude-3.5-sonnet
# Or with specific files:
aider src/App.tsx src/hooks/useAuth.tsAider auto-detects your git repo and uses it for tracking changes. Each AI edit is a git commit.
4
Create Conventions File
cat > .aider.conventions.md << 'EOF'
# Project Conventions
- Stack: React + TypeScript + Tailwind CSS
- Use semantic tokens from design system
- Functional components with arrow syntax
- Props typed with interfaces
- Run tests: npm test
- Lint: npm run lint
EOF
# Tell aider to use it:
aider --read .aider.conventions.mdConvention files give Aider persistent context. Use --read to include without editing.
5
Make Your First Edit
# In aider session:
> Add error handling to the fetchUser function in src/lib/api.ts
# Aider will:
# 1. Read the file
# 2. Show proposed changes as a diff
# 3. Apply changes and create a git commit
# 4. You can /undo if you don't like the resultEvery change is a git commit — /undo reverts cleanly. Your git history stays useful.