Skip to content

Commit

Permalink
docs: update readme to add how to use section
Browse files Browse the repository at this point in the history
  • Loading branch information
lee88688@163.com committed Nov 16, 2024
1 parent 19e4b1a commit 174fbff
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 19 deletions.
75 changes: 56 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,79 @@
# aider-composer

Aider Composer is a VSCode extension that allows you to integrate [Aider](https://github.com/Aider-AI/aider) into your development workflow. this extension is highly inspired by [cursor](https://www.cursor.com/) and [cline](https://github.com/cline/cline).
Aider Composer is a VSCode extension that integrates [Aider](https://github.com/Aider-AI/aider) into your development workflow. This extension is highly inspired by [cursor](https://www.cursor.com/) and [cline](https://github.com/cline/cline).

![demo](./resources/demo.gif)

It is very recommended to read [Requirements](#requirements) and [Extension Settings](#extension-settings) for startup config, otherwise the extension may not work correctly.
It is highly recommended to read the [Requirements](#requirements) and [Extension Settings](#extension-settings) sections for initial configuration, otherwise the extension may not work correctly.

## Features

- easily add and drop file, and toggle between read-only and editable modes with just a click.
- most of the chat mode is supported, including `ask` `diff` `diff-fenced` `udiff` `whole`, and you can easily switch between them.
- review code changes before applying them.
- HTTP Proxy is supported, use VSCode settings `http.proxy` to configure and don't support authentication.
- Easily add and remove files, and toggle between read-only and editable modes with just a click
- Most chat modes are supported, including `ask`, `diff`, `diff-fenced`, `udiff`, and `whole`, and you can easily switch between them
- Review code changes before applying them
- Chat history sessions are supported
- HTTP Proxy is supported (uses VSCode's `http.proxy` setting, authentication not supported)

### Note

because of some limitation or other issues, this extension may not implement all features in Aider, some are listed here:
Due to certain limitations and other issues, this extension may not implement all features available in Aider. Some limitations include:

- multiple workspaces are not supported
- git, extension will not use git repo features
- lint
- test
- voice
- in-chat commands are not usable
- configuration is not supported
- Multiple workspaces are not supported
- Git repository features are not used
- Linting is not supported
- Testing is not supported
- Voice features are not supported
- In-chat commands are not usable
- Configuration options are not supported

## Requirements

This extension use python package `aider-chat` and `flask` to provide background service, so you should install them first.
This extension uses the Python packages `aider-chat` and `flask` to provide background services. You need to:

- install Python. you can download from [python.org](https://www.python.org/) or any other ways.
- install `aider-chat` and `flask` package, use command `pip install aider-chat flask`
- Install Python (download from [python.org](https://www.python.org/) or use other methods). For Mac or Python venv installations, please refer to [this issue](https://github.com/lee88688/aider-composer/issues/2)
- Install the required packages using: `pip install aider-chat flask`

## Extension Settings

This extension contributes the following settings:
This extension contributes the following setting:

- `aider-composer.pythonPath`: Directory that includes the Python executable (not the Python executable path) and the `aider.chat`, `flask` package is installed. this is required before you can use this extension. if you not set this, extension will not be activated.
- `aider-composer.pythonPath`: The directory containing the Python executable (not the Python executable path itself) where `aider.chat` and `flask` packages are installed. This setting is required for the extension to activate.

## How To Use

### Chat Mode

Aider supports five chat modes: `ask`, `diff`, `diff-fenced`, `udiff`, and `whole`. In this extension, you can switch between them by clicking the mode name in the chat input area.

The chat modes are divided into two groups: `ask` and `code`.

- `ask` mode is for general questions and will not modify any files
- `code` mode includes all other chat modes and is used for code modifications. The optimal chat mode may vary depending on your LLM model and programming language. For more information, refer to [Aider's leaderboards](https://aider.chat/docs/leaderboards/).

#### Tips

- If the LLM outputs an incorrect diff format, code modifications may fail. Try switching to a different diff format
- The leaderboard is tested with Python code, so optimal modes may differ for other languages
- The `whole` mode may be the easiest for LLMs to understand but can consume more tokens

![chat-mode](./resources/chat-mode.gif)

### File Reference

In Aider, you can reference files in the chat, file reference can be readonly or editable. a readonly file can't be modified.

In this extension, file reference is above the chat input area, you can click the file name to toggle the reference mode. when reference is **highlighted border**, it means the file is **editable**. there is two ways to add a new file reference:

- click add button and add references, this references is readonly by default.
- use `@` to reference a file in chat input area, this file will be editable by default.

![file-reference](./resources/file-reference.gif)

### Confirm Modify

when Aider modify code, it will show you a diff editor, you can review the code changes and confirm to apply them by clicking the button `` at editor toolbar.

![confirm-modify](./resources/confirm-modify.png)

---

Expand Down
Binary file added resources/chat-mode.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/confirm-modify.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/file-reference.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 174fbff

Please sign in to comment.