Type alias CommandModule<TData, TOptions>

CommandModule<TData, TOptions>: {
    description?: string;
    handler: CommandHandler<TData, TOptions>;
    isMiddleware?: boolean;
    options?: TOptions;
    requiresSubcommand?: boolean;
}

A command module that can be executed by the CLI engine.

Type Parameters

  • TData = unknown

    Optional type for data specific to this command.

  • TOptions extends OptionsConfig = OptionsConfig

    The OptionsConfig type for the command.

Type declaration

  • Optional description?: string

    A description of the command that will be displayed in the help menu.

  • handler: CommandHandler<TData, TOptions>

    The command handler. This is where the command's logic is executed.

  • Optional isMiddleware?: boolean

    If true, the command will be executed before the next command in the chain.

    Default

    true
    
  • Optional options?: TOptions

    The options config for the command.

  • Optional requiresSubcommand?: boolean

    If true, the command will require a subcommand to be executed.

    Default

    false