Configure Aider AI pair programming tool with optimized settings for model selection, git integration, caching, and workflow automation
Configure Aider AI pair programming tool with production-ready settings for optimal coding assistance, git integration, and workflow automation.
Sets up a comprehensive `.aider.conf.yml` configuration file that optimizes Aider for:
1. **Determine Configuration Location**
- Place `.aider.conf.yml` in your home directory (`~/`) for global settings
- Or place at the root of your git repository for project-specific settings
- Repository configs override global configs
2. **Create Configuration File**
- Create `.aider.conf.yml` with the following optimized settings:
```yaml
model: openrouter/google/gemini-2.5-flash
auto-accept-architect: false
cache-prompts: true
cache-keepalive-pings: 12
dark-mode: true
stream: true
show-diffs: true
vim: true
notifications: true
auto-commits: true
watch-files: true
yes-always: true
```
3. **Add API Keys (Choose One Method)**
**Option A: In config file (OpenAI/Anthropic only)**
```yaml
openai-api-key: sk-...
anthropic-api-key: sk-ant-...
```
**Option B: Environment file (recommended for all providers)**
- Create `.env` file in git root:
```bash
OPENROUTER_API_KEY=sk-or-...
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
GEMINI_API_KEY=...
```
**Option C: Use --api-key flag**
```yaml
api-key:
- openrouter=sk-or-...
- anthropic=sk-ant-...
```
4. **Customize Model Selection**
**For different speed/cost tradeoffs:**
```yaml
# Maximum quality
model: anthropic/claude-3-7-sonnet-20250219
# Balanced quality/speed
model: gemini/gemini-2.5-pro-preview-03-25
# Fast and economical (recommended)
model: openrouter/google/gemini-2.5-flash
```
5. **Configure Git Behavior**
```yaml
# Disable auto-commits if you prefer manual control
auto-commits: false
# Enable commit attribution
attribute-author: true
attribute-committer: true
# Prefix commit messages
attribute-commit-message-committer: true
```
6. **Set Up Linting and Testing**
```yaml
# Enable auto-linting after changes
auto-lint: true
# Configure lint commands per language
lint-cmd:
- "python: ruff check --fix"
- "typescript: eslint --fix"
- "go: golangci-lint run --fix"
# Configure test command
test-cmd: "npm test"
auto-test: true
```
7. **Optimize Repo Map Settings**
```yaml
# Increase token budget for larger repos
map-tokens: 2048
# Control refresh frequency
map-refresh: auto # Options: auto, always, files, manual
# Adjust multiplier for context without specific files
map-multiplier-no-files: 2
```
8. **Configure History and Logging**
```yaml
# Custom history file locations
input-history-file: .aider.input.history
chat-history-file: .aider.chat.history.md
# Restore previous chat on startup
restore-chat-history: true
# Log all LLM interactions for debugging
llm-history-file: .aider.llm.history
```
9. **Test Configuration**
```bash
# Start aider to verify config is loaded
aider
# Check that your model is active
/model
# Verify git integration
/git
```
10. **Add .aiderignore for Exclusions**
- Create `.aiderignore` in git root to exclude files:
```
# Build outputs
dist/
build/
*.pyc
# Dependencies
node_modules/
vendor/
# Large data files
*.db
*.sqlite
data/
```
**Model Settings:**
**Git Integration:**
**Performance:**
**User Experience:**
**Quick Setup:**
```bash
cd ~/
curl -O https://example.com/.aider.conf.yml
aider
```
**Project-Specific Config:**
```bash
cd your-project/
cp ~/.aider.conf.yml .aider.conf.yml
git add .aider.conf.yml
```
**Switch Models:**
```yaml
model: anthropic/claude-3-7-sonnet-20250219 # High quality
model: gemini/gemini-2.5-flash # Fast and cheap
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/aider-configuration-best-practices/raw