Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions gcode/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,23 @@

def _print_help(ui: RichUI) -> None:
ui.info(
"GCode slash commands:\n"
"[bold]GCode slash commands:[/bold]\n\n"
"[bold cyan]General[/bold cyan]\n"
" /help Show this help\n"
" /version Show the installed GCode version\n"
" /quit, /exit Leave GCode\n\n"
"[bold cyan]Model[/bold cyan]\n"
" /models List available models (OpenRouter + Ollama)\n"
" /model <id|#n> Switch to a model (id, or #n index from /models)\n"
" /ollama List/select local Ollama models\n"
" /pull <model> Pull a model from Ollama registry\n"
" /setup Reconfigure API key\n"
" /pull <model> Pull a model from Ollama registry\n\n"
"[bold cyan]Session[/bold cyan]\n"
" /history Show recent conversation turns\n"
" /status Show quick git status\n"
" /diff Show staged and unstaged git changes\n"
" /clear Start a fresh session (discard history)\n"
" /quit, /exit Leave GCode\n"
" /setup Reconfigure API key\n\n"
"[bold cyan]Git[/bold cyan]\n"
" /status Show quick git status\n"
" /diff Show staged and unstaged git changes\n\n"
"Any other input is sent to the agent."
)

Expand Down
15 changes: 15 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,18 @@ def test_help_lists_version_command():
help_text = ui.info.call_args.args[0]
assert "/version" in help_text
assert "installed GCode version" in help_text


def test_help_has_categorized_groups():
ui = Mock()
_print_help(ui)

help_text = ui.info.call_args.args[0]
assert "General" in help_text
assert "Model" in help_text
assert "Session" in help_text
assert "Git" in help_text
assert "/help" in help_text
assert "/models" in help_text
assert "/history" in help_text
assert "/diff" in help_text