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

  • Optionaldescription?: 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.

  • OptionalisMiddleware?: boolean

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

    true
    
  • Optionaloptions?: TOptions

    The options config for the command.

  • OptionalrequiresSubcommand?: boolean

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

    false