Skip to main content

IQCommand

@quik/cli


@quik/cli / IQCommand

Interface: IQCommand<TArguments>

Defined in: cli/src/IQCommand.ts:6

Common contract for CLI command implementations.

Extends

  • CommandModule

Type Parameters

TArguments

TArguments = any

Properties

aliases

readonly aliases: string[]

Defined in: cli/src/IQCommand.ts:8

array of strings (or a single string) representing aliases of exports.command, positional args defined in an alias are ignored

Overrides

CommandModule.aliases


command

readonly command: string

Defined in: cli/src/IQCommand.ts:10

string (or array of strings) that executes this command when given on the command line, first string may contain positional args

Overrides

CommandModule.command


commandName

readonly commandName: string

Defined in: cli/src/IQCommand.ts:11


deprecated

readonly deprecated: string | boolean

Defined in: cli/src/IQCommand.ts:7

boolean (or string) to show deprecation notice

Overrides

CommandModule.deprecated


describe

readonly describe: string | false

Defined in: cli/src/IQCommand.ts:9

string used as the description for the command in help text, use false for a hidden command

Overrides

CommandModule.describe

Methods

builder()

builder(args): Argv<TArguments>

Defined in: cli/src/IQCommand.ts:13

object declaring the options the command accepts, or a function accepting and returning a yargs instance

Parameters

args

Argv<TArguments>

Returns

Argv<TArguments>

Overrides

CommandModule.builder


handler()

handler(args): void | Promise<void>

Defined in: cli/src/IQCommand.ts:15

a function which will be passed the parsed argv.

Parameters

args

ArgumentsCamelCase<TArguments>

Returns

void | Promise<void>

Overrides

CommandModule.handler