Skip to main content
Adding a New CLI shows how to write one. The constructors document exact types and defaults: CLI and CLIHandler, and CommandSpec and Argument.

CLI and CLIHandler

CommandSpec

Argument

The names follow argparse, which Mirage supports in part. Positionals take no default, and options take no variable count. append collects one value per use; extend flattens fixed groups. The other fields of CommandSpec and Argument describe shell builtins’ grammars, such as tar’s old-style options; a CLI doesn’t need them.

Context