How to install and use Aider: pip/uv, API key, first edit

Install Aider with pip or uv, connect an API key, then complete one first edit in a real Git repository.

You want a pair-programming agent that can read a local Git repo, propose a diff, and edit files — without leaving the terminal.

This walkthrough covers how to install and use Aider: install aider-chat with pip, pipx, or uv, connect an API key, and make a first edit in a real repository. Steps follow aider.chat/docs/install.html and aider.chat/docs/usage.html.

Install Connect an API key First repo edit

Who it is for

Aider works against a local Git repository: inspect files, propose patches, write after you confirm, and optionally commit. It is not a web chat tab, and you do not have to install an IDE extension. The folder must already be a Git project.

01

Start in a real repo

cd into an existing Git project before you launch. For the first run, add one or two files such as the README and ask for one reviewable line.

02

Keys live in the environment

Official usage is OPENAI_API_KEY or ANTHROPIC_API_KEY. Export them, or put them in a root .env. Do not paste keys into the prompt, and do not commit that file.

03

Commits may be on by default

Aider often runs git commit after you accept a change. Confirm a clean tree and that secrets are in .gitignore before you start.

Install, connect a key, first edit

  1. 1

    Install aider-chat

    The PyPI name is aider-chat, not a bare aider package. Typical: python3 -m pip install aider-chat. For an isolated command use pipx install aider-chat or uv tool install --python python3.12 aider-chat. Confirm with aider --help.

  2. 2

    Connect an API key

    In the shell, export OPENAI_API_KEY=… or export ANTHROPIC_API_KEY=…. For repeat sessions, put the same names in a root .env and gitignore it. Run aider --list-models to see providers this install recognizes; model ids follow aider.chat/docs/llms.html.

  3. 3

    Make a first repo edit

    Enter the repository and run aider README.md (or the file you actually want). Ask for one focused change, such as a single README line. Read the diff before you accept. To turn off auto-commit, use the switch in the official usage docs — do not scrape a key out of history later.

0
Extra IDE required
2
Common key variables
1
First prompt
python3 -m pip install aider-chat
# pipx install aider-chat
# uv tool install --python python3.12 aider-chat

export OPENAI_API_KEY=sk-...
# export ANTHROPIC_API_KEY=sk-ant-...

cd ~/code/your-repo
aider README.md
# Add a one-line note to the README that this repo uses Aider for local edits

What usually blocks a first run

MethodBillingBest for
OPENAI_API_KEYOpenAI Platform ratesGPT models on a local repo
ANTHROPIC_API_KEYAnthropic usage ratesClaude models on a local repo
Root .envSame key as aboveRepeat local sessions
It must already be a Git repo
Aider uses Git for context and commits. In an empty folder, git init and make at least one commit before the first session. Do not test against an unversioned directory.
Treat .env as a password
Do not commit it or paste it into tickets. If it already reached a remote, rotate the key in the vendor console — deleting the commit message is not enough.
Auto-commit can take whatever is dirty
Check the staged scope before you accept a diff. Keys, local overrides, and large generated files should already be ignored. If you want manual commits, disable auto-commit per the official docs.

Official reminder: API calls bill at the vendor’s rates. Use a cheaper, short-context model to learn the loop, then switch to the model you actually want to pay for.

When the diff needs a conversation

After the agent edits, teams often want one picture of what changed and why it can merge. No extra meeting suite. Open a short space on tidemeet or see how to create a space. Canvas basics: shared whiteboard. Another terminal-agent guide on this site: Codex CLI.

Questions

Do I have to install an IDE extension?

No. Aider is a standalone terminal program. A first repo edit only needs Python, Git, and a valid API key.

What is the difference between pip and uv?

Same package: aider-chat on PyPI. pip writes into the current interpreter; pipx and uv tool install an isolated command, which is better for a long-lived laptop install. Use whichever you already have.

Should the first edit be a large refactor?

No. Name the files, ask for one reviewable change, keep the tree clean, ignore secrets, and read the diff before you accept.

What does this have to do with a temporary meeting tool?

No product tie. If you only need to talk through a diff, temporary meeting tools says when a short browser space is enough.

Create a free space