diff --git a/gcode/cli.py b/gcode/cli.py index 1d1dc70..aa8e51b 100644 --- a/gcode/cli.py +++ b/gcode/cli.py @@ -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 Switch to a model (id, or #n index from /models)\n" " /ollama List/select local Ollama models\n" - " /pull Pull a model from Ollama registry\n" - " /setup Reconfigure API key\n" + " /pull 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." ) diff --git a/tests/test_cli.py b/tests/test_cli.py index 8312a22..b3bea29 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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