Skip to content

DefaultCommandOptions

Options for .default().

Signatures

ts
interface DefaultCommandOptions {}

Members

Properties

route

Also expose the default command under its own name as a routable top-level command.

By default a default command is the root surface only — mycli (bare or flags-only) runs it, but mycli <its-name> does not route to it (the token is consumed as the default's first positional). Set route: true for CLIs that intentionally expose both forms: mycli and mycli <its-name> become the same command, and it is listed in the root Commands: section beside its siblings.

The name wins over positional interpretation: with route: true, a positional value equal to the command's own name is consumed as the route, so pass such a value after -- (mycli -- <name>).

ts
route?: boolean;

See Also

Released under the MIT License.