Aider Configuration
A comprehensive Aider AI coding assistant configuration supporting multiple AI providers with production-grade settings for code generation, git integration, and automated workflows.
What This Configuration Does
This configuration sets up Aider with:
**Multi-provider API support**: OpenAI, Anthropic (Claude), Google Gemini, and OpenRouter**GPT-4o as primary model** for main chat interactions**Persistent history tracking** for inputs and chat conversations**Git integration** with auto-commits and attribution**Automatic linting** after code changes**Custom model settings** support via external configuration files**Repository mapping** for better context awareness**Color-coded terminal output** for enhanced readabilityConfiguration Details
API Provider Setup
The configuration includes API keys for:
**OpenAI**: Primary provider for GPT-4o model**Anthropic**: Claude models for advanced reasoning**Google Gemini**: Alternative model access via API key**OpenRouter**: Access to multiple models including Llama and Gemini variantsModel Configuration
**Main model**: GPT-4o (`4o: true`)**Model settings file**: `~/.config/aider/.aider.model.settings.yml`**Repository map tokens**: 1024 (default, for context awareness)**Map refresh**: Auto (optimizes when to update code context)History & Persistence
**Input history**: `~/.config/aider/.aider.input.history`**Chat history**: `~/.config/aider/.aider.chat.history.md`Enables tracking of all interactions and commands across sessionsGit Integration
**Auto-commits**: Enabled (commits LLM changes automatically)**Dirty commits**: Enabled (allows commits even with pending changes)**Author attribution**: Marks aider-generated changes in git author field**Committer attribution**: Marks commits in git committer field**.gitignore management**: Automatically adds `.aider*` files to .gitignoreCode Quality
**Auto-lint**: Enabled (runs linting automatically after changes)**Lint commands**: Configurable per language (currently not set)**Auto-test**: Disabled by default**Diffs**: Not shown on commit (can be enabled with `show-diffs: true`)Terminal Experience
**Streaming responses**: Enabled for real-time output**Fancy input**: Enabled with history and completion support**URL detection**: Automatically detects and offers to add URLs to chat**Shell command suggestions**: Enabled for helpful CLI recommendations**Encoding**: UTF-8Usage Instructions
1. **Save this configuration** to `~/.config/aider/.aider.conf.yml`
2. **Create required directories**:
```bash
mkdir -p ~/.config/aider
```
3. **Replace API keys** with your actual credentials:
- OpenAI API key (starts with `sk-proj-`)
- Anthropic API key (starts with `sk-ant-api03-`)
- Gemini API key (starts with `AIzaSy`)
- OpenRouter API key (starts with `sk-or-v1-`)
4. **Launch Aider** from any git repository:
```bash
aider
```
The configuration will be automatically loaded.
5. **Optional model settings file**: Create `~/.config/aider/.aider.model.settings.yml` for custom model configurations
Important Security Notes
**NEVER commit API keys to version control**Store this configuration file in your home directory, not in project reposUse environment variables or secure credential storage for sensitive keysThe provided API keys in the source are examples and should be replacedCustomization Options
Switch Primary Model
To use a different primary model, modify these settings:
```yaml
4o: false # Disable GPT-4o
sonnet: true # Enable Claude Sonnet
OR
model: openrouter/meta-llama/llama-3-70b-instruct # Specify custom model
```
Enable Testing
```yaml
auto-test: true
test-cmd: pytest # or your test command
```
Configure Linting
```yaml
lint-cmd:
- "python: flake8 --select=E,W"
- "javascript: eslint"
```
Adjust Repository Mapping
```yaml
map-tokens: 2048 # Increase context window for larger repos
map-refresh: always # Refresh map on every interaction
```
Constraints
Requires valid API keys for at least one providerGit repository recommended for full functionalitySome features (like auto-commits) require git to be enabledModel availability depends on your API subscription levelFile history persistence requires write access to `~/.config/aider/`