Skip to the content.

aider is AI pair programming in your terminal

Aider is a command line tool that lets you pair program with GPT-3.5/GPT-4, to edit code stored in your local git repository. Aider will directly edit the code in your local source files, and git commit the changes with sensible commit messages. You can start a new project or work with an existing git repo. Aider is unique in that it lets you ask for changes to pre-existing, larger codebases.

aider screencast

Getting started

See the installation instructions for more details, but you can get started quickly like this:

$ pip install aider-chat
$ export OPENAI_API_KEY=your-key-goes-here
$ aider hello.js

Using git repo: .git
Added hello.js to the chat.

hello.js> write a js script that prints hello world

Example chat transcripts

Here are some example transcripts that show how you can chat with aider to write and edit code with GPT-4.

You can find more chat transcripts on the examples page.



Run the aider tool by executing the following command:

aider <file1> <file2> ...

If your pip install did not place the aider executable on your path, you can invoke aider like this:

python -m aider.main <file1> <file2>

Replace <file1>, <file2>, etc., with the paths to the source code files you want to work on. These files will be “added to the chat session”, so that GPT can see their contents and edit them according to your instructions.

You can also just launch aider anywhere in a git repo without naming files on the command line. It will discover all the files in the repo. You can then add and remove individual files in the chat session with the /add and /drop chat commands described below. If you or GPT mention one of the repo’s filenames in the conversation, aider will ask if you’d like to add it to the chat.

Think about the change you want to make and which files will need to be edited – add those files to the chat. Don’t add all the files in your repo to the chat. Be selective, and just add the files that GPT will need to edit. If you add a bunch of unrelated files, GPT can get overwhelmed and confused (and it costs more tokens). Aider will automatically share snippets from other, related files with GPT so it can understand the rest of your code base.

Aider also has many additional command-line options, environment variables or configuration file to set many options. See aider --help for details.

In-chat commands

Aider supports commands from within the chat, which all start with /. Here are some of the most useful in-chat commands:

See the full command docs for more information.



See the installation instructions.


For more information, see the FAQ.

Kind words from users