feat(ux): improve /help formatting with command categories (#640)

- Organize COMMANDS into COMMANDS_BY_CATEGORY dict
- Group commands: Session, Configuration, Tools & Skills, Info, Exit
- Add visual category headers with spacing
- Maintain backwards compat via flat COMMANDS dict
- Better visual hierarchy and scannability

Before:
  /help           - Show this help message
  /tools          - List available tools
  ... (dense list)

After:
  ── Session ──
    /new           Start a new conversation
    /reset         Reset conversation only
    ...

  ── Configuration ──
    /config        Show current configuration
    ...

Closes #640
This commit is contained in:
Bartok Moltbot 2026-03-09 03:59:47 -04:00 committed by teknium1
parent 909e048ad4
commit 8eb9eed074
2 changed files with 48 additions and 38 deletions

14
cli.py
View file

@ -1942,12 +1942,16 @@ class HermesCLI:
) )
def show_help(self): def show_help(self):
"""Display help information.""" """Display help information with categorized commands."""
_cprint(f"\n{_BOLD}+{'-' * 50}+{_RST}") from hermes_cli.commands import COMMANDS_BY_CATEGORY
_cprint(f"{_BOLD}|{' ' * 14}(^_^)? Available Commands{' ' * 10}|{_RST}")
_cprint(f"{_BOLD}+{'-' * 50}+{_RST}\n")
for cmd, desc in COMMANDS.items(): _cprint(f"\n{_BOLD}+{'-' * 55}+{_RST}")
_cprint(f"{_BOLD}|{' ' * 14}(^_^)? Available Commands{' ' * 15}|{_RST}")
_cprint(f"{_BOLD}+{'-' * 55}+{_RST}")
for category, commands in COMMANDS_BY_CATEGORY.items():
_cprint(f"\n {_BOLD}── {category} ──{_RST}")
for cmd, desc in commands.items():
_cprint(f" {_GOLD}{cmd:<15}{_RST} {_DIM}-{_RST} {desc}") _cprint(f" {_GOLD}{cmd:<15}{_RST} {_DIM}-{_RST} {desc}")
if _skill_commands: if _skill_commands:

View file

@ -13,37 +13,43 @@ from typing import Any
from prompt_toolkit.completion import Completer, Completion from prompt_toolkit.completion import Completer, Completion
COMMANDS = { # Commands organized by category for better help display
"/help": "Show this help message", COMMANDS_BY_CATEGORY = {
"/tools": "List available tools", "Session": {
"/toolsets": "List available toolsets",
"/model": "Show or change the current model",
"/provider": "Show available providers and current provider",
"/prompt": "View/set custom system prompt",
"/personality": "Set a predefined personality",
"/clear": "Clear screen and reset conversation (fresh start)",
"/history": "Show conversation history",
"/new": "Start a new conversation (reset history)", "/new": "Start a new conversation (reset history)",
"/reset": "Reset conversation only (keep screen)", "/reset": "Reset conversation only (keep screen)",
"/clear": "Clear screen and reset conversation (fresh start)",
"/history": "Show conversation history",
"/save": "Save the current conversation",
"/retry": "Retry the last message (resend to agent)", "/retry": "Retry the last message (resend to agent)",
"/undo": "Remove the last user/assistant exchange", "/undo": "Remove the last user/assistant exchange",
"/save": "Save the current conversation", },
"Configuration": {
"/config": "Show current configuration", "/config": "Show current configuration",
"/model": "Show or change the current model",
"/prompt": "View/set custom system prompt",
"/personality": "Set a predefined personality",
},
"Tools & Skills": {
"/tools": "List available tools",
"/toolsets": "List available toolsets",
"/skills": "Search, install, inspect, or manage skills",
"/cron": "Manage scheduled tasks (list, add, remove)", "/cron": "Manage scheduled tasks (list, add, remove)",
"/skills": "Search, install, inspect, or manage skills from online registries", },
"Info": {
"/help": "Show this help message",
"/platforms": "Show gateway/messaging platform status", "/platforms": "Show gateway/messaging platform status",
"/verbose": "Cycle tool progress display: off → new → all → verbose", },
"/compress": "Manually compress conversation context (flush memories + summarize)", "Exit": {
"/title": "Set a title for the current session (usage: /title My Session Name)",
"/usage": "Show token usage for the current session",
"/insights": "Show usage insights and analytics (last 30 days)",
"/paste": "Check clipboard for an image and attach it",
"/reload-mcp": "Reload MCP servers from config.yaml",
"/rollback": "List or restore filesystem checkpoints (usage: /rollback [number])",
"/skin": "Show or change the display skin/theme",
"/quit": "Exit the CLI (also: /exit, /q)", "/quit": "Exit the CLI (also: /exit, /q)",
},
} }
# Flat dict for backwards compatibility and autocomplete
COMMANDS = {}
for category_commands in COMMANDS_BY_CATEGORY.values():
COMMANDS.update(category_commands)
class SlashCommandCompleter(Completer): class SlashCommandCompleter(Completer):
"""Autocomplete for built-in slash commands and optional skill commands.""" """Autocomplete for built-in slash commands and optional skill commands."""