// Aider
Git-native terminal AI pair programmer. Aider automatically commits each change to git, making it ideal for developers who want clean, trackable AI-assisted edits — works with any OpenAI-compatible API (DeepSeek, Kimi K2.6, etc.).
01# Overview
Aider is a mature, open-source CLI tool for AI pair programming. What makes it unique is its deep git integration — every change Aider makes is automatically committed with a descriptive message, giving you a clean history of AI-assisted modifications.
Automatic git commits
Every change gets a clean commit message
Multi-file editing
Works across multiple files simultaneously
Architect mode
High-level design with a planning model
OpenAI compatible
Works with any OpenAI-compatible API
02# Installation
Install Aider using pip (Python 3.9+ required):
# Install aider
pip install aider-chat
# Or with pipx (recommended for isolation):
pipx install aider-chat
# Verify installation:
aider --versionpython3 --version. If you don't have Python installed, download it from python.org or use your package manager.03# Configure API Key
Set your API provider endpoint and key via environment variables:
# Add to your shell profile ($HOME/.zshrc or $HOME/.bashrc):
export OPENAI_API_BASE="<your-api-base-url>"
export OPENAI_API_KEY="<your-api-key>"
# Apply changes:
source $HOME/.zshrc # or source $HOME/.bashrcAlternatively, create a .env file in your project root:
OPENAI_API_BASE=<your-api-base-url>
OPENAI_API_KEY=<your-api-key>04# Basic Usage
Navigate to your project (must be a git repo) and start Aider with your configured model:
cd /path/to/your-project
# Start with a specific model:
aider --model openai/<your-model-id>
# Or start in architect mode (planning + coding):
aider --model openai/<your-model-id> --architectOnce running, you can chat naturally:
> Add input validation to the signup form
> Create a new API route for fetching user profiles
> Refactor the auth middleware to support role-based access/add filename to explicitly add files to the chat context. Aider will only edit files it knows about.05# Git Workflow
Aider's git integration is automatic. Every change it makes gets committed:
# Example git log after an Aider session:
* a3f2c1d aider: Add input validation to signup form
* b7e4a9f aider: Create user profile API route
* c1d5e8g aider: Add role-based access to auth middleware
* d9f2b3a (your-branch) Manual commit before Aider session--auto-commitsEnabled by default — each change gets its own commit--no-auto-commitsDisable auto-commits if you prefer to commit manually/undoUndo the last Aider commit (reverts the change)/diffShow the diff of the last change/gitRun any git command from within Aider06# Commands
Key commands inside an Aider session:
/add <file>Add a file to the chat context for editing/drop <file>Remove a file from the chat context/lsList all files currently in the chat context/undoUndo the last change and git commit/diffShow diff of the last change/run <cmd>Run a shell command and share output with Aider/test <cmd>Run tests; on failure, Aider auto-fixes/clearClear the chat history/helpShow all available commands/quitExit Aider07# Best Practices
Always work on a feature branch
Create a dedicated branch before starting an Aider session. This keeps AI commits separate from your main branch.
Add only relevant files
Use /add sparingly. Only add files that Aider needs to read or modify. Too many files wastes context.
Use /test for auto-fixing
/test runs your test suite — if tests fail, Aider automatically attempts to fix the failing tests.
Create a .aider.conf.yml
Store your model and endpoint configuration in a project-level config file so you don't need to pass flags every time.
Review commits before merging
Aider commits are atomic but always review the full diff in a PR before merging to your main branch.
Project Configuration
# .aider.conf.yml
model: openai/<your-model-id>
auto-commits: true
stream: true