Creates an instance of CommandProcessor.
See the interface for details.
The command line.
The root command name of the CLI (specified in the Imperative Configuration document)
The command definition node for the command being executed.
Environmental variable name prefix used to construct configuration environmental variables.
The full command definition contains all parents/ancestors of the command being executed.
The help generator to use - normally passed the default generator.
Imperative Logger instance for logging from the command processor.
The profile manager to use when loading profiles for commands
The phrase used to indicate the user wants to enter the value of an argument in a hidden text prompt
The error tag for imperative errors.
Accessor for the command line
Obtain a copy of the command definition
: The Bright Commands definition document.
Accessor for the environment variable prefix
Obtain a copy of the command definition
: The Bright Commands definition document.
Accessor for the help generator passed to this instance of the command processor
Internal accessor for the logger instance.
Accessor for the profile manager factory in use for this command processor.
Accessor for the prompt phrase
Accessor for the root command name
Attempt to load a handler
command response to use to log errors in case of failure
the specified path to the handler, we will attempt to load this
Build the response object for the command based on the invoke parameters. The command response object is passed to the handlers to allow them to perform console messages, response JSON construction, progress bars, etc.
Finish the response by building the response object and optionally outputting the JSON response depending on the modes selected.
Respond to an error encountered when invoking a command handler
the error that was encountered
a response object to print error messages to
path to the handler with which an error was encountered
Generates the help for the command definition passed.
The command response object
This function outputs the final help text when a syntax validation occurs in {@link CommandProcessor#invoke}
The parameters passed to {@link CommandProcessor#invoke}
The response object to output information to.
Invoke the command handler. Locates and requires the module specified by the command definition document, creates a new object, creates a response object, and invokes the handler. The handler is responsible for fulfilling the promise when complete.
The parameters passed to the invoke function
Prepare for command execution. Actions such as reading stdin, auto-loading profiles, etc. will occur here before the command handler is invoked.
: Promise to fulfill when complete.
Validates the input arguments/options for the command (Performs additional validation outside of what Yargs already provides - ideally, we would like to maintain control over all errors and messages for consistency).
: Promise to be fulfilled when validation is complete.
Generates the help for the command definition passed.
Name of page for group/command to jump to
The command response object
Generated using TypeDoc
The command processor for imperative - accepts the command definition for the command being issued (and a pre-built) response object and validates syntax, loads profiles, instantiates handlers, & invokes the handlers.