better in chat commands table

This commit is contained in:
Paul Gauthier 2024-07-05 13:38:06 -03:00
parent 2a506d4d15
commit 9ab36b565d
3 changed files with 31 additions and 23 deletions

View file

@ -680,17 +680,21 @@ class Commands:
def get_help_md(self): def get_help_md(self):
"Show help about all commands in markdown" "Show help about all commands in markdown"
res = "" res = """
|Command|Description|
|:------|:----------|
"""
commands = sorted(self.get_commands()) commands = sorted(self.get_commands())
for cmd in commands: for cmd in commands:
cmd_method_name = f"cmd_{cmd[1:]}" cmd_method_name = f"cmd_{cmd[1:]}"
cmd_method = getattr(self, cmd_method_name, None) cmd_method = getattr(self, cmd_method_name, None)
if cmd_method: if cmd_method:
description = cmd_method.__doc__ description = cmd_method.__doc__
res += f"- **{cmd}** {description}\n" res += f"| **{cmd}** | {description} |\n"
else: else:
res += f"- **{cmd}**\n" res += f"| **{cmd}** | |\n"
res += "\n"
return res return res
def cmd_voice(self, args): def cmd_voice(self, args):

View file

@ -11,25 +11,29 @@ Aider supports commands from within the chat, which all start with `/`.
from aider.commands import get_help_md from aider.commands import get_help_md
cog.out(get_help_md()) cog.out(get_help_md())
]]]--> ]]]-->
- **/add** Add files to the chat so GPT can edit them or review them in detail
- **/clear** Clear the chat history |Command|Description|
- **/commit** Commit edits to the repo made outside the chat (commit message optional) |:------|:----------|
- **/diff** Display the diff of the last aider commit | **/add** | Add files to the chat so GPT can edit them or review them in detail |
- **/drop** Remove files from the chat session to free up context space | **/clear** | Clear the chat history |
- **/exit** Exit the application | **/commit** | Commit edits to the repo made outside the chat (commit message optional) |
- **/git** Run a git command | **/diff** | Display the diff of the last aider commit |
- **/help** Ask questions about aider | **/drop** | Remove files from the chat session to free up context space |
- **/lint** Lint and fix provided files or in-chat files if none provided | **/exit** | Exit the application |
- **/ls** List all known files and indicate which are included in the chat session | **/git** | Run a git command |
- **/model** Switch to a new LLM | **/help** | Ask questions about aider |
- **/models** Search the list of available models | **/lint** | Lint and fix provided files or in-chat files if none provided |
- **/quit** Exit the application | **/ls** | List all known files and indicate which are included in the chat session |
- **/run** Run a shell command and optionally add the output to the chat (alias: !) | **/model** | Switch to a new LLM |
- **/test** Run a shell command and add the output to the chat on non-zero exit code | **/models** | Search the list of available models |
- **/tokens** Report on the number of tokens used by the current chat context | **/quit** | Exit the application |
- **/undo** Undo the last git commit if it was done by aider | **/run** | Run a shell command and optionally add the output to the chat (alias: !) |
- **/voice** Record and transcribe voice input | **/test** | Run a shell command and add the output to the chat on non-zero exit code |
- **/web** Use headless selenium to scrape a webpage and add the content to the chat | **/tokens** | Report on the number of tokens used by the current chat context |
| **/undo** | Undo the last git commit if it was done by aider |
| **/voice** | Record and transcribe voice input |
| **/web** | Use headless selenium to scrape a webpage and add the content to the chat |
<!--[[[end]]]--> <!--[[[end]]]-->
# Entering multi-line chat messages # Entering multi-line chat messages

View file

@ -30,7 +30,7 @@ Git repo: .git with 258 files
Repo-map: using 1024 tokens Repo-map: using 1024 tokens
Use /help to see in-chat commands, run with --help to see cmd line args Use /help to see in-chat commands, run with --help to see cmd line args
─────────────────────────────────────────────────────────────────────── ───────────────────────────────────────────────────────────────────────
>`Make a program that asks for a number and prints its factorial > Make a program that asks for a number and prints its factorial
... ...
``` ```