Skip to content

Interface: CommandContextParams<G, V, C, E>

Parameters of createCommandContext

Signature

ts
export interface CommandContextParams<
  G extends GunshiParams | { args: Args } | { extensions: ExtendContext },
  V extends ArgValues<ExtractArgs<G>>,
  C extends Command<G> | LazyCommand<G> = Command<G>,
  E extends Record<string, CommandContextExtension> = Record<string, CommandContextExtension>
>

Type Parameters

Name
G extends GunshiParams | { args: Args } | { extensions: ExtendContext }
V extends ArgValues<ExtractArgs<G>>
C extends Command<G> | LazyCommand<G> = Command<G>
E extends Record<string, CommandContextExtension> = Record<string, CommandContextExtension>

Properties

NameTypeDescription
args (optional)ExtractArgs<G>An arguments of target command
argv (optional)string[]Original command line arguments
callMode (optional)CommandCallModeCommand call mode.
cliOptions (optional)CliOptions<G>A command options, which is spicialized from cli function
command (optional)CA target command
commandPath (optional)string[]The path of nested sub-commands resolved to reach the current command.
explicit (optional)ExtractArgExplicitlyProvided<G>Explicitly provided arguments
extensions (optional)EPlugin extensions to apply as the command context extension.
omitted (optional)booleanWhether the command is omitted
positionals (optional)string[]A positionals arguments, which passed to the target command
rest (optional)string[]A rest arguments, which passed to the target command
tokens (optional)ArgToken[]Argument tokens that are parsed by the parseArgs function
validationError (optional)AggregateErrorValidation error from argument parsing.
values (optional)VA values of target command

Released under the MIT License.