Aider: How to Install and Use the AI Pair Programmer in Your Terminal
Aider: How to Install and Use the AI Pair Programmer in Your Terminal If you want an AI coding assistant that edits files directly in your repository, runs git commits automatically, and works with both cloud APIs and free local models via Ollama, Aider is one of the fastest tools you can add to yo

If you want an AI coding assistant that edits files directly in your repository, runs git commits automatically, and works with both cloud APIs and free local models via Ollama, Aider is one of the fastest tools you can add to your terminal.
Unlike browser-based chat tools where you constantly copy and paste snippets back and forth, Aider maps your codebase, applies multi-file edits cleanly, and tracks every change with Git.
Before installing Aider, make sure you have:
Open your terminal (PowerShell on Windows, Terminal on macOS/Linux) and install aider-chat via pip:
python -m pip install aider-chat Enter fullscreen mode Exit fullscreen mode Windows Tip (If aider is not recognized or you have multiple Python versions) If you run into PATH issues or dependency build errors on a newer Python version, target Python 3.12 explicitly using the Windows Python Launcher:
py - 3.12 - m pip install aider - chat Enter fullscreen mode Exit fullscreen mode Verify the installation:
aider --version # Or on Windows via Python module: py -3.12 -m aider --version Enter fullscreen mode Exit fullscreen mode Step 2: Connect an LLM (Cloud or Local) Aider supports almost every major LLM provider—including Anthropic, OpenAI, Gemini, DeepSeek, and local models via Ollama.
Set your API key as an environment variable and launch Aider:
export ANTHROPIC_API_KEY = your_api_key_here aider --model claude-3-7-sonnet-latest Enter fullscreen mode Exit fullscreen mode Windows (PowerShell):
\ $env: ANTHROPIC_API_KEY = "your_api_key_here" aider -- model claude - 3 - 7 - sonnet - latest Enter fullscreen mode Exit fullscreen mode Option B: Using Free Local Models with Ollama (Offline & Private) If you have Ollama running locally, you can code completely offline at zero cost:
ollama pull qwen2.5-coder:1.5b Enter fullscreen mode Exit fullscreen mode Launch Aider pointed at your Ollama model: aider --model ollama_chat/qwen2.5-coder:1.5b --no-detect-urls Enter fullscreen mode Exit fullscreen mode Pro Tip for Local Models: Adding --no-detect-urls prevents Aider from launching a headless browser to scrape localhost URLs (like http://127.0.0.1:11434 ) if you paste them into your prompt—saving hundreds of megabytes of RAM.
Navigate to your project folder and launch Aider with the specific files you want it to edit:
cd my-project aider app.py utils.py Enter fullscreen mode Exit fullscreen mode Once inside the Aider prompt, you can type plain English instructions—or use built-in slash commands to control context and Git: