Class CLIAbstract

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])

Constructors

  • Returns CLI

Properties

description: string

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

example: string

An example of how to run this CLI command

initialize: boolean

Should the server initialize before running this command?

inputs: {
    [key: string]: {
        default?: string | boolean;
        description?: string;
        flag?: boolean;
        formatter?: Function;
        letter?: string;
        placeholder?: string;
        required?: boolean;
        requiredValue?: boolean;
        validator?: Function;
        variadic?: boolean;
    };
}

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

Type declaration

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

The name of the CLI command.

start: boolean

Should the server start before running this command?

Methods

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

    Returns void

  • 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;
      }
      • [key: string]: any

    Returns Promise<boolean>

  • Returns void