- fix: Removed a log statement that is logging a undefined field.
- fix: Fix for loading ESM - node.js upgrade on axway-cli and ESM conversion.
- fix: Load extension subcommands, then re-register them by name and alias.
- fix: Added missing
srcdirectory to distribution. Oops.
- BREAKING CHANGE: Require Node.js 14.15.0 LTS or newer.
- BREAKING CHANGE: Changed package to a ES module.
- BREAKING CHANGE: Removed server mode including
CLI.connect(),CLI.listen(), andCLI.schema(). - BREAKING CHANGE: No longer re-export
pkg-dir. - BREAKING CHANGE:
generateHelp()now returns a promise. - chore: Updated dependencies.
- feat: Add support for extension CLIs with multiple exported entrypoints that do not use cli-kit. Fixes #97.
- chore: Updated dependencies.
- feat: Moved internal
bannervalue into state object to allow banner to be modified during command execution whenautoHideBanneris enabled (default). - chore: Updated dependencies.
- fix: Fixed bug when adding a command using an absolute path to a js file.
- chore: Minor dependency updates.
- feat: Added
redactflag to arguments and options so advanced implementations can know if an argument/option may contain sensitive information. Redact flag istrueby default, but can be set to false in the paramters or prefixing the name with a~such as"<~myoption>". Note that option flags (those without a value) default tofalsesince the value is boolean. - fix(cli): Added better error when failed to load extension on CLI construction.
- fix(help): Added error to exec state when help command is invoked with unknown command.
- fix(parser): Added argument reference to parsed argument.
- fix(parser): Fixed incomplete
inputfor parsed "extra" arguments, commands, extensions, and arguments. - style(help): Render warnings using yellow.
- chore: Updated dependencies.
- feat(help): Added required options to usage on help screen.
- feat(ansi): Added
trim(),trimStart(), andtrimEnd()functions. - fix(help): Pass styles as well as header and footer content when rendering help template on
demand via
help(). - fix(cli): Moved
helpparameter fromCommandtoContextso thatCLIcan render custom help content. - build: Improved
watchtask to not hang on a lint or build error. - chore: Updated dev dependencies.
- feat(extension): Allow extension exports values in its
package.jsonto be themainpath. - fix(command): Fixed regression introduced when fixing the custom help content for extensions.
- fix(command): Fixed custom help content for extensions.
- fix(command): Only consider command name to be a file if it is an absolute path.
- fix(cli): Set
jsonflag on errors when the executing context or its parent contexts has ajsonModeflag set. - chore: Updated dev dependencies.
- fix: Don't override default value for boolean options.
- chore: Updated dev dependencies.
- feat: Mix custom command, argument, option, and extension constructor parameters into each instance. Only works for non-existing properties.
- fix: Execute command actions using command's context.
- feat(command): Support command name to be a path to command file.
- feat(extension): Added support for defining extension contexts.
- fix(option): Allow aliases to be negated.
- fix(argument): Use correct
datatypeproperty when transforming argument value. - chore: Updated dependencies.
- fix(extension): Strip the package scope name from an extension name, but still add it as a hidden alias.
- chore: Updated dependencies.
- chore: Updated dependencies.
- chore: Updated dependencies.
- feat(extension): Added support actions.
- fix(terminal): One time keypress listener was not removing sigint handler after firing causing programs to appear hung.
- refactor(cli): Moved
serverModeoption fromexec()to the constructor. - style(help): Prefix the error with an 'x' symbol.
- chore: Updated dependencies.
- fix(cli): Fixed bug where banner was rendered twice if
autoHideBanneris enabled and an the executed command throws an error.
- fix(cli): Force banner to be rendered on error.
- fix(cli): Render banner, but don't fire the banner hook on error.
- fix(cli): Fixed banner hook from being fired more than once.
- fix(cli): Fixed banner from being displayed more than once.
- fix(extension): Removed node-pty support since it has never worked properly. On Windows, it would clear the screen and cause the parent to never exit. On macOS, it would not allow child processes to prompt for input.
- fix(extension): Switched non-cli-kit based extensions to be
required()'d instead of spawned. - chore: Updated dependencies.
- fix(cli): Fixed rendering of banner if
autoHideBanneris disabled. - refactor(cli): Switched the banner event to a hook to allow banner event handlers to tie into the banner event before and after the banner is rendered.
- chore: Updated dependencies.
- fix(cli): Unify arguments to the banner event handler.
- style(help): Align descriptions based on longest command, argument, and option label.
- style(help): Removed
=between option label and value. - chore: Updated dependencies.
- fix(parser): Fixed bug where context tree rev change was not updating the local rev before re-parsing causing unnecessary nested re-parses.
- fix(parser): Fixed bug where if the context tree changed, the last argument would never be re-parsed.
- feat(parser): Added
finalizeevent hook that is emitted before applying defaults and fillingargvand_. - feat(parser): Added
dataandparsertoparseevent payload and all argument and option callbacks. - feat(parser): Fire argument and option callbacks for every argument and option across all contexts even if they're not discovered. This allows programs to dynamically resolve default values or alter the context tree.
- feat(command): Added
callbackparameter that is fired as soon as the parser finds the command. - refactor(parser):
Parsernow extends aHookEmitterand is linked to theCLIinstance to decouple theCLIfrom theParser. - refactor(parser): Moved default value initialization and populating
argvand_to end of parser chain so that option callbacks have the ability to modify the contexts and continue parsing. - fix(keys): Fixed
generateKey()to support multiple sequential escape sequences. - chore: Updated dependencies.
- test(keys): Added unit tests for
generateKey().
- feat(ansi): Added
ansi.split()to break a string up by ANSI escape sequences. - feat(ansi): Added
ansi.toLowerCase()andansi.toUpperCase(). - chore: Updated dependencies.
- fix(cli): Only show help on errors caused by parsing and validation, not command execution.
- fix(cli): Fixed regression introduced in v1.6.0 that broke missing argument validation.
- fix(argument): Added missing argument
callbackandhint. - chore: Updated dev dependencies.
- feat(help): Added
CLIinstanced styles to help template rendering. - fix(terminal): Only wire up keypress on stdin when added to
Terminaland not if some other logic listens on stdin. - fix(parser): Moved missing required argument validation from parser to CLI to allow option
callbacks such as
--versionto work properly. - chore: Updated dependencies.
- fix(terminal): Fixed bug where
keypressevent listeners were not properly being wired up tostdinresulting in the listener not being removed after being fired once.
- fix(context): Fixed circular reference introduced when fixing the
generateHelphook event in v1.3.0 when generated JSON object is stringified.
- feat(cli): Added
showHelpflag on thrown errors to overrideshowHelpOnError. Defaults totrue. This still requireshelpto be enabled. - feat(debug): Added
errorstyle for help template and server mode error handling. - fix(cli): Removed duplicate error logging when server mode execution throws exception.
- fix(help): Allow non-Error objects to be thrown and rendered on the help screen.
- chore(dep): Replaced
fast-levenshteinwithfastest-levenshtein.
- feat(cli): Added support for user-defined in
stylespassed into theCLIconstructor as well as theexec()method. - feat(template): Added
subheadingstyle. - fix(template): Properly escape tildes in templates with nested expressions.
- fix(help): Fixed option heading and subheading styling where the trailing
:wasn't styled and whitespace was being trimmed. - fix(help): Fixed option format to use proper required indicators.
- fix(cli): Fixed rendering of errors to debug log when server connection executes a command that throws an exception.
- feat(cli): Added
exechook event. - feat(context): Added
ctxproperty togenerateHelphook event. - fix(parser): Fixed bug in server mode where
parsehook event was being omitted from the cloned context which is not accessible instead of the originatingCLIinstance. - fix(cli): Fixed issue with server mode execution where a context would be deeply cloned, however
CommandandExtensionobjects were passed by reference. - chore: Updated dependencies.
- fix(cli): Server-side output streams extend TTY
WriteStreamto improve compatibility with packages that checkisTTYand terminal helper functions such ascursorTo()andclearLine(). - chore: Updated dev dependencies.
- feat(cli): Added
timeoutoption toCLI.connect()with default of 5 seconds. - fix(cli):
CLI.connect()now waits for terminal resize handshake to complete before resolving. - fix(cli): Set the remote terminal size on the stdout/stderr streams.
- fix(cli): Fixed issue where extension banner was not overriding parent context's banner.
- fix(terminal): Fixed issue where banner was not being displayed if output occurred before banner callback was registered.
- fix: Force all options after an extension is found to be an argument.
- fix: Sort commands and extensions alphabetically in the help output.
- chore: Updated dependencies.
- feat(commands): Added syntactic sugar for declaring commands with aliases and arguments.
- feat(help): Added command aliases to the help screen.
- fix(cli): Dynamically resolve 'showHelpOnError'.
- fix(parser): Correctly resolve the parsed argument name in the debug logging.
- style(cli): Capitalized
--versiondescription. - chore: Updated dev dependencies.
- fix(cli): On error, print the error stack instead of the error object to prevent infinite loops when JSON stringifying error objects during error the printing.
- fix(cli): Improved server eval exit code handling.
- fix(help): Highlight format for missing options.
- chore: Updated dev dependencies.
- feat(cli): Added new
keypressansi sequence for improved raw input handling in server mode. - feat(cli): Added new
execansi sequence to explicitly run a command and differentiate between running a command and stdin input. - refactor(cli): Greating improved remote stdin handling in server mode enabling support for prompting.
- fix(cli): Fixed bug where client wasn't emitting the correct exit code.
- fix(context): Added
CLIproperties to context init so that help in server mode can render properly. - fix(parser): Fixed bug where known options that are not flags and do not have values were not properly being defaulted to an empty string.
- fix(help): Trim the rendered help output to avoid excess whitespace.
- chore: Updated dependencies.
- fix(cli): Added support for 'parentContextNames' when a remote CLI instance is unaware of the local CLI's parent hierarchy.
- fix(cli): Fixed bug where remote banner would not suppress local banner and end up rendering both.
- fix(cli): Added banner to CLI schema object.
- chore: Updated dependencies.
- BREAKING CHANGE: Require Node.js 10 or newer.
- fix(cli): Fixed bug where
--versioncallback would show version ifnext()returned a truthy value instead oftruesince this option is a flag. - fix(parser): Fixed regression introduced in 24f5048 where parser context chains where processed one context at a time instead of chaining them all together.
- fix(cli): Run the default command if selected command does not have an action. Fixes #64.
- chore: Updated dependencies.