commander
15.1.0 · 7 Nov 2026MIT785.6M / weekRepositoryHomepagenpmAtom feed
9.5.0 is the newest release of 9.x.
In short
3 breaking1 removed9 new1 fixed4 changed
- Breaking
Commander 9 requires Node.js v12.20.0 or higher
- Breaking
default value specified for boolean option now always used as default value (see .preset() to match some previous behaviours)
- Breaking
removed internal fallback to
require.main.filenamewhen script not known from arguments passed to.parse()(can supply details using.name(), and.executableDir()orexecutableFile)
- Removed
Removed restriction that nested subcommands must specify
executableFile
Release note
Added
Simpler ECMAScript import
Option.preset() allows specifying value/arg for option when used without option-argument (especially optional, but also boolean option)
.executableDir()for custom search for subcommandsThrow with helpful message if pass
Optionto.option()or.requiredOption().
error()for generating errors from client code just like Commander generated errors, with support for.configureOutput (),.exitOverride(), and.showHelpAfterError()(#1675).optsWithGlobals()to return merged local and global options
Changed
- Breaking
Commander 9 requires Node.js v12.20.0 or higher
Update package-lock.json to lockfile@2 format
showSuggestionAfterErroris now on by default- Breaking
default value specified for boolean option now always used as default value (see .preset() to match some previous behaviours)
Default value for boolean option only shown in help if true/false
Use command name as prefix for subcommand stand-alone executable name (with fallback to script name for backwards compatibility)
Allow absolute path with
executableFile- Removed
Removed restriction that nested subcommands must specify
executableFile TypeScript: Allow passing readonly string array to
.choices()TypeScript: Allow passing readonly string array to
.parse(),.parseAsync(),.aliases()
Fixed
Option with optional argument not supplied on command line now works when option already has a value, whether from default value or from previous arguments
Removed
- Breaking
removed internal fallback to
require.main.filenamewhen script not known from arguments passed to.parse()
(can supply details using.name(), and.executableDir()orexecutableFile) (#1571)
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.