Skip to content

fix: wire and harden plugin CLI command registration#13643

Closed
attmous wants to merge 1 commit into
NousResearch:mainfrom
attmous:fix/plugin-cli-command-registration
Closed

fix: wire and harden plugin CLI command registration#13643
attmous wants to merge 1 commit into
NousResearch:mainfrom
attmous:fix/plugin-cli-command-registration

Conversation

@attmous

@attmous attmous commented Apr 21, 2026

Copy link
Copy Markdown

Summary

  • wire general plugin CLI commands into argparse via lazy plugin discovery
  • harden plugin CLI registration with name normalization and duplicate/collision checks
  • add regression coverage for lazy discovery, argparse wiring, and collision handling

Testing

  • python -m pytest tests/hermes_cli/test_plugins.py tests/hermes_cli/test_plugin_cli_registration.py -q
  • python -m py_compile hermes_cli/plugins.py hermes_cli/main.py tests/hermes_cli/test_plugin_cli_registration.py

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins labels Apr 21, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Overlaps with #9141 which also wires general plugin commands into main parser. May need reconciliation.

@attmous attmous force-pushed the fix/plugin-cli-command-registration branch from 13e9e41 to 308bbf6 Compare April 21, 2026 23:01
@attmous

attmous commented Apr 21, 2026

Copy link
Copy Markdown
Author

@alt-glitch I appreciate you consider this issue. Right now from main there is no way to register the general plugins CLI commands. I followed the docs here but never worked for me.
https://hermes-agent.nousresearch.com/docs/guides/build-a-hermes-plugin#register-cli-commands

@syahidfrd

Copy link
Copy Markdown

+1, reproducing this on latest main (commit b7ad3f478). Worth flagging that this gap got more visible after #16364 (the bundled google_meet plugin) merged on 2026-04-27 — that plugin uses register_cli_command() to expose hermes meet ... and ships with a README + SKILL.md documenting the CLI surface, but none of it is reachable end-to-end:

hermes plugins enable google_meet
hermes plugins list
# → google_meet: status=enabled, source=bundled
hermes meet install
# → hermes: error: argument command: invalid choice: 'meet'
#   (choose from 'chat', 'model', ..., 'dashboard', 'logs')

So a bundled plugin currently ships with its user-facing CLI dead on arrival, which I think bumps this above pure "plugin system internals" territory. Agent-facing tools (meet_join, meet_status, etc.) work fine because register_tool() is wired correctly in main.py — it's specifically register_cli_command() that has writers (hermes_cli/plugins.py:314) but no readers in hermes_cli/main.py. Repo-wide grep confirms: only discover_plugin_cli_commands() from plugins.memory ever feeds the top-level subparsers.

For anyone landing here looking for a workaround while this PR settles: plugins/google_meet/cli.py has its own __main__ block, so python -m plugins.google_meet.cli <subcommand> works as a drop-in for hermes meet <subcommand>. Same args, same handlers.

Re: reconciliation with #9141 — happy to help if it's the thing keeping this stalled. I can rebase against current main, run the test suite on Ubuntu 22.04, and post a clean diff if that's useful. Just let me know which approach to converge on (this PR's normalization + collision checks vs. #9141's leaner skip-on-conflict).

@teknium1

Copy link
Copy Markdown
Contributor

Closing as already fixed on main.

Triage notes (medium confidence):
origin/main hermes_cli/main.py:12511-12542 already does lazy plugin CLI discovery via _plugin_cli_discovery_needed(), wires subparsers, and tracks seen_plugin_commands to avoid collisions; register_cli_command exists in hermes_cli/plugins.py:387.

If you still see this on the latest version, please reopen with reproduction steps.

(Bulk-closed during a CLI triage sweep.)

@teknium1 teknium1 closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants