Type Alias: CommandRunner<G>
Command runner.
Signature
ts
export type CommandRunner<G extends GunshiParamsConstraint = DefaultGunshiParams> = (ctx: Readonly<CommandContext<G>>) => CommandRunnerResult<G>Type Parameters
| Name | Description |
|---|---|
G extends GunshiParamsConstraint = DefaultGunshiParams | A type extending GunshiParams to specify the shape of command context. |
Parameters
| Name | Type | Description |
|---|---|---|
ctx | Readonly<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.
