Optional
afterA hook that runs once all commands have been called or when context.end()
is called.
Optional
afterA hook that runs after parsing the command string.
Optional
afterA hook that runs after importing command modules.
Optional
afterA hook that runs after each state update during command execution.
Optional
beforeA hook that runs before executing the context.end()
function.
Optional
beforeA hook that runs before calling the first command.
Optional
beforeA hook that runs before executing the context.next()
function.
Optional
beforeA hook that runs before parsing the command string using the options config from plugins and imported command modules.
Optional
beforeA hook that runs before attempting to locate and import command modules.
Optional
beforeA hook that runs before attempting to locate and import each subcommand module.
Optional
beforeA hook that runs before each state update during command execution.
Optional
commandThe command string or array to be parsed and executed. If not provided, it defaults to system arguments.
Optional
commandsA directory path containing command modules.
Optional
defaultThe command string to run if no command is provided.
Optional
initialInitial context or data to pass to commands during execution.
Optional
onA hook that runs whenever an error is thrown.
Optional
onA hook that runs whenever a plugin or command intends to exit the process.
Optional
optionsOptions to include in the context.
Optional
pluginsAn array of plugins that can modify or augment the behavior of commands.
Optional
description?: stringInitialize the plugin.
Optional
meta?: AnyObjectAdditional metadata about the plugin that doesn't fit in the standard fields.
Note: Plugin info on the Context
object will be frozen after
the plugin is initialized. However, the freeze is shallow, so the fields of
this object will be mutable by default.
Optional
version?: string
Params for the
run
function.