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
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
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
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.
The context the plugin is being initialized in.
A boolean or promise that resolves to a boolean indicating whether the plugin was successfully initialized.
Optional
meta?: Record<string, any>Additional 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.
Options for the
run
function.