Adapted content for just the docs

This commit is contained in:
Paul Gauthier 2024-06-05 12:29:32 -07:00
parent 1787bf4b5b
commit 8c77cf63fd
34 changed files with 185 additions and 119 deletions

View file

@ -1,3 +1,6 @@
---
nav_order: 999
---
# Release history

102
README.md
View file

@ -1,5 +1,9 @@
---
title: Home
nav_order: 10
---
# aider is AI pair programming in your terminal
# 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.
@ -21,22 +25,6 @@ and supports [connecting to almost any LLM](https://aider.chat/docs/llms.html).
</a>
</p>
- [Getting started](#getting-started)
- [Features](#features)
- [Usage](#usage)
- [Tutorial videos](https://aider.chat/docs/install.html#tutorial-videos)
- [In-chat commands](#in-chat-commands)
- [Tips](#tips)
- [Installation](https://aider.chat/docs/install.html)
- [Connecting to LLMs](https://aider.chat/docs/llms.html)
- [LLM Leaderboards](https://aider.chat/docs/leaderboards/)
- [Voice-to-code](https://aider.chat/docs/voice.html)
- [Example chat transcripts](https://aider.chat/examples/)
- [FAQ](https://aider.chat/docs/faq.html)
- [Discord](https://discord.gg/Tv2uQnR88V)
- [Blog](https://aider.chat/blog/)
## Getting started
See the
@ -60,85 +48,29 @@ $ aider --opus
## Features
* Chat with aider about your code by running `aider <file1> <file2> ...` 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 can write and edit code in most every popular languages: python, javascript, typescript, php, html, css, and more...
* Aider works well with GPT-4o, Claude 3 Opus, GPT-3.5 and supports [connecting to almost any LLM](https://aider.chat/docs/llms.html).
* 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](https://aider.chat/docs/faq.html#how-does-aider-use-git) 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](https://aider.chat/docs/repomap.html), which helps it understand and modify large codebases.
* Aider [gives the LLM a map of your entire git repo](https://aider.chat/docs/repomap.html), 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.
* You can add images files to your chat if you are working with a vision capable OpenAI model (GPT-4o, GPT-4 Turbo, etc).
* You can add URLs to the chat and aider will scrape their content and share it with the LLM.
## Usage
## Documentation
Run `aider` with the source code files you want to edit.
These files will be "added to the chat session", so that the LLM can see their
contents and edit them according to your instructions.
- [Installation](https://aider.chat/docs/install.html)
- [Usage](https://aider.chat/docs/usage.html)
- [Tutorial videos](https://aider.chat/docs/tutorials.html)
- [Connecting to LLMs](https://aider.chat/docs/llms.html)
- [LLM Leaderboards](https://aider.chat/docs/leaderboards/)
- [FAQ](https://aider.chat/docs/faq.html)
- [Discord](https://discord.gg/Tv2uQnR88V)
- [Blog](https://aider.chat/blog/)
```
aider <file1> <file2> ...
```
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](https://aider.chat/docs/repomap.html).
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 any of the repo's filenames in the conversation,
aider will ask if you'd like to add them to the chat.
Aider also has many other options which can be set with
command line switches, environment variables or via a configuration file.
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, including image files.
* `/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](https://aider.chat/docs/voice.html).
* `/help`: Show help about all commands.
See the [full command docs](https://aider.chat/docs/commands.html) for more information.
## Tips
* Think about which files need to be edited to make your change and add them to the chat.
Aider can help the LLM figure out which files to edit all by itself, but the most efficient approach is to 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](https://aider.chat/docs/repomap.html). So the LLM may ask to see additional files if it feels that's needed for your requests.
## Example chat transcripts
[The example transcripts page](https://aider.chat/examples/) shows how you can chat with aider to write
and edit code.
## Installation
See the [installation instructions](https://aider.chat/docs/install.html).
## FAQ
For more information, see the [FAQ](https://aider.chat/docs/faq.html).
## Kind words from users

View file

@ -35,4 +35,11 @@ aux_links:
- "https://github.com/paul-gauthier/aider"
"Discord":
- "https://discord.gg/Tv2uQnR88V"
"Blog":
- "/blog"
nav_external_links:
- title: "GitHub"
url: "https://github.com/paul-gauthier/aider"
- title: "Discord"
url: "https://discord.gg/Tv2uQnR88V"

View file

@ -2,6 +2,7 @@
title: Claude 3 beats GPT-4 on Aider's code editing benchmark
excerpt: Claude 3 Opus outperforms all of OpenAI's models on Aider's code editing benchmark, making it the best available model for pair programming with AI.
highlight_image: /assets/2024-03-07-claude-3.jpg
nav_exclude: true
---
# Claude 3 beats GPT-4 on Aider's code editing benchmark

View file

@ -2,6 +2,7 @@
title: GPT-4 Turbo with Vision is a step backwards for coding
excerpt: OpenAI's GPT-4 Turbo with Vision model scores worse on aider's code editing benchmarks than all the previous GPT-4 models. In particular, it seems much more prone to "lazy coding" than the existing GPT-4 Turbo "preview" models.
highlight_image: /assets/2024-04-09-gpt-4-turbo-laziness.jpg
nav_exclude: true
---
# GPT-4 Turbo with Vision is a step backwards for coding

View file

@ -2,6 +2,7 @@
title: Aider in your browser
excerpt: Aider has an experimental browser UI, allowing you to collaborate with LLMs on code in your local git repo.
highlight_image: /assets/browser.jpg
nav_order: 800
---
# Aider in your browser

View file

@ -2,6 +2,7 @@
title: Drawing graphs with aider, GPT-4o and matplotlib
excerpt: Use GPT-4o to draw graphs with matplotlib, including adjusting styles and making visual changes. You get the graph, but you also get the code in your repo.
highlight_image: /assets/models-over-time.png
nav_exclude: true
---
![LLM coding skill over time](/assets/models-over-time.svg)

View file

@ -3,6 +3,7 @@ title: A draft post.
excerpt: With a draft summary.
highlight_image: /assets/linting.jpg
draft: true
nav_exclude: true
---
# A draft post

View file

@ -2,6 +2,7 @@
title: Linting code for LLMs with tree-sitter
excerpt: Aider now lints code after every LLM edit and automatically fixes errors, using tree-sitter and AST-aware code context.
highlight_image: /assets/linting.jpg
nav_exclude: true
---
[![Linting code](/assets/linting.jpg)](https://aider.chat/assets/linting.jpg)

View file

@ -2,6 +2,7 @@
title: How aider scored SOTA 26.3% on SWE Bench Lite
excerpt: Aider achieved this result mainly through its existing features that focus on static code analysis, reliable LLM code editing, and pragmatic UX for AI pair programming.
highlight_image: /assets/swe_bench_lite.jpg
nav_exclude: true
---
# How aider scored SOTA 26.3% on SWE Bench Lite

View file

@ -2,6 +2,7 @@
title: Aider has written 7% of its own code
excerpt: Aider has written 7% of its own code, via 600+ commits that inserted 4.8K and deleted 1.5K lines of code.
highlight_image: /assets/self-assembly.jpg
nav_exclude: true
---
# Aider has written 7% of its own code

View file

@ -2,6 +2,7 @@
title: Aider is SOTA for both SWE Bench and SWE Bench Lite
excerpt: Aider sets SOTA for the main SWE Bench, after recently setting SOTA for the Lite version.
highlight_image: /assets/swe_bench.jpg
nav_exclude: true
---
# Aider is SOTA for both SWE Bench and SWE Bench Lite

View file

@ -1,5 +1,7 @@
---
layout: default
title: Blog
nav_order: 1000
---
<div class="posts">

View file

@ -2,6 +2,7 @@
title: The January GPT-4 Turbo is lazier than the last version
excerpt: The new `gpt-4-0125-preview` model is quantiatively lazier at coding than previous GPT-4 versions, according to a new "laziness" benchmark.
highlight_image: /assets/benchmarks-0125.jpg
nav_exclude: true
---
# The January GPT-4 Turbo is lazier than the last version

View file

@ -2,6 +2,7 @@
title: Code editing benchmarks for OpenAI's "1106" models
excerpt: A quantitative comparison of the code editing capabilities of the new GPT-3.5 and GPT-4 versions that were released in Nov 2023.
highlight_image: /assets/benchmarks-1106.jpg
nav_exclude: true
---
# Code editing benchmarks for OpenAI's "1106" models

View file

@ -3,6 +3,7 @@ title: Speed benchmarks of GPT-4 Turbo and gpt-3.5-turbo-1106
excerpt: This report provides a detailed comparison of the speed of GPT-4 Turbo and gpt-3.5-turbo-1106 models based on the aider benchmarking suite.
canonical_url: https://aider.chat/2023/11/06/benchmarks-speed-1106.html
highlight_image: /assets/benchmarks-speed-1106.jpg
nav_exclude: true
---
# Speed benchmarks of GPT-4 Turbo and gpt-3.5-turbo-1106

View file

@ -2,6 +2,7 @@
title: GPT code editing benchmarks
excerpt: Benchmarking GPT-3.5 and GPT-4 code editing skill using a new code editing benchmark suite based on the Exercism python exercises.
highlight_image: /assets/benchmarks.jpg
nav_exclude: true
---
# GPT code editing benchmarks

1
docs/browser.md Symbolic link
View file

@ -0,0 +1 @@
../_posts/2024-05-02-browser.md

View file

@ -1,9 +1,19 @@
# Commands
---
nav_order: 50
---
# In-chat commands
## In-chat commands
Aider supports commands from within the chat, which all start with `/`.
Here are some of the most useful in-chat commands:
- `/help`: Show help about all commands
- `/exit`: Exit the application
## context management
## Context management
- `/add <file>`: Add matching files to the chat session using glob patterns
- `/drop <file>`: Remove matching files from the chat session
- `/web <url>`: Add the contents of a webpage to the chat
@ -11,18 +21,20 @@
- `/ls`: List all known files and those included in the chat session
- `/tokens`: Report on the number of tokens used by the current chat context
## git
## Git
- `/undo`: Undo the last git commit if it was done by aider
- `/diff`: Display the diff of the last aider commit
- `/commit <message>`: Commit edits to the repo made outside the chat (commit message optional)
- `/git <command>`: Run a git command
## other
## Other
- `/run <command>`: Run a shell command and optionally add the output to the chat, or use `!<command>`.
- `/test <command>`: Like run, but automatically adds the output to the chat on non-zero exit codes.
- `/voice`: Speak to aider to [request code changes with your voice](https://aider.chat/docs/voice.html).
# Prompt Toolkit defaults
# Keybindings
The interactive prompt is built with [prompt-toolkit](https://github.com/prompt-toolkit/python-prompt-toolkit) which provides a lot of Emacs and Vi-style keyboard. Some emacs bindings you may find useful are

View file

@ -1,3 +1,6 @@
---
nav_order: 100
---
# Specifying coding conventions
Sometimes you want GPT to be aware of certain coding guidelines,

View file

@ -2,6 +2,7 @@
title: Improving GPT-4's codebase understanding with ctags
excerpt: Using ctags to build a "repository map" to increase GPT-4's ability to understand a large code base.
highlight_image: /assets/robot-flowchart.png
nav_exclude: true
---
# Improving GPT-4's codebase understanding with ctags

View file

@ -1,5 +1,8 @@
---
nav_order: 100
---
# Run aider with docker (experimental)
# Run aider with docker
You can run aider via docker without doing any local installation, like this:

View file

@ -1,17 +1,12 @@
---
nav_order: 60
---
# Frequently asked questions
{: .no_toc }
- [How does aider use git?](#how-does-aider-use-git)
- [Can I use aider with other LLMs, local LLMs, etc?](https://aider.chat/docs/llms.html)
- [Can I run aider in Google Colab?](#can-i-run-aider-in-google-colab)
- [How can I run aider locally from source code?](#how-can-i-run-aider-locally-from-source-code)
- [Can I script aider?](#can-i-script-aider)
- [What code languages does aider support?](#what-code-languages-does-aider-support)
- [How to use pipx to avoid python package conflicts?](#how-to-use-pipx-to-avoid-python-package-conflicts)
- [Aider isn't editing my files?](#aider-isnt-editing-my-files)
- [How can I add ALL the files to the chat?](#how-can-i-add-all-the-files-to-the-chat)
- [Can I specify guidelines or conventions?](#can-i-specify-guidelines-or-conventions)
- [Can I change the system prompts that aider uses?](#can-i-change-the-system-prompts-that-aider-uses)
- TOC
{:toc}
## How does aider use git?
@ -63,7 +58,7 @@ pip install -r requirements.txt
python -m aider.main
```
# Can I script aider?
## Can I script aider?
You can script aider via the command line or python.

View file

@ -1,12 +1,29 @@
---
title: Installation
nav_order: 20
---
# Installing aider
{: .no_toc }
- [Install git](#install-git)
- [Get your API key](#get-your-api-key)
- [Windows install](#windows-install)
- [Mac/Linux install](#maclinux-install)
- [Working with other LLMs](https://aider.chat/docs/llms.html)
- [Tutorial videos](#tutorial-videos)
- TOC
{:toc}
## Quick start
```
$ 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
```
Or read on for more detailed installation instructions.
## Install git
@ -53,17 +70,9 @@ $ aider --anthropic-api-key sk-xxx... --opus
Aider works well with GPT-4o, Claude 3 Opus, GPT-3.5 and supports [connecting to almost any LLM](https://aider.chat/docs/llms.html).
## Tutorial videos
Here are a few tutorial videos:
- [Aider : the production ready AI coding assistant you've been waiting for](https://www.youtube.com/watch?v=zddJofosJuM) -- Learn Code With JV
- [Holy Grail: FREE Coding Assistant That Can Build From EXISTING CODE BASE](https://www.youtube.com/watch?v=df8afeb1FY8) -- Matthew Berman
- [Aider: This AI Coder Can Create AND Update Git Codebases](https://www.youtube.com/watch?v=EqLyFT78Sig) -- Ian Wootten
## You are done!
See the [usage instructions](/#usage) to start coding with aider.
See the [usage instructions](https://aider.chat/docs/usage.html) to start coding with aider.
---
@ -78,6 +87,7 @@ The steps below are completely optional.
- [Install development versions of aider](#install-development-versions-of-aider-optional)
## Store your api key (optional)
{: .no_toc }
You can place your api key in an environment variable:
@ -92,6 +102,7 @@ openai-api-key: sk-...
```
## Enable Playwright (optional)
{: .no_toc }
Aider supports adding web pages to the chat with the `/web <url>` command.
When you add a url to the chat, aider fetches the page and scrapes its
@ -116,6 +127,7 @@ for additional information.
## Enable voice coding (optional)
{: .no_toc }
Aider supports [coding with your voice](https://aider.chat/docs/voice.html)
using the in-chat `/voice` command.
@ -128,6 +140,7 @@ Installing PortAudio is completely optional, but can usually be accomplished lik
- For Linux, do `sudo apt-get install libportaudio2`
## Add aider to your editor (optional)
{: .no_toc }
Other projects have integrated aider into some IDE/editors.
It's not clear if they are tracking the latest
@ -136,12 +149,14 @@ so it may be best to just run the latest
aider in a terminal alongside your editor.
### NeoVim
{: .no_toc }
[joshuavial](https://github.com/joshuavial) provided a NeoVim plugin for aider:
[https://github.com/joshuavial/aider.nvim](https://github.com/joshuavial/aider.nvim)
### VS Code
{: .no_toc }
joshuavial also confirmed that aider works inside a VS Code terminal window.
Aider detects if it is running inside VSCode and turns off pretty/color output,
@ -152,6 +167,7 @@ since the VSCode terminal doesn't seem to support it well.
[https://marketplace.visualstudio.com/items?itemName=MattFlower.aider](https://marketplace.visualstudio.com/items?itemName=MattFlower.aider)
### Other editors
{: .no_toc }
If you are interested in creating an aider plugin for your favorite editor,
please let me know by opening a
@ -159,6 +175,7 @@ please let me know by opening a
## Install development versions of aider (optional)
{: .no_toc }
If you want to install the very latest development version of aider:

View file

@ -1,5 +1,6 @@
---
highlight_image: /assets/leaderboard.jpg
nav_order: 900
---
# Aider LLM Leaderboards

View file

@ -1,3 +1,7 @@
---
title: Connecting to LLMs
nav_order: 70
---
# Aider can connect to most LLMs

View file

@ -2,6 +2,7 @@
title: Building a better repository map with tree sitter
excerpt: Tree-sitter allows aider to build a repo map that better summarizes large code bases.
highlight_image: /assets/robot-ast.png
nav_exclude: true
---
# Building a better repository map with tree sitter

18
docs/tips.md Normal file
View file

@ -0,0 +1,18 @@
---
nav_order: 50
---
## Tips
* Think about which files need to be edited to make your change and add them to the chat.
Aider can help the LLM figure out which files to edit all by itself, but the most efficient approach is to add the needed files to the chat yourself.
* Don't add *everything* to the chat, just the files you think need to be edited.
Aider also sends the LLM a [map of your entire git repo](https://aider.chat/docs/repomap.html).
So the LLM can see all the other relevant parts of your code base.
* 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` and `/test` commands to run the code or tests 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.

13
docs/tutorials.md Normal file
View file

@ -0,0 +1,13 @@
---
nav_order: 25
---
## Tutorial videos
Here are a few tutorial videos made by aider users:
- [Aider : the production ready AI coding assistant you've been waiting for](https://www.youtube.com/watch?v=zddJofosJuM) -- Learn Code With JV
- [Holy Grail: FREE Coding Assistant That Can Build From EXISTING CODE BASE](https://www.youtube.com/watch?v=df8afeb1FY8) -- Matthew Berman
- [Aider: This AI Coder Can Create AND Update Git Codebases](https://www.youtube.com/watch?v=EqLyFT78Sig) -- Ian Wootten

View file

@ -2,6 +2,7 @@
title: Unified diffs make GPT-4 Turbo 3X less lazy
excerpt: GPT-4 Turbo has a problem with lazy coding, which can be signiciantly improved by asking for code changes formatted as unified diffs.
highlight_image: /assets/benchmarks-udiff.jpg
nav_exclude: true
---
# Unified diffs make GPT-4 Turbo 3X less lazy

31
docs/usage.md Normal file
View file

@ -0,0 +1,31 @@
---
nav_order: 30
---
## Usage
Run `aider` with the source code files you want to edit.
These files will be "added to the chat session", so that the LLM can see their
contents and edit them according to your instructions.
```
aider <file1> <file2> ...
```
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](https://aider.chat/docs/repomap.html).
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 any of the repo's filenames in the conversation,
aider will ask if you'd like to add them to the chat.
Aider also has many other options which can be set with
command line switches, environment variables or via a configuration file.
See `aider --help` for details.

View file

@ -1,3 +1,6 @@
---
nav_order: 100
---
# Voice-to-code with aider

View file

@ -1,6 +1,8 @@
---
title: Example chat transcripts
has_children: true
nav_order: 80
has_toc: false
---
# Example chat transcripts

View file

@ -1,3 +1,6 @@
---
nav_exclude: true
---
# Shared aider chat transcript