UNPKG

actionhero

Version:

The reusable, scalable, and quick node.js API server for stateless and stateful applications

45 lines (44 loc) 1.55 kB
/** * 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]`) */ export declare abstract class CLI { /**The name of the CLI command. */ name: string; /**The description of the CLI command (default this.name) */ description: string; /**An example of how to run this CLI command */ example: string; /**The inputs of the CLI command (default: {}) */ inputs: { [key: string]: { required?: boolean; requiredValue?: boolean; default?: string | boolean; letter?: string; flag?: boolean; placeholder?: string; variadic?: boolean; description?: string; formatter?: Function; validator?: Function; }; }; /** Should the server initialize before running this command? */ initialize: boolean; /** Should the server start before running this command? */ start: boolean; constructor(); /** * 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. */ abstract run(data: { [key: string]: any; }): Promise<boolean>; /** * An optional method to append additional information to the --help response for this CLI command */ help(): void; validate(): void; }