Skip to content

Type Alias: CommandRunner<G> ​

Command runner.

Signature ​

ts
export type CommandRunner<G extends GunshiParamsConstraint = DefaultGunshiParams> = (ctx: Readonly<CommandContext<G>>) => CommandRunnerResult<G>

Type Parameters ​

NameDescription
G extends GunshiParamsConstraint = DefaultGunshiParamsA type extending GunshiParams to specify the shape of command context.

Parameters ​

NameTypeDescription
ctxReadonly<CommandContext<G>>A command context

Returns ​

CommandRunnerResult<G> — The result of a command that spreads jsonArgs, an object keyed by a noun, which is printed as JSON with --json. For any other command, a string, which cli() returns, or nothing. See CommandRunnerResult.

Released under the MIT License.