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)
Config object used to load profiles from active config layers.
The context object defined when in daemon mode.
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
Show secure fields in the output of the command ENV var suffix
The error tag for imperative errors.
Accessor for the command line
Accessor for the app config
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.
Get stdin stream for the command handler to use. In daemon mode this is
a stream of data received from the daemon client. Otherwise it defaults
to process.stdin
.
Readable stream containing stdin data
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.
Print parameters in place for --dry-run in effect
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.