How to Start Pair Programming in Aider from the Terminal
Aider is a command-line pair programmer that edits files directly in your git repo. You run it inside a project, it reads the files you add to the chat, proposes a diff, and commits changes to git so every step is revertable.
No IDE plugin, no browser tab. If you like git log as an undo stack, this is the workflow for you.
How do you install Aider?
With pipx, because Aider is a CLI tool you want isolated from your project environments:
pipx install aider-chat
On macOS, brew install pipx first. On Windows, WSL is the path of least resistance — native Windows works but file watching on large repos is slower.
Verify with aider --version. You want a build from the last few months; the project ships release notes almost weekly and older versions lack the repo-map improvements that make large repos usable.
How do you connect a model?
Aider talks to most providers. Set a key, then start it:
- OpenAI:
export OPENAI_API_KEY=...thenaider - Anthropic:
export ANTHROPIC_API_KEY=...thenaider --model claude-sonnet-4 - Local via Ollama: install Ollama,
ollama pull qwen2.5-coder, thenaider --model ollama/qwen2.5-coder
The first run in an empty project asks for a model and a config file location. Aider writes .aider.conf.yml and .aider.model.settings.yml. Keep those in your home directory, not in the repo, or you will commit your preferences and confuse teammates.
Add .aider* to your global gitignore.
How do you add files without blowing the context window?
Use /add for files you want edited and let the repo map do the rest.
/add src/api/routes.py
Aider builds a repo map — a condensed tree of functions and class signatures — and attaches it to every request. That map is why it can work in a 300-file project without you listing every file. It costs tokens though. On very large repos, set --map-tokens lower, or the map can eat 20% of a 200k window.
Commands worth memorising:
/add— include files in chat/drop— remove files/diff— show the last change before it is committed/undo— revert the last commit Aider made/tokens— print current token usage
Read /diff before you let a multi-file change stand. Aider commits automatically by default, but the commit is a normal git commit; /undo is a reset, and it is safe.
What does a first session look like?
Start small and specific. Open the repo, run aider src/parser.py, then ask: “Add a function that parses ISO 8601 duration strings and returns seconds, with unit tests in tests/test_parser.py.”
Aider proposes a diff, shows it, and commits with a message like feat: add ISO 8601 duration parser. Then you read the diff. If it is wrong, /undo and restate the request with the constraint you missed.
The habit that separates people who like Aider from people who abandon it: never let it run three changes deep without reading one. The diffs are cheap to read and expensive to untangle later.
You can also pipe in a whole task non-interactively with --message, which suits scripts and CI. aider --message "fix the failing test in test_parser.py" --yes runs once and exits.
Where does Aider fall short?
It has no GUI. There is no visual diff side-by-side, no click-to-accept hunk. In an IDE that feels like a step back.
It also assumes git. If your project is not a repo, initialise one — but be aware that in a monorepo with a huge history, the repo map generation on startup can take ten seconds or more.
And unlike Cursor or Copilot, Aider does not autocomplete while you type. It is a conversation you open deliberately, not a ghost in your editor. If you want inline suggestions, this is the wrong tool.
Quick Summary
- Install with
pipx install aider-chat; run it inside a git repo. - Add files with
/add; the repo map supplies context for everything else. - Every change becomes a git commit and
/undoreverts it. - Set
--map-tokenslower on large repos to protect your context window. - Best for terminal-first developers; there is no GUI or inline autocomplete.
