aider is AI pair programming in your terminal https://aider.chat/
Find a file
Paul Gauthier 1b785226ca aider: Add index.html and update _config.yml to include it in the build process.
# Aider chat conversation:

USER: $ bash scripts/build.sh
[+] Building 18.1s (9/9) FINISHED
 => [internal] load .dockerignore                                                                                0.0s
 => => transferring context: 109B                                                                                0.0s
 => [internal] load build definition from Dockerfile                                                             0.0s
 => => transferring dockerfile: 617B                                                                             0.0s
 => [internal] load metadata for docker.io/jekyll/jekyll:latest                                                  0.7s
 => [1/4] FROM docker.io/jekyll/jekyll:latest@sha256:400b8d1569f118bca8a3a09a25f32803b00a55d1ea241feaf5f904d66c  0.0s
 => [internal] load build context                                                                                1.8s
 => => transferring context: 136.35MB                                                                            1.7s
 => CACHED [2/4] WORKDIR /srv/jekyll                                                                             0.0s
 => [3/4] COPY . /srv/jekyll                                                                                     1.4s
 => [4/4] RUN bundle install                                                                                    12.5s
 => exporting to image                                                                                           1.6s
 => => exporting layers                                                                                          1.6s
 => => writing image sha256:55db5bb1b0ed74ef6c0bb45fa9992e2a3e39d49acad386872d945c01827ad941                     0.0s
 => => naming to docker.io/library/my-jekyll-site                                                                0.0s
(aider) macbook:Projects/aider$ bash scripts/run.sh
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux-musl]
  Logging at level: debug
    Jekyll Version: 4.2.2
Configuration file: /srv/jekyll/_config.yml
  Logging at level: debug
    Jekyll Version: 4.2.2
             Theme: jekyll-theme-cayman
      Theme source: /usr/gem/gems/jekyll-theme-cayman-0.2.0
         Requiring: jekyll-seo-tag
         Requiring: jekyll-redirect-from
         Requiring: jekyll-sitemap
            Source: /srv/jekyll
       Destination: /srv/jekyll/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
           Reading: /_layouts/default.html
           Reading: /_layouts/redirect.html
       EntryFilter: excluded /.git
       EntryFilter: excluded /.github
       EntryFilter: excluded /.gitignore
       EntryFilter: excluded /.gitignore~
       EntryFilter: excluded /.jekyll-cache
       EntryFilter: excluded /Gemfile
       EntryFilter: excluded /Gemfile.lock
       EntryFilter: excluded /tmp.benchmarks
           Reading: _posts/2023-05-25-ctags.md
           Reading: _posts/2023-07-02-benchmarks.md
           Reading: _posts/2023-10-22-repomap.md
           Reading: _posts/2023-11-06-benchmarks-1106.md
           Reading: _posts/2023-11-06-benchmarks-speed-1106.md
           Reading: _posts/2023-12-21-unified-diffs.md
           Reading: _posts/2024-01-25-benchmarks-0125.md
           Reading: _posts/2024-03-08-claude-3.md
           Reading: _posts/2024-04-09-gpt-4-turbo.md
           Reading: _posts/2024-05-02-browser.md
           Reading: _posts/2024-05-13-models-over-time.md
           Reading: assets/css/style.scss
           Reading: blog/index.html
           Reading: docs/leaderboards/index.md
           Reading: docs/benchmarks-0125.md
           Reading: docs/benchmarks-1106.md
           Reading: docs/benchmarks-speed-1106.md
           Reading: docs/benchmarks.md
           Reading: docs/ctags.md
           Reading: docs/repomap.md
           Reading: docs/unified-diffs.md
           Reading: _data/edit_leaderboard.yml
           Reading: _data/refactor_leaderboard.yml
           Reading: _data/tmp.edit_leaderboard.csv
           Reading: _data/tmp.refactor_leaderboard.csv
           Reading: assets/css/style.scss
             Theme: Ignoring assets/css/style.scss in theme due to existing file with that path in site.
        Generating: JekyllRedirectFrom::Generator finished in 0.004285741 seconds.
        Generating: Jekyll::JekyllSitemap finished in 0.056970491 seconds.
         Rendering: _posts/2023-05-25-ctags.md
  Pre-Render Hooks: _posts/2023-05-25-ctags.md
  Rendering Markup: _posts/2023-05-25-ctags.md
Post-Convert Hooks: _posts/2023-05-25-ctags.md
  Rendering Layout: _posts/2023-05-25-ctags.md
         Rendering: _posts/2023-07-02-benchmarks.md
  Pre-Render Hooks: _posts/2023-07-02-benchmarks.md
  Rendering Markup: _posts/2023-07-02-benchmarks.md
Post-Convert Hooks: _posts/2023-07-02-benchmarks.md
  Rendering Layout: _posts/2023-07-02-benchmarks.md
         Rendering: _posts/2023-10-22-repomap.md
  Pre-Render Hooks: _posts/2023-10-22-repomap.md
  Rendering Markup: _posts/2023-10-22-repomap.md
Post-Convert Hooks: _posts/2023-10-22-repomap.md
  Rendering Layout: _posts/2023-10-22-repomap.md
         Rendering: _posts/2023-11-06-benchmarks-1106.md
  Pre-Render Hooks: _posts/2023-11-06-benchmarks-1106.md
  Rendering Markup: _posts/2023-11-06-benchmarks-1106.md
Post-Convert Hooks: _posts/2023-11-06-benchmarks-1106.md
  Rendering Layout: _posts/2023-11-06-benchmarks-1106.md
         Rendering: _posts/2023-11-06-benchmarks-speed-1106.md
  Pre-Render Hooks: _posts/2023-11-06-benchmarks-speed-1106.md
  Rendering Liquid: _posts/2023-11-06-benchmarks-speed-1106.md
  Rendering Markup: _posts/2023-11-06-benchmarks-speed-1106.md
Post-Convert Hooks: _posts/2023-11-06-benchmarks-speed-1106.md
  Rendering Layout: _posts/2023-11-06-benchmarks-speed-1106.md
         Rendering: _posts/2023-12-21-unified-diffs.md
  Pre-Render Hooks: _posts/2023-12-21-unified-diffs.md
  Rendering Markup: _posts/2023-12-21-unified-diffs.md
Post-Convert Hooks: _posts/2023-12-21-unified-diffs.md
  Rendering Layout: _posts/2023-12-21-unified-diffs.md
         Rendering: _posts/2024-01-25-benchmarks-0125.md
  Pre-Render Hooks: _posts/2024-01-25-benchmarks-0125.md
  Rendering Markup: _posts/2024-01-25-benchmarks-0125.md
Post-Convert Hooks: _posts/2024-01-25-benchmarks-0125.md
  Rendering Layout: _posts/2024-01-25-benchmarks-0125.md
         Rendering: _posts/2024-03-08-claude-3.md
  Pre-Render Hooks: _posts/2024-03-08-claude-3.md
  Rendering Markup: _posts/2024-03-08-claude-3.md
Post-Convert Hooks: _posts/2024-03-08-claude-3.md
  Rendering Layout: _posts/2024-03-08-claude-3.md
         Rendering: _posts/2024-04-09-gpt-4-turbo.md
  Pre-Render Hooks: _posts/2024-04-09-gpt-4-turbo.md
  Rendering Markup: _posts/2024-04-09-gpt-4-turbo.md
Post-Convert Hooks: _posts/2024-04-09-gpt-4-turbo.md
  Rendering Layout: _posts/2024-04-09-gpt-4-turbo.md
         Rendering: _posts/2024-05-02-browser.md
  Pre-Render Hooks: _posts/2024-05-02-browser.md
  Rendering Markup: _posts/2024-05-02-browser.md
Post-Convert Hooks: _posts/2024-05-02-browser.md
  Rendering Layout: _posts/2024-05-02-browser.md
         Rendering: _posts/2024-05-13-models-over-time.md
  Pre-Render Hooks: _posts/2024-05-13-models-over-time.md
  Rendering Liquid: _posts/2024-05-13-models-over-time.md
  Rendering Markup: _posts/2024-05-13-models-over-time.md
Post-Convert Hooks: _posts/2024-05-13-models-over-time.md
  Rendering Layout: _posts/2024-05-13-models-over-time.md
         Rendering: docs/benchmarks-0125.md
  Pre-Render Hooks: docs/benchmarks-0125.md
  Rendering Markup: docs/benchmarks-0125.md
Post-Convert Hooks: docs/benchmarks-0125.md
  Rendering Layout: docs/benchmarks-0125.md
         Rendering: docs/benchmarks-1106.md
  Pre-Render Hooks: docs/benchmarks-1106.md
  Rendering Markup: docs/benchmarks-1106.md
Post-Convert Hooks: docs/benchmarks-1106.md
  Rendering Layout: docs/benchmarks-1106.md
         Rendering: docs/benchmarks-speed-1106.md
  Pre-Render Hooks: docs/benchmarks-speed-1106.md
  Rendering Liquid: docs/benchmarks-speed-1106.md
  Rendering Markup: docs/benchmarks-speed-1106.md
Post-Convert Hooks: docs/benchmarks-speed-1106.md
  Rendering Layout: docs/benchmarks-speed-1106.md
         Rendering: docs/benchmarks.md
  Pre-Render Hooks: docs/benchmarks.md
  Rendering Markup: docs/benchmarks.md
Post-Convert Hooks: docs/benchmarks.md
  Rendering Layout: docs/benchmarks.md
         Rendering: docs/ctags.md
  Pre-Render Hooks: docs/ctags.md
  Rendering Markup: docs/ctags.md
Post-Convert Hooks: docs/ctags.md
  Rendering Layout: docs/ctags.md
         Rendering: blog/index.html
  Pre-Render Hooks: blog/index.html
  Rendering Liquid: blog/index.html
  Rendering Markup: blog/index.html
Post-Convert Hooks: blog/index.html
  Rendering Layout: blog/index.html
         Rendering: docs/leaderboards/index.md
  Pre-Render Hooks: docs/leaderboards/index.md
  Rendering Liquid: docs/leaderboards/index.md
  Rendering Markup: docs/leaderboards/index.md
Post-Convert Hooks: docs/leaderboards/index.md
  Rendering Layout: docs/leaderboards/index.md
         Rendering: docs/repomap.md
  Pre-Render Hooks: docs/repomap.md
  Rendering Markup: docs/repomap.md
Post-Convert Hooks: docs/repomap.md
  Rendering Layout: docs/repomap.md
         Rendering: assets/css/style.scss
  Pre-Render Hooks: assets/css/style.scss
  Rendering Liquid: assets/css/style.scss
  Rendering Markup: assets/css/style.scss
Post-Convert Hooks: assets/css/style.scss
         Rendering: docs/unified-diffs.md
  Pre-Render Hooks: docs/unified-diffs.md
  Rendering Markup: docs/unified-diffs.md
Post-Convert Hooks: docs/unified-diffs.md
  Rendering Layout: docs/unified-diffs.md
         Rendering: redirects.json
  Pre-Render Hooks: redirects.json
  Rendering Markup: redirects.json
Post-Convert Hooks: redirects.json
  Rendering Layout: redirects.json
         Rendering: sitemap.xml
  Pre-Render Hooks: sitemap.xml
  Rendering Liquid: sitemap.xml
  Rendering Markup: sitemap.xml
Post-Convert Hooks: sitemap.xml
  Rendering Layout: sitemap.xml
         Rendering: robots.txt
  Pre-Render Hooks: robots.txt
  Rendering Liquid: robots.txt
  Rendering Markup: robots.txt
Post-Convert Hooks: robots.txt
  Rendering Layout: robots.txt
         Rendering: assets/css/style.css.map
  Pre-Render Hooks: assets/css/style.css.map
  Rendering Markup: assets/css/style.css.map
Post-Convert Hooks: assets/css/style.css.map
           Writing: /srv/jekyll/_site/docs/benchmarks-0125.html
           Writing: /srv/jekyll/_site/docs/benchmarks-1106.html
           Writing: /srv/jekyll/_site/docs/benchmarks-speed-1106.html
           Writing: /srv/jekyll/_site/docs/benchmarks.html
           Writing: /srv/jekyll/_site/docs/ctags.html
           Writing: /srv/jekyll/_site/blog/index.html
           Writing: /srv/jekyll/_site/docs/leaderboards/index.html
           Writing: /srv/jekyll/_site/docs/repomap.html
           Writing: /srv/jekyll/_site/assets/css/style.css
           Writing: /srv/jekyll/_site/docs/unified-diffs.html
           Writing: /srv/jekyll/_site/redirects.json
           Writing: /srv/jekyll/_site/sitemap.xml
           Writing: /srv/jekyll/_site/robots.txt
           Writing: /srv/jekyll/_site/assets/css/style.css.map

ASSISTANT: The logs indicate that the Jekyll site has been generated successfully, but the server is still returning an empty reply. This suggests that the server is running but not serving the content correctly.

Let's add a simple index.html file to the root of your project to ensure that there is content to serve. This will help us determine if the issue is with the content or the server configuration.

Create a new file `index.html` with the following content:

index.html
```html
<!DOCTYPE html>
<html>
<head>
    <title>My Jekyll Site</title>
</head>
<body>
    <h1>Welcome to My Jekyll Site</h1>
    <p>This is a test page to ensure the server is working correctly.</p>
</body>
</html>
```

Next, update the `_config.yml` to ensure that the `index.html` file is not excluded:

_config.yml
```yaml
<<<<<<< SEARCH
exclude:
  - tmp.benchmarks
  - .git
  - .github
  - node_modules
  - vendor
=======
exclude:
  - tmp.benchmarks
  - .git
  - .github
  - node_modules
  - vendor
  - Gemfile
  - Gemfile.lock
  - scripts
>>>>>>> REPLACE
```

After making these changes, rebuild the Docker image and run the container again:

```sh
bash scripts/build.sh
bash scripts/run.sh
```

Then try accessing `http://localhost:4000` again. If you still encounter issues, please let me know!
2024-05-15 10:22:18 -07:00
.github copy 2024-04-29 12:56:41 -07:00
_data added release dates 2024-05-15 09:44:18 -07:00
_layouts twitter image 2024-05-09 11:19:25 -07:00
_posts aider: Added scatter plot of edit_leaderboard models with released dates in _posts/2024-05-13-models-over-time.md. 2024-05-15 09:32:41 -07:00
aider switch naming from openai/gpt-4o to gpt-4o 2024-05-15 06:25:30 -07:00
assets make all highlight_images jpg 2024-05-09 09:50:05 -07:00
benchmark load .env in benchmark.py 2024-05-07 13:32:19 -07:00
blog adjusted blog layout 2024-05-02 18:03:01 -07:00
docker Put build-essential back into dockerfile 2023-10-31 14:52:04 -07:00
docs docs and --4-turbo updates 2024-05-13 11:24:52 -07:00
examples copy 2023-07-13 11:14:17 -07:00
scripts aider: Update _config.yml and Dockerfile for verbose logging and correct file exclusions. 2024-05-15 10:20:16 -07:00
share aider: The JavaScript code now adds the mdurl as an href on the <a> tag. 2023-08-14 14:40:47 -03:00
tests fixed tests 2024-05-09 14:35:57 -07:00
.dockerignore prep docker build to run in github action 2023-10-18 08:45:02 -07:00
.flake8 debug 2023-05-08 22:55:55 -07:00
.gitignore fixed regex in .gitignore 2024-04-17 13:31:49 -07:00
.pre-commit-config.yaml do isort first 2023-05-30 13:55:28 -07:00
_config.yml aider: Add index.html and update _config.yml to include it in the build process. 2024-05-15 10:22:18 -07:00
CNAME Create CNAME 2023-05-15 12:54:06 -07:00
CONTRIBUTING.md Added CONTRIBUTING.md 2024-04-17 12:56:26 -07:00
dev-requirements.in added pre-commit to dev-reqs 2023-12-06 14:11:32 -08:00
dev-requirements.txt upgraded dependencies 2024-05-01 10:46:20 -07:00
Gemfile aider: Add missing dependencies by updating the Gemfile to include 'jekyll-sitemap'. 2024-05-15 10:03:22 -07:00
HISTORY.md Updated HISTORY 2024-05-13 11:17:41 -07:00
LICENSE.txt Added Apache 2.0 license 2023-05-15 08:29:00 -07:00
MANIFEST.in wip 2023-06-08 12:44:41 -07:00
pytest.ini fixed test_repo 2024-04-18 14:55:56 -07:00
README.md docs and --4-turbo updates 2024-05-13 11:24:52 -07:00
requirements.in added streamlit dep 2024-04-28 14:17:55 -07:00
requirements.txt bumped deps 2024-05-08 07:07:55 -07:00
setup.py added 3.12 to pypi classifiers 2024-01-05 14:50:37 -08:00

aider is AI pair programming in your terminal

Aider is a command line tool that lets you pair program with LLMs, 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 works well with GPT 3.5, GPT-4o, GPT-4 Turbo with Vision, and Claude 3 Opus. It also supports connecting to almost any LLM.

aider screencast

Getting started

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

$ pip install aider-chat

# To work with GPT-4o
$ export OPENAI_API_KEY=your-key-goes-here
$ aider 

# To work with Claude 3 Opus:
$ export ANTHROPIC_API_KEY=your-key-goes-here
$ aider --opus

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

  • Chat with aider about your code by launching aider from the command line with set of source files to discuss and edit together. Aider lets the LLM see and edit the content of those files.
  • Aider can write and edit code in most popular languages: python, javascript, typescript, php, html, css, etc.
  • Aider works well with GPT 3.5, GPT-4o, GPT-4 Turbo with Vision, and Claude 3 Opus. It also supports connecting to almost any LLM.
  • Request new features, changes, improvements, or bug fixes to your code. Ask for new test cases, updated documentation or code refactors.
  • Aider will apply the edits suggested by the LLM directly to your source files.
  • Aider will automatically commit each changeset to your local git repo with a descriptive commit message. These frequent, automatic commits provide a safety net. It's easy to undo changes or use standard git workflows to manage longer sequences of changes.
  • You can use aider with multiple source files at once, so aider can make coordinated code changes across all of them in a single changeset/commit.
  • Aider can give the LLM a map of your entire git repo, which helps it understand and modify large codebases.
  • You can also edit files by hand using your editor while chatting with aider. Aider will notice these out-of-band edits and keep up to date with the latest versions of your files. This lets you bounce back and forth between the aider chat and your editor, to collaboratively code with an LLM.
  • If you are using gpt-4 through openai directly, you can add image files to your context which will automatically switch you to the gpt-4-vision-preview model

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 the LLM 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 the LLM 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 the LLM will need to edit. If you add a bunch of unrelated files, the LLM can get overwhelmed and confused (and it costs more tokens). Aider will automatically share snippets from other, related files with the LLM 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:

  • /add <file>: Add matching files to the chat session.
  • /drop <file>: Remove matching files from the chat session.
  • /undo: Undo the last git commit if it was done by aider.
  • /diff: Display the diff of the last aider commit.
  • /run <command>: Run a shell command and optionally add the output to the chat.
  • /voice: Speak to aider to request code changes with your voice.
  • /help: Show help about all commands.

See the full command docs for more information.

Tips

  • Think about which files need to be edited to make your change and add them to the chat. Aider has some ability to help the LLM 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.
  • Large changes are best performed as a sequence of thoughtful bite sized steps, where you plan out the approach and overall design. Walk the LLM through changes like you might with a junior dev. Ask for a refactor to prepare, then ask for the actual change. Spend the time to ask for code quality/structure improvements.
  • Use Control-C to safely interrupt the LLM if it isn't providing a useful response. The partial response remains in the conversation, so you can refer to it when you reply to the LLM with more information or direction.
  • Use the /run command to run tests, linters, etc and show the output to the LLM so it can fix any issues.
  • Use Meta-ENTER (Esc+ENTER in some environments) to enter multiline chat messages. Or enter { alone on the first line to start a multiline message and } alone on the last line to end it.
  • If your code is throwing an error, share the error output with the LLM using /run or by pasting it into the chat. Let the LLM figure out and fix the bug.
  • LLMs know about a lot of standard tools and libraries, but may get some of the fine details wrong about APIs and function arguments. You can paste doc snippets into the chat to resolve these issues.
  • The LLM can only see the content of the files you specifically "add to the chat". Aider also sends a map of your entire git repo. So the LLM may ask to see additional files if it feels that's needed for your requests.
  • I also shared some general LLM coding tips on Hacker News.

Installation

See the installation instructions.

FAQ

For more information, see the FAQ.

Kind words from users

  • The best AI coding assistant so far. -- Matthew Berman
  • Hands down, this is the best AI coding assistant tool so far. -- IndyDevDan
  • Aider ... has easily quadrupled my coding productivity. -- SOLAR_FIELDS
  • It's a cool workflow... Aider's ergonomics are perfect for me. -- qup
  • It's really like having your senior developer live right in your Git repo - truly amazing! -- rappster
  • What an amazing tool. It's incredible. -- valyagolev
  • Aider is such an astounding thing! -- cgrothaus
  • It was WAY faster than I would be getting off the ground and making the first few working versions. -- Daniel Feldman
  • THANK YOU for Aider! It really feels like a glimpse into the future of coding. -- derwiki
  • It's just amazing. It is freeing me to do things I felt were out my comfort zone before. -- Dougie
  • This project is stellar. -- funkytaco
  • Amazing project, definitely the best AI coding assistant I've used. -- joshuavial
  • I absolutely love using Aider ... It makes software development feel so much lighter as an experience. -- principalideal0
  • I have been recovering from multiple shoulder surgeries ... and have used aider extensively. It has allowed me to continue productivity. -- codeninja
  • I am an aider addict. I'm getting so much more work done, but in less time. -- dandandan
  • After wasting $100 on tokens trying to find something better, I'm back to Aider. It blows everything else out of the water hands down, there's no competition whatsoever. -- SystemSculpt
  • Best agent for actual dev work in existing codebases. -- Nick Dobos