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. You can start a new project or work with an existing repo. Aider makes sure edits from GPT are committed to git with sensible commit messages. Aider is unique in that it lets you ask for changes to pre-existing, larger codebases.

aider screencast

New GPT-4 Turbo with 128k context window

Aider supports OpenAI’s new GPT-4 model that has the massive 128k context window. Early benchmark results indicate that it is very fast and a bit better at coding than previous GPT-4 models.

To use it, run aider like this:

aider --model gpt-4-1106-preview

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.

Features

Usage

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.

Aider will work best if you think about which files need to be edited to make your change and add them to the chat. Aider has some ability to help GPT figure out which files to edit all by itself, but the most effective approach is to explicitly add the needed files to the chat yourself.

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.

Tips

GPT-4 vs GPT-3.5

Aider supports all of OpenAI’s chat models. You can choose a model with the --model command line argument.

You should probably use GPT-4 if you can. For more details see the FAQ entry that compares GPT-4 vs GPT-3.5.

For a discussion of using other non-OpenAI models, see the FAQ about other LLMs.

Installation

See the installation instructions.

FAQ

For more information, see the FAQ.

Kind words from users