Create a new base command instance
The Ace kernel instance
The parsed CLI input
UI primitives for output
Prompt utilities for user interaction
StaticbootedWhether the command class has been booted
StaticoptionsConfiguration options accepted by the command
StaticaliasesA collection of aliases for the command
StaticargsRegistered arguments
StaticflagsRegistered flags
OptionalexitThe exit code for the command
OptionalerrorThe error raised at the time of executing the command. The value is undefined if no error is raised.
OptionalresultThe result property stores the return value of the "run" method (unless command sets it explicitly)
UI primitives for output
Prompt utilities for user interaction
StaticcommandCommand metadata
StaticdescriptionThe command description
StatichelpThe help text for the command. Help text can be a multiline string explaining the usage of command
OptionalnamespacesOptional namespaces to filter the command list
OptionaljsonFlag to output the command list as JSON
Reference to the command name
Reference to the command options
Reference to the command args
Reference to the command flags
StaticbootStaticdefineSpecify the argument the command accepts. The arguments via the CLI will be accepted in the same order as they are defined.
Mostly, you will be using the @args decorator to define the arguments.
The name of the argument
Configuration options for the argument
StaticdefineSpecify a flag the command accepts.
Mostly, you will be using the @flags decorator to define a flag.
The name of the flag
Configuration options for the flag
StaticgetReturns the options for parsing flags and arguments
Optionaloptions: FlagsParserOptionsOptional parser options to merge
StaticserializeSerializes the command to JSON. The return value satisfies the CommandMetaData
StaticvalidateValidate the yargs parsed output against the command.
The parsed CLI input to validate
JSON representation of the command
Assert command logs a message matching the given regex
The regex pattern to match against log messages
Optionalstream: "stdout" | "stderr"Optional stream to check ('stdout' or 'stderr')
The list command is used to view a list of commands
Example