Interface: CliOptions<G>
CLI options of cli function.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
G extends GunshiParamsConstraint | DefaultGunshiParams | A type extending GunshiParams to specify the shape of cli options. |
Properties
| Property | Type | Description |
|---|---|---|
cwd? | string | Current working directory. |
description? | string | Command program description. |
fallbackToEntry? | boolean | Whether to fallback to entry command when the sub-command is not found. Default false Since v0.27.0 |
leftMargin? | number | Left margin of the command output. |
middleMargin? | number | Middle margin of the command output. |
name? | string | Command program name. |
onAfterCommand? | (ctx, result) => Awaitable<void> | Hook that runs after successful command execution Since v0.27.0 |
onBeforeCommand? | (ctx) => Awaitable<void> | Hook that runs before any command execution Since v0.27.0 |
onErrorCommand? | (ctx, error) => Awaitable<void> | Hook that runs when a command throws an error Since v0.27.0 |
plugins? | Plugin[] | User plugins. Since v0.27.0 |
renderHeader? | null | (ctx) => Promise<string> | Render function the header section in the command usage. |
renderUsage? | null | (ctx) => Promise<string> | Render function the command usage. |
renderValidationErrors? | null | (ctx, error) => Promise<string> | Render function the validation errors. |
subCommands? | | Map<string, | Command<any> | LazyCommand<any, { }>> | Record<string, | Command<any> | LazyCommand<any, { }>> | Sub commands. |
usageOptionType? | boolean | Whether to display the usage optional argument type. |
usageOptionValue? | boolean | Whether to display the optional argument value. |
usageSilent? | boolean | Whether to display the command usage. |
version? | string | Command program version. |
