feat: register terminal CLI commands declaratively - #14
Merged
Conversation
Plugin authors need a convention-correct way to expose terminal subcommands without overloading in-session slash command behavior. Preserve slash registration as the default while routing explicit CLI declarations through Hermes' native argparse registration contract.
Main added canonical plugin registration receipts after this branch was cut. Preserve that single receipt path while extending its inventory with terminal CLI commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Plugin authors can now declare true terminal subcommands with
@command(type="cli")while the existing decorator remains a backward-compatibleslash command by default. This lets plugins use Hermes' native argparse
registration contract instead of treating terminal commands as in-session
command strings.
The command type is explicit in decorator metadata and registration summaries.
Slash and CLI namespaces can intentionally share a name, while duplicates
within either namespace still fail before partial registration. CLI handlers
must be synchronous, parser setup must also be synchronous, and invocation
logs do not expose parsed argument values or exception messages.
The release is versioned as
0.7.0. Existing positionalRegistrationSummaryconstruction keeps the middleware field in its originalslot.
Validation
make test: 80 tests passedPluginContext.register_cli_commandcontract test passedmake build: source distribution and wheel built successfullygit diff --check origin/main: passedPost-Deploy Monitoring & Validation
cli_commandsinventory.hermes <command> --helpand dispatchits handler through the host CLI.
register_cli_commandsignature error as rollbackcriteria.
hermes-plugin-kit0.6.0.