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§
- Command
Info - Picker-facing row. Keep the struct tiny:
nameis the literal the picker inserts on Tab;summaryis the human-readable description rendered to the right.
Enums§
- Auto
Action - The
/autosubcommand. - Command
- An operator command.
- Config
Action - The
/configsubcommand. - Headless
Action - The
/headlesssubcommand. - Mode
Target - A mode switch the dispatcher can emit. Mirrors
zero-tui::Modebut lives here sozero-commandsdoes not have to depend on the TUI crate. - Overlay
Target - 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. - State
Override Label - Labels the operator may self-declare via
/state-override. - Verbose
Action - The
/verboseargument.
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-overriderequires. 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 toCommand::Unknown; empty input returnsNoneso the caller can skip dispatch silently.