Skip to content

Interface: Command<G>

Command interface.

Signature

ts
export interface Command<G extends GunshiParamsConstraint = DefaultGunshiParams>

Type Parameters

NameDescription
G extends GunshiParamsConstraint = DefaultGunshiParamsThe Gunshi parameters constraint

Properties

NameTypeDescription
args (optional)ExtractArgs<G>Command arguments. Each argument can include a description property to describe the argument in usage.
description (optional)stringCommand description. It's used to describe the command in usage and it's recommended to specify.
entry (optional)booleanWhether this command is an entry command. Default: undefined Since v0.27.0
examples (optional)string | CommandExamplesFetcher<G>Command examples. examples of how to use the command.
internal (optional)booleanWhether this is an internal command. Internal commands are not shown in help usage. Default: false Since v0.27.0
name (optional)stringCommand name. It's used to find command line arguments to execute from sub commands, and it's recommended to specify.
rendering (optional)RenderingOptions<G>Rendering control options Since v0.27.0
run (optional)CommandRunner<G>Command runner. it's the command to be executed
subCommands (optional)Record<string, SubCommandable> | Map<string, SubCommandable>Nested sub-commands for this command. Allows building command trees like git remote add. Each key is the sub-command name, and the value is a command or lazy command. Since v0.28.0
toKebab (optional)booleanWhether to convert the camel-case style argument name to kebab-case. If you will set to true, All Command.args names will be converted to kebab-case.

Released under the MIT License.