CandidDevelopers
cd ../setup-guides
$cataider-setup.md

// 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.).

v1.0|7 sections|terminal|free

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):

bash
# Install aider
pip install aider-chat

# Or with pipx (recommended for isolation):
pipx install aider-chat

# Verify installation:
aider --version
📌Python Required
Aider requires Python 3.9 or higher. Check your version with python3 --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:

.zshrc
bash
# 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/.bashrc

Alternatively, create a .env file in your project root:

.env
bash
OPENAI_API_BASE=<your-api-base-url>
OPENAI_API_KEY=<your-api-key>
⚠️Get Your Credentials
Contact your team lead or check the #dev-tools channel for approved API providers and keys (DeepSeek, Kimi K2.6, etc.).

04# Basic Usage

Navigate to your project (must be a git repo) and start Aider with your configured model:

bash
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> --architect

Once running, you can chat naturally:

text
> 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
💡Tip
Use /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:

git log
text
# 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 Aider
💡Pro Tip
Always create a new branch before starting an Aider session. This way you can easily review all AI changes in a PR and squash or cherry-pick as needed.

06# 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 Aider

07# 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
yaml
# .aider.conf.yml
model: openai/<your-model-id>
auto-commits: true
stream: true

08# Terminal Compatibility

💡Works alongside Claude Code & Codex
Since Aider is a terminal tool, you can run Claude Code or Codex CLI in separate terminal sessions alongside it — giving you multiple AI coding engines working on the same project. This does not break any terms of service; each tool runs independently in its own shell. Check our Claude Code and Codex setup guides to get started.