Documentation
¶
Overview ¶
Package cli is the native, channel-agnostic command dispatcher. It holds declared contracts.Cmd values keyed by their namespace Path and resolves an argv invocation to one. It imports only contracts: a command's Run may close over anything (a gateway client, a backend), but the registry never sees it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry collects commands and dispatches argv to them.
func (*Registry) Dispatch ¶
Dispatch resolves args to the command whose Path is the longest prefix of args, parses the remainder into an Input (--flag value pairs into Args; a valueless optional boolean param becomes "true", while an optional ValueRequired param still needs a following value; anything left over goes to Rest), checks required params, and runs it. It returns the handler's output string.
func (*Registry) Run ¶
Run invokes the command at an exact path with a pre-built Input, skipping argv parsing. It is the typed seam for programmatic callers (e.g. the hub's typed SessionControl methods) so they never assemble stringly-typed flag argv that could silently drift from the declared params. Required params are still checked, so a typed caller gets the same validation as the CLI.