Create an instance with the supplied configuration; omitted fields use the documented defaults.
ReadonlycwdWorking directory used to resolve command-line paths and execute tools.
ReadonlynameProgram name shown in help, schemas, and completion scripts.
ReadonlyrootBase directory for default and environment path values.
Resolved, typed values keyed by option var / argument name.
The command words selected by the last parse, e.g. ['db', 'migrate'].
Register a positional argument. An empty default makes it required.
Register a final positional argument that collects all remaining tokens.
Register a command (spec section 1.7) and return it, to register its options and arguments on.
Tab-separated completion records (spec section 9). words are the words
typed after the program name; a program with commands follows them.
Shell script that enables completion for this program (spec section 9):
eval "$(prog --completion bash)". Undefined for an unknown shell.
At most one of these options may be given.
Look up a resolved value by option variable name or positional argument name.
Register a positional argument using the legacy method name.
Use Cli.arg.
Register a variadic argument using the legacy method name.
Use Cli.argVariadic.
Register an option using the legacy method name.
Use Cli.opt; kept for scripts written against getOpt.
Register a repeatable option using the legacy method name.
Use Cli.optArray.
Whether an option came from CLI, config, or environment rather than a default.
Whether an option was explicitly supplied on the command line.
JSON description of the CLI (spec section 8).
At least one of these options must be given.
Register an option. defaultValue is a default, 'flag' for a boolean
flag, 'optional' for no default, or '' to make the option required.
Register a repeatable option whose values accumulate into a list.
Parse without exiting. Values are available in values when status is 'ok'.
Declare an external executable required at parse time; description and install hint explain a missing dependency.
When the first option is given, the others must be too.
Parse and act like a CLI: handles --help, --help-json-schema and --bash-completion, prints errors and exits on failure. Returns the values.
option holds the config file path; prefixes is comma-separated.
Set the description shown below the usage line; returns this CLI.
What running the program does: read-only, idempotent, destructive, network.
Set the text displayed after the help sections; returns this CLI.
Fallback dirs (relative to root) for bare relative values of a path option.
What the program reads on stdin; contentType is a MIME type or a comma-separated list.
What the program writes on stdout; undeclared means text.
Where an option's value came from: cli, config, env, default or unset.
Help text (spec section 7), for the selected command.
Resolved values as JSON (spec section 10).
A command-line interface. Register options and arguments before parsing. Registration errors indicate a programming mistake.