All tutorials/3 min/Beginner

Aider tutorial

How to Install Aider AI Coding CLI on Mac and Windows

Step-by-step guide to installing the Aider AI pair programming CLI on macOS and Windows. Learn how to configure API keys for Claude 3.7 and GPT-4o.

AI ToolsCLIBeginner
Interactive tutorial

Quick command sequence

$ pip install aider-chat

/fr/tutorials/install-aider-ai-coding-cli-mac-windows

Interactive command lab

1/4

Step 1

Verify Python and pip

Aider is a Python package. If you get 'command not found', download Python from python.org before continuing.

Checkpoint

python3 --version

zsh — tutorial-lab

Command tray

$ python3 --version
pip --version

Python 3.12.2

pip 24.0 from /usr/local/lib/python3.12/site-packages/pip (python 3.12)

Step-by-step instructions

  1. 1

    Step

    Verify Python and pip

    Aider is a Python package. If you get 'command not found', download Python from python.org before continuing.

    python3 --version
    pip --version
  2. 2

    Step

    Install Aider via pip

    If you get an 'externally-managed-environment' error on macOS, run `pipx install aider-chat` instead.

    pip install aider-chat
  3. 3

    Step

    Set your API Key

    To use GPT-4o instead, use `export OPENAI_API_KEY=your-key`.

    export ANTHROPIC_API_KEY=your_key_here
  4. 4

    Step

    Launch Aider

    Aider requires your project to be a Git repository. If it's not, run `git init` first.

    cd your-project-folder
    aider

Why this matters

Aider is a leading AI pair programming CLI that lets you edit multiple files simultaneously right from your terminal. Unlike browser-based LLMs where you have to copy-paste code, Aider integrates directly into your Git workflow, executing changes automatically and writing detailed commit messages on your behalf. Setting it up locally gives you maximum flexibility over which AI model you use.

Troubleshooting

  • **'externally-managed-environment' on macOS:** Modern macOS versions block global pip installs. Instead of using `pip`, install pipx using Homebrew (`brew install pipx`), run `pipx ensurepath`, and then install Aider via `pipx install aider-chat`.
  • **'aider is not recognized' on Windows:** If you installed Aider but Windows can't find it, your Python Scripts folder isn't in your PATH. Search for 'Environment Variables', edit PATH, and add `%USERPROFILE%\AppData\Local\Programs\Python\Python312\Scripts` (adjusting for your version).
  • **No Git repository error:** Aider is designed to track its own changes using Git. If you run `aider` in an empty folder, it will prompt you. Simply run `git init` to initialize the repository before starting your coding session.

FAQ

Why do I get 'command not found: aider' after installing?

This usually means the directory where `pip` installed the executable is not in your system's PATH variable. You either need to add the Python Scripts directory to your PATH or use `pipx` to manage the installation.

Can I use OpenAI GPT-4o instead of Claude?

Yes. While Claude 3.7 Sonnet is currently the top performer for Aider's benchmarks, you can easily use GPT-4o. Just run `export OPENAI_API_KEY=your-key` and launch the CLI with `aider --model gpt-4o`.

Does Aider work in PowerShell?

Absolutely. Once installed via pip, the `aider` command works in PowerShell, Command Prompt, Windows Terminal, and WSL.

How do I update Aider to the latest version?

If you used pip, run `pip install --upgrade aider-chat`. If you used pipx, run `pipx upgrade aider-chat`.

Does Aider send my entire codebase to the API?

No. Aider uses a repository map to understand the architecture, but it only sends the specific files you have "added" to the chat session.

Related tutorials