Skip to content

Commit

Permalink
broke out instructions, added link to neovim #84
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Gauthier committed Jul 11, 2023
1 parent 7e17059 commit ceb84b2
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 43 deletions.
3 changes: 2 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

### Next release

- Added `--dark-mode` to select colors suitable for a dark terminal background
- Added `--dark-mode` and `--light-mode` to select colors optimized for screen background
- Reorganized the `--help` output
- Bugfix/improvement to whole edit format, may improve coding editing for GPT-3.5
- Bugfix and tests around git filenames with unicode characters
- Bugfix so that aider throws an exception when OpenAI returns InvalidRequest
- Bugfix/improvement to /add and /drop to recurse selected directories
Expand Down
22 changes: 5 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ It also has features that [help GPT-4 understand and modify larger codebases](ht

## Getting started

See the
[installation instructions](https://aider.chat/docs/install.html)
for more details, but you can
get started quickly like this:

```
$ pip install aider-chat
$ export OPENAI_API_KEY=your-key-goes-here
Expand Down Expand Up @@ -57,23 +62,6 @@ You can find more chat transcripts on the [examples page](https://aider.chat/exa
* You can also edit files by hand using your editor while chatting with aider. Aider will notice these out-of-band edits and ask if you'd like to commit them. This lets you bounce back and forth between the aider chat and your editor, to collaboratively code with GPT.


## Installation

1. Install the package with pip:
* PyPI: `python -m pip install aider-chat`
* GitHub: `python -m pip install git+https://github.com/paul-gauthier/aider.git`
* Local clone: `python -m pip install -e .`

2. Set up your OpenAI API key:
* As an environment variable:
* `export OPENAI_API_KEY=sk-...` on Linux or Mac
* `setx OPENAI_API_KEY sk-...` in Windows PowerShell
* Or include `openai-api-key: sk-...` in an `.aider.conf.yml` file in your home directory or at the root of your git repo, alongside the `.git` dir.

3. Make sure you have git installed.

4. Optionally, install [universal ctags](https://github.com/universal-ctags/ctags). This is helpful if you plan to use aider and GPT-4 with repositories that have more than a handful of files. This allows aider to build a [map of your entire git repo](https://aider.chat/docs/ctags.html) and share it with GPT to help it better understand and modify large codebases. See the [FAQ entry about ctags](https://aider.chat/docs/faq.html#how-do-i-get-ctags-working) for more info.

## Usage

Run the `aider` tool by executing the following command:
Expand Down
26 changes: 1 addition & 25 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and their variants.

It seems to require model-specific tuning to get prompts and
editing formats working well with a new model. For example, GPT-3.5 and GPT-4 use very
different prompts and editing formats in aider right now.
different prompts and editing formats in aider right now.
Adopting new LLMs will probably require a similar effort to tailor the
prompting and edit formats.

Expand Down Expand Up @@ -46,27 +46,3 @@ might be useful background.
User [imabutahersiddik](https://github.com/imabutahersiddik)
has provided this
[Colab notebook](https://colab.research.google.com/drive/1J9XynhrCqekPL5PR6olHP6eE--rnnjS9?usp=sharing).


## How do I get ctags working?

First, be aware that ctags is completely optional and not required to use aider.
Aider only attempts to use ctags with GPT-4,
and currently doesn't use ctags with GPT-3.5.

If you wish to use ctags, you should consult the
[universal ctags repo](https://github.com/universal-ctags/ctags)
for official instructions on how to install it in your environment.
You may be able to install a compatible version using these commands:

* Mac: `brew install universal-ctags`
* Windows: `choco install universal-ctags`
* Ubuntu: `sudo apt-get install universal-ctags`

Some things to be aware of:

* The `ctags` command needs to be on your shell path so that it will run by default when aider invokes `ctags ...`.
* You need a build which includes the json feature. You can check by running `ctags --version` and looking for `+json` in the `Optional compiled features` list.



82 changes: 82 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

# Installing aider

## Install the `aider-chat` package with pip from one of these sources:

* PyPI hosts the released and most stable version:
* `python -m pip install aider-chat`
* GitHub hosts the latest version, which is under active development:
* `python -m pip install git+https://github.com/paul-gauthier/aider.git`
* If you've git cloned the aider repository already, you can install "live" from your local copy. This is mostly useful if you are developing aider and want your current modifications to take effect immediately.
* `python -m pip install -e .`

On Windows, you may need to run `py -m pip install ...` to install python packages.

## Provide your OpenAI API key

You need a
[paid API key from OpenAI](https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key)
to use aider. Note that this is different than "ChatGPT Plus".

You can place your api key in an environment variable:

* `export OPENAI_API_KEY=sk-...` on Linux or Mac
* `setx OPENAI_API_KEY sk-...` in Windows PowerShell

Or you can create a `.aider.conf.yml` file in your home directory or at the root of your git repo,
alongside the `.git` dir. Put a line in it like this to specify your api key:

```
openai-api-key: sk-...
```

Finally, you could also just provide your key as a command line argument:

```
aider --openai-api-key sk-...
```

## Install git

Make sure you have git installed and available on your shell path.
Here are
[instructions for installing git in various environments](https://github.com/git-guides/install-git).

## Install universal ctags (optional)

Aider does not require ctags, and will operate just fine without it.

Installing ctags is helpful if you plan to use aider and GPT-4 with repositories
that have more than a handful of files.
This allows aider to build a
[map of your entire git repo](https://aider.chat/docs/ctags.html)
and share it with GPT to help it better understand and modify large codebases.

Aider only attempts to use ctags with GPT-4,
and currently doesn't use ctags at all with GPT-3.5.
So if your OpenAI API key doesn't support GPT-4, then you don't need ctags.

You should consult the
[universal ctags repo](https://github.com/universal-ctags/ctags)
for official instructions on how to install it in your environment.
But you may be able to install a compatible version using these commands:

* Mac: `brew install universal-ctags`
* Windows: `choco install universal-ctags`
* Ubuntu: `sudo apt-get install universal-ctags`

Some things to be aware of:

* The `ctags` command needs to be on your shell path so that it will run by default when aider invokes `ctags ...`.
* You need a build which includes the json feature. You can check by running `ctags --version` and looking for `+json` in the `Optional compiled features` list.


## Add aider to your editor

(joshuavial)[https://github.com/joshuavial) has provided a NeoVim plugin for aider:

* https://github.com/joshuavial/aider.nvim

If you are interested in creating an aider plugin for your favorite editor,
please let me know by opening a
[GitHub issue](https://github.com/paul-gauthier/aider/issues).

0 comments on commit ceb84b2

Please sign in to comment.