diff --git a/cli.py b/cli.py index 347250e398..db956766b4 100644 --- a/cli.py +++ b/cli.py @@ -4008,59 +4008,7 @@ class HermesCLI: print(" To change model or provider, use: hermes model") - def _handle_prompt_command(self, cmd: str): - """Handle the /prompt command to view or set system prompt.""" - parts = cmd.split(maxsplit=1) - - if len(parts) > 1: - # Set new prompt - new_prompt = parts[1].strip() - - if new_prompt.lower() == "clear": - self.system_prompt = "" - self.agent = None # Force re-init - if save_config_value("agent.system_prompt", ""): - print("(^_^)b System prompt cleared (saved to config)") - else: - print("(^_^) System prompt cleared (session only)") - else: - self.system_prompt = new_prompt - self.agent = None # Force re-init - if save_config_value("agent.system_prompt", new_prompt): - print("(^_^)b System prompt set (saved to config)") - else: - print("(^_^) System prompt set (session only)") - print(f" \"{new_prompt[:60]}{'...' if len(new_prompt) > 60 else ''}\"") - else: - # Show current prompt - print() - print("+" + "-" * 50 + "+") - print("|" + " " * 15 + "(^_^) System Prompt" + " " * 15 + "|") - print("+" + "-" * 50 + "+") - print() - if self.system_prompt: - # Word wrap the prompt for display - words = self.system_prompt.split() - lines = [] - current_line = "" - for word in words: - if len(current_line) + len(word) + 1 <= 50: - current_line += (" " if current_line else "") + word - else: - lines.append(current_line) - current_line = word - if current_line: - lines.append(current_line) - for line in lines: - print(f" {line}") - else: - print(" (no custom prompt set - using default)") - print() - print(" Usage:") - print(" /prompt - Set a custom system prompt") - print(" /prompt clear - Remove custom prompt") - print(" /personality - Use a predefined personality") - print() + @staticmethod @@ -4560,9 +4508,7 @@ class HermesCLI: self._handle_model_switch(cmd_original) elif canonical == "provider": self._show_model_and_providers() - elif canonical == "prompt": - # Use original case so prompt text isn't lowercased - self._handle_prompt_command(cmd_original) + elif canonical == "personality": # Use original case (handler lowercases the personality name itself) self._handle_personality_command(cmd_original) diff --git a/hermes_cli/commands.py b/hermes_cli/commands.py index 70d9cb8aa3..ac0f44d749 100644 --- a/hermes_cli/commands.py +++ b/hermes_cli/commands.py @@ -87,8 +87,7 @@ COMMAND_REGISTRY: list[CommandDef] = [ CommandDef("model", "Switch model for this session", "Configuration", args_hint="[model] [--global]"), CommandDef("provider", "Show available providers and current provider", "Configuration"), - CommandDef("prompt", "View/set custom system prompt", "Configuration", - cli_only=True, args_hint="[text]", subcommands=("clear",)), + CommandDef("personality", "Set a predefined personality", "Configuration", args_hint="[name]"), CommandDef("statusbar", "Toggle the context/model status bar", "Configuration", diff --git a/skills/autonomous-ai-agents/hermes-agent/SKILL.md b/skills/autonomous-ai-agents/hermes-agent/SKILL.md index 8d93e3fb79..74445c267e 100644 --- a/skills/autonomous-ai-agents/hermes-agent/SKILL.md +++ b/skills/autonomous-ai-agents/hermes-agent/SKILL.md @@ -249,7 +249,6 @@ Type these during an interactive chat session. /config Show config (CLI) /model [name] Show or change model /provider Show provider info -/prompt [text] View/set system prompt (CLI) /personality [name] Set personality /reasoning [level] Set reasoning (none|low|medium|high|xhigh|show|hide) /verbose Cycle: off → new → all → verbose diff --git a/tests/hermes_cli/test_commands.py b/tests/hermes_cli/test_commands.py index 81c262a840..98a4b2efc2 100644 --- a/tests/hermes_cli/test_commands.py +++ b/tests/hermes_cli/test_commands.py @@ -425,8 +425,8 @@ class TestSlashCommandCompleter: class TestSubcommands: def test_explicit_subcommands_extracted(self): """Commands with explicit subcommands on CommandDef are extracted.""" - assert "/prompt" in SUBCOMMANDS - assert "clear" in SUBCOMMANDS["/prompt"] + assert "/skills" in SUBCOMMANDS + assert "install" in SUBCOMMANDS["/skills"] def test_reasoning_has_subcommands(self): assert "/reasoning" in SUBCOMMANDS diff --git a/website/docs/reference/slash-commands.md b/website/docs/reference/slash-commands.md index 89a30c46b6..a695d8dc12 100644 --- a/website/docs/reference/slash-commands.md +++ b/website/docs/reference/slash-commands.md @@ -46,7 +46,6 @@ Type `/` in the CLI to open the autocomplete menu. Built-in commands are case-in | `/config` | Show current configuration | | `/model [model-name]` | Show or change the current model. Supports: `/model claude-sonnet-4`, `/model provider:model` (switch providers), `/model custom:model` (custom endpoint), `/model custom:name:model` (named custom provider), `/model custom` (auto-detect from endpoint) | | `/provider` | Show available providers and current provider | -| `/prompt` | View/set custom system prompt | | `/personality` | Set a predefined personality | | `/verbose` | Cycle tool progress display: off → new → all → verbose. Can be [enabled for messaging](#notes) via config. | | `/reasoning` | Manage reasoning effort and display (usage: /reasoning [level\|show\|hide]) | @@ -144,7 +143,7 @@ The messaging gateway supports the following built-in commands inside Telegram, ## Notes -- `/skin`, `/tools`, `/toolsets`, `/browser`, `/config`, `/prompt`, `/cron`, `/skills`, `/platforms`, `/paste`, `/statusbar`, and `/plugins` are **CLI-only** commands. +- `/skin`, `/tools`, `/toolsets`, `/browser`, `/config`, `/cron`, `/skills`, `/platforms`, `/paste`, `/statusbar`, and `/plugins` are **CLI-only** commands. - `/verbose` is **CLI-only by default**, but can be enabled for messaging platforms by setting `display.tool_progress_command: true` in `config.yaml`. When enabled, it cycles the `display.tool_progress` mode and saves to config. - `/status`, `/sethome`, `/update`, `/approve`, `/deny`, and `/commands` are **messaging-only** commands. - `/background`, `/voice`, `/reload-mcp`, `/rollback`, and `/yolo` work in **both** the CLI and the messaging gateway.