Repository navigation
Release v1.4.0
1.4.0
New public API for controlling help visibility, history size, and parse
failures, alongside hardening across plugin registration, cancellation,
option validation, and terminal output. Some entry-point exports were
narrowed; see Removed.
Added
CLI.historySize()sets the interactive history limit after construction,
andCommandBuilder.hidden()excludes a command from generated help and
completion.ParseError(codePARSE_ERROR) covers an unclosed quote, an empty or
trailing pipe, and an unsupported redirection operator. It is raised before a
command is resolved, so a registeredcatch()fallback handler receives the
input instead of the error being thrown.- The package entry point exports
tokenize,splitPipes,
stripOptionPrefix,formatErrorMessage,isCancellationError,
sanitizeTerminalText,splitGraphemes,streamIsTTY,releaseAll,
restoreCursor, and theCompletionResulttype. - Option flags accept long aliases and an explicit value placeholder, which the
generated help then uses. NODE_CLI_DEBUG=1prints the full stack trace for an error reaching
start()in direct argv mode instead of only its message.- The exports map gains a
defaultcondition and a./package.jsonentry. - README figures render the real output of the table, progress, prompt, logger,
and color APIs, and the docs cover the color-enablement precedence, the
completion deadline and signal, cooperative SIGTERM shutdown, and the
[Symbol.dispose]support on progress indicators.
Changed
- Plugin bodies run through a single serial queue, so an asynchronous
use()
preserves declaration order and a synchronous throw fails initialization the
same way a rejected asynchronous plugin does. - The
exitevent fires on every direct-CLI path, not only on shell exit. - A supplied empty argument or a bare
--prints the command index instead of
starting the interactive shell. - Redefining an option replaces the previous definition, so a plugin can refine
a built-in option without removing it first; aliases owned by other options
stay protected. - Every
CommandBuildermethod rejects a command that has been removed, not
onlycommand(). - Declaring a subcommand under a command whose action consumes positional
arguments emits aNODE_CLI_UNREACHABLE_SUBCOMMANDwarning. - Interactive history is appended rather than rewritten unless compaction is
needed. - The toolchain moves to Yarn 4.18.0, with Node.js and Yarn pinned through
mise.tomlinstead of avoltablock.
Removed
Shellis exported as a type only; it is no longer a value export.- The structural types
ArgDef,CommandDefinition,OptionDef, and
ParseResultare no longer exported from the package entry point.
Fixed
- SIGINT during a direct argv run reports exit code 130 and prints
Cancelled, matching the interactive shell. - Option names, aliases, and declared defaults are validated when a command is
built, and a default outside the declared choices is rejected. Numeric option
values that are non-decimal or beyond the safe integer range now error. - Progress indicators are released and the cursor restored after every command,
and table cell and truncation boundaries close any leftover ANSI state. - Password prompts fall back to stderr when stdin is a TTY but stdout is
redirected. - Custom completion providers are bounded by a timeout and their candidate
tokens are escaped. - Readline buffers incoming lines, so pasted or partially typed input survives a
command run.