Skip to main content

Module command

Module command 

Source
Expand description

The Command enum — exhaustive list of what the TUI, command palette, and non-interactive entrypoint can dispatch.

Each variant carries a const RiskDirection and resolves to a single handler inside dispatch. Adding a command is three steps: add a variant, add a CatalogEntry in [CATALOG], add a match arm in dispatch::run.

Structs§

CommandInfo
Picker-facing row. Keep the struct tiny: name is the literal the picker inserts on Tab; summary is the human-readable description rendered to the right.

Enums§

AutoAction
The /auto subcommand.
Command
An operator command.
ConfigAction
The /config subcommand.
HeadlessAction
The /headless subcommand.
ModeTarget
A mode switch the dispatcher can emit. Mirrors zero-tui::Mode but lives here so zero-commands does not have to depend on the TUI crate.
OverlayTarget
A modal overlay the TUI should paint on top of the current mode. Same decoupling rationale as ModeTarget: dispatch side-effects stay addressable without the command crate depending on any widget types.
StateOverrideLabel
Labels the operator may self-declare via /state-override.
VerboseAction
The /verbose argument.

Constants§

COMMAND_CATALOG
Static catalog of user-visible slash commands, exposed for command pickers / help pages / documentation generators.
DISCLOSURE_OVERRIDE_CONFIRM
The exact phrase /disclosure-override requires. Declared here so tests, the parser, and the help text all reference the same string — drift between what the help says and what the parser accepts would be an honesty bug.

Functions§

resolve
Resolve a parsed line to a Command. Unrecognized heads resolve to Command::Unknown; empty input returns None so the caller can skip dispatch silently.