NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3657 most downloaded on npm
A mature, feature-complete library to parse command-line options.
Last release 6 months ago
23 Mar 2026
Release timing varies
gaps range from 3 weeks to 2.4 years
Rarely documented
notes for 13 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
76 releases · first in 2014
Nothing published for this version
Nothing published for this version
This is a non-functional release intended to refresh the codebase and dependency tree. There are no changes to the library's API or behaviour.
This is a non-functional release intended to refresh the codebase and dependency tree. There are no changes to the library's API or behaviour.
One column per quarter.
Nothing published for this version
Dropped support for Node versions less than v12.20
Added options.caseInsensitive, see #116 and the docs.
options.caseInsensitive, see #116 and the docs.Added options.caseInsensitive , see #116 and the docs .
Assets 2 Loading
There was an error while loading. Please reload this page .
👍 1 evenstensberg reacted with thumbs up emoji All reactions
1 person reacted
1 Join discussion
Nothing published for this version
Nothing published for this version
Library rewritten using ECMAScript Modules to facilitate use with rollup and `--experimental-modules`. Fixes https://github.com/75lb/command-line-args
Library rewritten using ECMAScript Modules to facilitate use with rollup and --experimental-modules. Fixes https://github.com/75lb/command-line-args/issues/99. This is a non-functional change - the library API and functionality has not changed.
Library rewritten using ECMAScript Modules to facilitate use with rollup and --experimental-modules . Fixes #99 . This is a non-functional change - th
Library rewritten using ECMAScript Modules to facilitate use with rollup and --experimental-modules . Fixes #99 . This is a non-functional change - the library API and functionality has not changed.
How to use with native ECMAScript modules
How to use with rollup
Assets 2 Loading
There was an error while loading. Please reload this page .
All reactions
Nothing published for this version
Unknown values now throw an exception (UNKNOWN_VALUE) by default in the same way unknown options do. Command-line-args is now strict by default - all
UNKNOWN_VALUE) by default in the same way unknown options do. Command-line-args is now strict by default - all options and values must be accounted for in the option definitions.
5 in the command --verbose 5 where verbose is defined as a Boolean.partial or stopAtFIrstUnknown parse options.--help --help) now throws an ALREADY_SET exception.NAME_MISSING, INVALID_TYPE etc) thrown by commandLineArgs in the case of an invalid definition have been consolidated to just one error name: INVALID_DEFINITIONS. Given broken option definitions are a programmer error they'd never be handled anyway, making the various names pointless.UNKNOWN_OPTION exception now has a optionName property containing the arg that specified an unknown option, e.g. --oneALREADY_SET exception has a optionName property containing the option name that has already been set, e.g. oneUNKNOWN_VALUE exception has a value property containing the unknown value, e.g. 5No API changes were introduced in v5.0.0 - it is backward-compatible. If you're comfortable with the new version throwing exceptions on unknown values, you are safe to upgrade without code change.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Unknown values now throw an exception ( UNKNOWN_VALUE ) by default in the same way unknown options do. Command-line-args is now strict by default - al
Unknown values now throw an exception ( UNKNOWN_VALUE ) by default in the same way unknown options do. Command-line-args is now strict by default - all options and values must be accounted for in the option definitions.
An example of an unknown value is the arg 5 in the command --verbose 5 where verbose is defined as a Boolean .
"Strict by default" behaviour can be disabled using either partial or stopAtFIrstUnknown parse options.
Setting a singular, non-multiple option more than once (e.g. --help --help ) now throws an ALREADY_SET exception.
The multiple error names ( NAME_MISSING , INVALID_TYPE etc) thrown by commandLineArgs in the case of an invalid definition have been consolidated to just one error name: INVALID_DEFINITIONS . Given broken option definitions are a programmer error they'd never be handled anyway, making the various names pointless.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Removed support for node versions less than v4.0.0
Removed support for node versions less than v4.0.0
The method signature changed. If you're passing a custom argv you now do it this way:
const argv = [ '--log-level', 'info' ]
commandLineArgs(optionDefinitions, { argv })
Previously, it was done this way:
const argv = [ '--log-level', 'info' ]
commandLineArgs(optionDefinitions, argv)
String is the new default type function.
If all the following are true then no changes are required to your code
argvtype specifiedNothing published for this version
Nothing published for this version
- Removed support for node versions less than v4.0.0
Removed support for node versions less than v4.0.0
The method signature changed. If you're passing a custom argv you now do it this way:
const argv = [ '--log-level' , 'info' ] commandLineArgs ( optionDefinitions , { argv } )
Previously, it was done this way:
const argv = [ '--log-level' , 'info' ] commandLineArgs ( optionDefinitions , argv )
String is the new default type function.
If all the following are true then no changes are required to your code
Your app does not need to run on old nodejs versions
You don't pass a custom argv
All your option definitions have a type specified
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
As its API changed i found myself needing to update the .getUsage() method of this library, causing a breaking change. Rather than update this library…
The command-line-usage library evolved recently, it is now more flexible with a new API. As its API changed i found myself needing to update the .getUsage() method of this library, causing a breaking change. Rather than update this library each time command-line-usage changes, i separated them completely. Therefore, the .getUsage() method has been removed and the .parse() method is now exported directly.
So, the API has changed from
const commandLineArgs = require('command-line-args')
const cli = commandLineArgs([ { name: 'version' } ])
const options = cli.parse()
to the more concise
const commandLineArgs = require('command-line-args')
const options = commandLineArgs([ { name: 'version' } ])
The data you previously passed to .getUsage() you should pass to command-line-usage v2, like so:
const commandLineUsage = require('command-line-usage')
const usage = commandLineUsage(templateData)
For details about command-line-usage, including the new v3, see the project page.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
upgraded .getUsage to use command-line-usage v2.0.0, which features column-layout, the header field and other template improvements
new features
.getUsage to use command-line-usage v2.0.0, which features column-layout, the header field and other template improvementscommandLineArgs(definitions) will now throw if you added defaultOption to more than one definitionNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Numeric aliases are no longer valid as -1 could be interpreted as both minus 1 and option 1.
Breaking change since v1.0.0
-1 could be interpreted as both minus 1 and option 1.Other changes
--один) are now validNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →