Options
All
  • Public
  • Public/Protected
  • All
Menu

Command abstract defining the implementation contract, which all implementations should extend. It also provides a layer of abstraction for ui and logger members.

@Command({
  description: 'a useful command of some kind'
})
export MyCommand extends BaseCommand {
 public async run(options: any) {
    // ...
  }
}

Hierarchy

Implements

Index

Properties

Methods

Properties

argv

argv: string[] = []

reference to raw args used in the invocation

logger

logger: Logger = new Log.Logger({ name: this.constructor.name })

logging instance

ui

ui: Writer = new UI.Writer()

ui writer instance

Methods

Abstract run

  • run(options: object, ...args: any[]): Promise<any>
  • Command action runner.

    Parameters

    • options: object

      Parsed options for the command invocation

    • Rest ...args: any[]

      Any arguments passed to the command

    Returns Promise<any>