Configure and use Aider, an AI pair programming tool with advanced context understanding and code editing capabilities. Supports multiple LLMs, automatic commits, and intelligent code navigation.
Configure and use Aider to collaborate with AI on code changes. Aider understands your entire codebase, makes coordinated edits across multiple files, and automatically commits changes with meaningful messages.
Guides you through setting up and using Aider's configuration file (`.aider.conf.yml`) to customize AI-assisted coding sessions. Aider can use Claude, GPT-4, DeepSeek, and other LLMs to write, refactor, and debug code while maintaining git history.
1. **Create Configuration File**
- Place `.aider.conf.yml` in your git repository root or home directory
- Start with minimal configuration and expand as needed
- Only OpenAI and Anthropic API keys can be stored in YAML (use `.env` for other providers)
2. **Choose Your Main Model**
```yaml
# Use Claude Sonnet (recommended for code)
model: anthropic/claude-3-7-sonnet-20250219
# Or GPT-4o
model: gpt-4o
# Or DeepSeek (cost-effective)
model: deepseek/deepseek-chat
```
3. **Configure API Access**
```yaml
# For Anthropic
anthropic-api-key: sk-ant-xxx
# For OpenAI
openai-api-key: sk-xxx
# For other providers, use .env file or set-env
set-env:
- DEEPSEEK_API_KEY=sk-xxx
```
4. **Model Settings**
```yaml
# Weaker model for commit messages (saves costs)
weak-model: gpt-4o-mini
# Editor model for quick fixes
editor-model: gpt-4o-mini
# Repository map token limit (0 to disable)
map-tokens: 1024
```
5. **Git Integration**
```yaml
# Auto-commit changes (default: true)
auto-commits: true
# Allow commits when repo is dirty (default: true)
dirty-commits: true
# Attribution options
attribute-author: true
attribute-committer: true
attribute-commit-message-author: false
```
6. **Output Preferences**
```yaml
# Terminal appearance
dark-mode: true
pretty: true
stream: true
# Show diffs before committing
show-diffs: true
```
7. **Automatic Testing and Linting**
```yaml
# Run tests after changes
test-cmd: pytest
auto-test: true
# Lint and fix automatically
lint-cmd:
- "python: ruff check --fix"
- "typescript: eslint --fix"
auto-lint: true
```
8. **Voice Coding**
```yaml
voice-format: wav
voice-language: en
voice-input-device: "Built-in Microphone"
```
9. **Caching for Performance**
```yaml
# Enable prompt caching (reduces API costs)
cache-prompts: true
# Keep cache warm for faster responses
cache-keepalive-pings: 2
```
10. **Edit Formats**
```yaml
# Let Aider choose best format for model (recommended)
# Or force specific format:
edit-format: diff
# Options: diff, whole, diff-fenced, udiff
# Use architect mode for complex refactors
architect: false
```
11. **Start Aider Session**
```bash
# Launch with config
aider
# Add specific files to context
aider src/main.py tests/test_main.py
# One-shot mode
aider --message "Add error handling to login function"
```
12. **In-Chat Commands**
- `/add <file>` - Add file to chat context
- `/drop <file>` - Remove file from context
- `/commit` - Commit pending changes
- `/undo` - Undo last change
- `/run <cmd>` - Run shell command
- `/test` - Run configured tests
- `/lint` - Run linter
- `/exit` - Exit aider
13. **File Management**
```yaml
# Specify files to always include
file:
- src/core.py
- config.yaml
# Read-only reference files
read:
- README.md
- docs/architecture.md
# Ignore patterns
aiderignore: .aiderignore
```
14. **Minimal Setup (Claude)**
```yaml
model: anthropic/claude-3-7-sonnet-20250219
anthropic-api-key: sk-ant-xxx
dark-mode: true
auto-commits: true
```
15. **Cost-Optimized Setup**
```yaml
model: deepseek/deepseek-chat
weak-model: gpt-4o-mini
cache-prompts: true
map-tokens: 512
set-env:
- DEEPSEEK_API_KEY=sk-xxx
```
16. **Full-Featured Setup**
```yaml
model: gpt-4o
weak-model: gpt-4o-mini
editor-model: gpt-4o-mini
openai-api-key: sk-xxx
dark-mode: true
show-diffs: true
stream: true
auto-commits: true
attribute-author: true
test-cmd: pytest -v
auto-test: true
lint-cmd:
- "python: ruff check --fix"
auto-lint: true
cache-prompts: true
map-tokens: 2048
```
```bash
cat > .aider.conf.yml <<EOF
model: anthropic/claude-3-7-sonnet-20250219
anthropic-api-key: $ANTHROPIC_API_KEY
dark-mode: true
auto-commits: true
show-diffs: true
map-tokens: 2048
EOF
aider
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/aider-ai-pair-programming-yyha1m/raw