Skip to content

gunshi / default / CliOptions

Interface: CliOptions<G>

CLI options of cli function.

Type Parameters

Type ParameterDefault type
G extends GunshiParamsConstraintDefaultGunshiParams

Properties

PropertyTypeDescription
cwd?stringCurrent working directory.
description?stringCommand program description.
fallbackToEntry?booleanWhether to fallback to entry command when the sub-command is not found. Default false Since v0.27.0
leftMargin?numberLeft margin of the command output.
middleMargin?numberMiddle margin of the command output.
name?stringCommand 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?booleanWhether to display the usage optional argument type.
usageOptionValue?booleanWhether to display the optional argument value.
usageSilent?booleanWhether to display the command usage.
version?stringCommand program version.

Released under the MIT License.