Summary
The plugin context (ctx) has no register_command() method, but it's referenced in tests and expected by plugins that want to provide slash commands.
tests/hermes_cli/test_plugins.py:608 has:
# NOTE: TestPluginCommands removed – register_command() was never implemented
Use Case
Context engine plugins (and other plugins) need a way to register slash commands for diagnostics and management. For example, hermes-lcm registers /lcm for status, health checks, and backup — but it silently falls back because the API doesn't exist:
register_command = getattr(ctx, "register_command", None)
if callable(register_command):
register_command(
"lcm",
lambda raw_args: handle_lcm_command(raw_args, engine),
description="LCM status and diagnostics",
)
Proposed API
ctx.register_command(
name: str, # command name (e.g. "lcm")
handler: Callable, # fn(raw_args: str) -> str
description: str, # shown in /help
)
This follows the same pattern as ctx.register_context_engine() and ctx.register_tool() — extend the plugin context with a new registration method, wire it into the CLI/TUI command dispatcher.
Context
- hermes-lcm has a working
/lcm command implementation (command.py) with full test coverage, ready to go once this API lands
- lossless-claw has a similar
/lossless command surface in OpenClaw
Summary
The plugin context (
ctx) has noregister_command()method, but it's referenced in tests and expected by plugins that want to provide slash commands.tests/hermes_cli/test_plugins.py:608has:Use Case
Context engine plugins (and other plugins) need a way to register slash commands for diagnostics and management. For example, hermes-lcm registers
/lcmfor status, health checks, and backup — but it silently falls back because the API doesn't exist:Proposed API
This follows the same pattern as
ctx.register_context_engine()andctx.register_tool()— extend the plugin context with a new registration method, wire it into the CLI/TUI command dispatcher.Context
/lcmcommand implementation (command.py) with full test coverage, ready to go once this API lands/losslesscommand surface in OpenClaw