Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CLI

An Actionhero CLI Command. For inputs, you can provide Options (--thing=stuff) with the "Inputs" object, or define Arguments in the name of the command (greet [name])

Hierarchy

  • CLI

Index

Constructors

constructor

Properties

description

description: string

The description of the CLI command (default this.name)

example

example: string

An example of how to run this CLI command

initialize

initialize: boolean

Should the server initialize before running this command?

inputs

inputs: {}

The inputs of the CLI command (default: {})

Type declaration

  • [key: string]: { default?: string | boolean; description?: string; flag?: boolean; letter?: string; placeholder?: string; required?: boolean; variadic?: boolean }
    • Optional default?: string | boolean
    • Optional description?: string
    • Optional flag?: boolean
    • Optional letter?: string
    • Optional placeholder?: string
    • Optional required?: boolean
    • Optional variadic?: boolean

name

name: string

The name of the CLI command.

start

start: boolean

Should the server start before running this command?

Methods

Private getDefaults

  • getDefaults(): { description: string; example: string; initialize: boolean; inputs: {}; name: any; start: boolean }
  • Returns { description: string; example: string; initialize: boolean; inputs: {}; name: any; start: boolean }

    • description: string
    • example: string
    • initialize: boolean
    • inputs: {}
      • name: any
      • start: boolean

    help

    • help(): void
    • An optional method to append additional information to the --help response for this CLI command

      Returns void

    Abstract run

    • run(data: {}): Promise<boolean>
    • The main "do something" method for this CLI command. It is an async method. If error is thrown in this method, it will be logged to STDERR, and the process will terminate with a non-0 exit code.

      Parameters

      • data: {}
        • [key: string]: any

      Returns Promise<boolean>

    validate

    • validate(): void

    Generated using TypeDoc