StaticwriteWrites text to stdout with optional chalk color styling.
Text to write.
Optionalcolor: ColorNameOptional chalk color name.
ProtectedbuildProtectedmenuReturns true if menuName equals ancestorName or has it in its parents chain.
ProtectedisProtectedgetProtectedgetCreates a "back" action for the given menu, or returns undefined if none should be shown.
MenuField or MenuChoice to navigate back from.
ProtectedresolveResolves the parent menu name, prioritizing runtime parameter over Menu parent list.
The current menu context.
OptionalruntimeParent: stringRuntime-provided parent name override.
ProtectedrunExecutes an input menu interaction and handles its callback.
MenuInput to run.
OptionalparentName: stringOptional parent menu name for navigation context.
ProtectedrunExecutes an editor menu interaction (opens $EDITOR with pre-populated content).
MenuEditor to run.
OptionalparentName: stringOptional parent menu name for navigation context.
ProtectedrunExecutes a choice menu interaction and handles selected items or callbacks.
MenuChoice to run.
OptionalparentName: stringOptional parent menu name for navigation context.
ProtectedrunExecutes a field menu interaction (choice + optional input sequence).
MenuField to run.
OptionalparentName: stringOptional parent menu name for navigation context.
ProtectedrunExecutes a goto action: records the target and returns control to the caller.
ActionGoto to execute.
OptionalparentName: stringOptional parent menu name for navigation context.
Registers a plugin and merges its translations, menus and actions.
Plugin definition.
Current Cli instance for chaining.
Returns all registered menus.
Adds a menu from JSON config.
Menu JSON definition.
Optionalplugin: stringOptional plugin namespace override.
Current Cli instance for chaining.
Adds an existing Menu instance.
Menu instance.
Optionalplugin: stringOptional plugin namespace override.
Current Cli instance for chaining.
Returns all registered actions.
Adds an action from JSON config.
Action JSON definition.
Optionalplugin: stringOptional plugin namespace override.
Current Cli instance for chaining.
Adds an existing Action instance.
Action instance.
Optionalplugin: stringOptional plugin namespace override.
Current Cli instance for chaining.
Deletes an action by name.
Action name.
Current Cli instance for chaining.
Triggers a shortcut flow from a menu.
Supported built-in shortcuts:
Current menu context.
Trigger type.
Optionalparent: stringOptional runtime parent override.
Rebuilds reverse links by injecting menus/actions into their parent menus.
Current Cli instance for chaining.
Runs the default entry item ("main").
Serializes current menus and actions into plugin-compatible JSON.
Creates a new Cli instance with empty menus and actions registries. Use
addMenu(),addAction(), andrun()to build and execute the CLI.