Skip to content

gunshi / default / CommandEnvironment

Interface: CommandEnvironment<G>

Command environment.

Type Parameters

Type ParameterDefault type
G extends GunshiParams<any>DefaultGunshiParams

Properties

PropertyTypeDescription
cwdundefined | stringCurrent working directory. See CliOptions.cwd
descriptionundefined | stringCommand description. See CliOptions.description
leftMarginnumberLeft margin of the command output. Default 2 See CliOptions.leftMargin
middleMarginnumberMiddle margin of the command output. Default 10 See CliOptions.middleMargin
nameundefined | stringCommand name. See CliOptions.name
renderHeaderundefined | null | (ctx) => Promise<string>Render function the header section in the command usage.
renderUsageundefined | null | (ctx) => Promise<string>Render function the command usage.
renderValidationErrorsundefined | null | (ctx, error) => Promise<string>Render function the validation errors.
subCommands| undefined | Map<string, | Command<any> | LazyCommand<any>>Sub commands. See CliOptions.subCommands
usageOptionTypebooleanWhether to display the usage option type. Default false See CliOptions.usageOptionType
usageOptionValuebooleanWhether to display the option value. Default true See CliOptions.usageOptionValue
usageSilentbooleanWhether to display the command usage. Default false See CliOptions.usageSilent
versionundefined | stringCommand version. See CliOptions.version

Released under the MIT License.