diff --git a/README.md b/README.md index 1ce123464..8fe46bc5e 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ 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: @@ -108,6 +109,8 @@ Aider supports commands from within the chat, which all start with `/`. Here are * `/run `: Run a shell command and optionally add the output to the chat. * `/help`: Show help about all commands. +See the [full command docs](https://aider.chat/docs/commands.html) for more information. + ## Tips diff --git a/docs/commands.md b/docs/commands.md new file mode 100644 index 000000000..4d4c4a8c2 --- /dev/null +++ b/docs/commands.md @@ -0,0 +1,37 @@ +# Commands + +- `/help `: Show help about all commands +- `/exit`: Exit the application + +## token/context management +- `/add `: Add matching files to the chat session using glob patterns +- `/drop `: Remove matching files from the chat session +- `/clear`: Clear the chat history +- `/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 +- `/run `: Run a shell command and optionally add the output to the chat + +## git +- `/undo`: Undo the last git commit if it was done by aider +- `/diff`: Display the diff of the last aider commit +- `/commit `: Commit edits to the repo made outside the chat (commit message optional) +- `/git `: Run a git command + +# Prompt Toolkit defaults + +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 + +- `Ctrl-A` : Move cursor to the start of the line. +- `Ctrl-B` : Move cursor back one character. +- `Ctrl-D` : Delete the character under the cursor. +- `Ctrl-E` : Move cursor to the end of the line. +- `Ctrl-F` : Move cursor forward one character. +- `Ctrl-K` : Delete from the cursor to the end of the line. +- `Ctrl-L` : Clear the screen. +- `Ctrl-N` : Move down to the next history entry. +- `Ctrl-P` : Move up to the previous history entry. +- `Ctrl-R` : Reverse search in command history. + +Note: aider currently exits vi normal mode after a single command, (maybe something to do with the esc keybinding?). Feel free to investigate and make a PR if you would like to see it fully supported. + +Prompt toolkit also does not provide clear documentation on the bindings they support - maybe you can take aider and help them out with that and we can then link to the authoritative docs.