Commander.js
A strong pick. 1st of 10 CLI frameworks and prompts.
Commander.js is the most widely used argument parser and subcommand framework for Node.js. It has no dependencies and ships its own types. It remains the safe default for parsing a command line today, though it does not handle prompts or terminal UIs. Version 15 is ESM-only and needs Node 22.12 or newer.
Best for: Anyone building a Node.js CLI with options and subcommands who wants a small, stable, well-documented parser with no dependencies.
Scores
Overall8.6
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 8.5, likely 7.5 to 9.0
Commander is the default argument parser for Node CLIs. It is mature, has no dependencies, is actively maintained and is trusted across the ecosystem. It falls short of a 9 for the whole category because it does not cover prompts or TUIs. yargs, citty and CAC also beat it on some points: built-in features, type inference and growth. The ESM-only v15 adds some upgrade friction.
- pkgpulse.com/guides/best-cli-frameworks-nodejs-2026: Recommended as the default for most CLIs
- github.com/tj/commander.js/releases: Active releases and a clear support policy
- npm downloadsLast4Weeks: Category-leading use, with growth below the median
GPT-6.2 Sol: 8.6, likely 7.5 to 9.5
Commander is a strong first choice for a new Node.js CLI built around flags, arguments, and subcommands. Its clear errors, documented API, and active maintenance carry more weight than its slower relative download growth. Citty has an edge when inferred types drive the choice, and oclif has an edge when users need to install plugins. The Node.js version floor and the amount of adoption still on older majors leave some uncertainty about how broadly to recommend v15.
- github.com/tj/commander.js/releases/tag/v15.1.0: Current stable release includes parsing, help, and subcommand fixes.
- github.com/tj/commander.js/releases/tag/v15.0.0: Version 15 sets the Node.js floor at 22.12 and moves the package to ESM.
- github.com/unjs/citty: Citty documents typed arguments and lazy subcommands.
- oclif.io/docs/introduction: oclif supports runtime plugins and project scaffolding.
- npmjs.com/package/commander?activeTab=versions: The registry shows substantial weekly installs on several older majors.
- github.commitsLastYear, dependents.repos, medianDownloadsRatio: Active maintenance and a large installed base alongside below-baseline download growth.
Needed by many5.6
How many developers need a tool for this job?
Claude Opus 5.5: 6.5, likely 5.5 to 7.5
Many JS/TS developers write a CLI or script at some point, and Commander serves most of that need. It covers only the argument-parsing part of the category, not prompts or TUIs. It runs on Node, Bun and Deno.
- dependents.repos: About 1.08M dependent repos shows broad need
- pkgpulse.com/guides/best-cli-frameworks-nodejs-2026: Recommends Commander for simple CLIs and Ink for interactive UIs
GPT-6.2 Sol: 4.6, likely 3.5 to 5.7
Commander serves developers building scripts, scaffolding tools, and multi-command CLIs. Node.js is widely used, but small scripts can use its built-in parser, and interactive tools need additional libraries. Runtime surveys show how many developers can use Commander, while the share who build a CLI is harder to estimate.
- 2025.stateofjs.com/en-US/other-tools: Node.js led runtime use among respondents.
- nodejs.org/api/util.html#utilparseargsconfig: Node ships a parser for basic flags and positional arguments.
- mrkeyoor.com/libs/commander: Hands-on review describes Commander's scope and the need for companion UI tools.
Helps a lot8.3
How well does it do the job for those who need it?
Claude Opus 5.5: 8.0, likely 7.0 to 8.5
It is a mature, correct and well-documented parser with subcommands, help groups, choices, env options and good error messages. Its limits are weaker type inference than schema-first tools, no shell completions and less built-in validation than yargs. For most CLIs it is the clearest API available.
- pkgpulse.com/guides/commander-vs-yargs-2026: Commander is simpler and has zero deps. yargs has richer validation, completions and middleware
- bloomberg.github.io/stricli/docs/getting-started/alternatives: Method chaining makes end-to-end static typing hard
- github.com/tj/commander.js/releases: v15.1.0 fixes edge cases in parsing and help
GPT-6.2 Sol: 8.6, likely 7.5 to 9.6
Commander 15.1.0 handles nested commands, option conflicts, environment-backed flags, and useful errors with a well-documented API. The examples give coding agents a clear pattern for standard handlers, while inferred option and handler types require separate typings. One small benchmark found Commander 15.0 faster than citty at defining and parsing a simple command, with end-to-end startup performance still uncertain.
- github.com/tj/commander.js: Documents validation, help, errors, async parsing, and testing.
- github.com/commander-js/extra-typings: Separate package infers types from option and argument declarations.
- github.com/tj/commander.js/issues/2683: A v15.1 user reported a mismatch in the alias getter type.
- shoppercove.com/blog/citty-vs-commander: Commander was about twice as fast on one in-process workload on Node 20.19.
Holds up over time8.4
Will it still be a good choice in two years?
Claude Opus 5.5: 8.5, likely 7.5 to 9.0
Maintenance is steady: 86 commits and 4 releases in the last year, only 7 open issues and no open PRs. There is a written support policy for old majors. Breaking changes are announced with prerelease builds and migration notes. Risks: volunteers maintain it without clear funding, and the move to ESM-only adds friction for some users.
- github.commitsLastYear: 86 commits, latest release Nov 2026
- github.openIssues: 7 open vs 1166 closed issues
- github.com/tj/commander.js/releases: v14 gets security updates to May 2027. v15 is ESM-only and needs Node 22.12
GPT-6.2 Sol: 8.2, likely 7.1 to 9.2
The project logged 86 commits in a year, and multiple maintainers reviewed a Unicode parsing fix that shipped in November. Commander 14 gets security fixes through May 2027, giving teams time to absorb the ESM move and higher Node.js floor in v15. Sustained funding and the number of maintainers able to publish to npm remain unclear.
- github.commitsLastYear, github.releasesLastYear: 86 commits and four GitHub releases in the last year.
- github.com/tj/commander.js/pull/2615: Several reviewers helped merge a user-contributed fix in September that shipped in November.
- github.com/tj/commander.js/releases/tag/v15.0.0: Documents the ESM migration, minimum Node version, and v14 support window.
- github.com/sponsors/shadowspawn: A maintainer accepts sponsorship and lists Commander among their main projects.
Used widely9.0
How many use it, and is that growing?
Claude Opus 5.5: 9.5, likely 9.0 to 10.0
About 3.0B downloads in 4 weeks and over 1M dependent repos put it at the top of the category. Most downloads are transitive. Its year-over-year ratio of about 3.1 is below the 4.1 median, so it is slowly losing share to newer tools like citty, CAC and Clack, but from a very large base.
- npm downloadsLast4Weeks: 2.99B now vs 0.95B a year ago, ratio about 3.1
- dependents.packages: 74,942 dependent packages
- medianDownloadsRatio: Median is 4.1, so growth is below the market
GPT-6.2 Sol: 8.4, likely 7.3 to 9.4
Ecosyste.ms found 1.08 million dependent repositories and about 75,000 dependent packages, putting Commander well ahead of CAC and citty on recorded use and behind yargs on repository count. Downloads grew 3.14× year over year, below the 4.1× catalog baseline and behind both CAC and citty. Automated installs and indirect use through tools such as Terser make the nearly 3 billion monthly downloads a poor measure of how often teams choose Commander today.
- dependents.repos, dependents.packages, peers: Large recorded dependency base, with yargs ahead on dependent repositories.
- npm.downloadsLast4Weeks, npm.downloadsSame4WeeksYearAgo, medianDownloadsRatio, peers: Commander grew 3.14×, CAC 4.18×, and citty 6.19× against a 4.1× baseline.
- github.com/terser/terser/blob/master/package.json: Terser pulls in Commander 2 as a dependency.
Vouched for8.0
Who stands behind it being good?
Claude Opus 5.5: 8.0, likely 7.0 to 9.0
Independent 2026 comparison guides recommend it as the default for most CLIs. Many widely used tools build on it. It has no survey coverage and almost no recent discussion on HN or Bluesky, which keeps the score below the top.
- pkgpulse.com/guides/commander-vs-yargs-2026: Verdict: Commander's simplicity wins for most CLIs
- dependents.packages: About 75k npm packages depend on it
- bluesky.posts: Only 2 posts, but one user names it a standard part of their stack
GPT-6.2 Sol: 8.0, likely 6.9 to 9.0
Webpack CLI uses Commander to customize its help output, and Vercel's create-next-app uses it to define and parse its flags. An independent test also confirmed that Commander 15.0 loads from both ESM and CommonJS on Node 22. The two downstream tools use older Commander majors, and the developer reports provide too little coverage to estimate v15 satisfaction.
- github.com/webpack/webpack-cli/blob/main/CHANGELOG.md: Webpack CLI 7.1 shipped custom help built with Commander.
- github.com/webpack/webpack-cli/blob/main/packages/webpack-cli/package.json: Webpack CLI declares Commander 14.
- github.com/vercel/next.js/blob/canary/packages/create-next-app/index.ts: Vercel uses Commander directly in its app scaffolding CLI.
- github.com/vercel/next.js/blob/canary/packages/create-next-app/package.json: Create-next-app pins Commander 12.
- mrkeyoor.com/libs/commander: Independent fresh-install test confirmed both module entry points on Node 22.
- bsky.app/profile/davidcrespo.bsky.social/post/3mkusxo33t22e: A developer reports using Commander as part of their Deno scripting stack.
Safe8.7
How safe is it to depend on?
Claude Opus 5.5: 9.0, likely 8.0 to 9.5
It has zero dependencies, no known advisories, an MIT licence and a Scorecard of 7.7 with strong workflow, pinning and SAST checks. The weak checks are branch protection, fuzzing and CII best practices.
- npm dependencies: 0 dependencies
- advisories.total: No advisories ever
- scorecard.score: 7.7, with Branch-Protection and Fuzzing at 0
GPT-6.2 Sol: 8.4, likely 7.3 to 9.4
Commander has zero runtime dependencies, a permissive MIT license, and zero advisories in OSV. OpenSSF scored code review and workflow controls well, with zeros for branch protection and fuzzing. The available evidence leaves npm publisher access, package provenance, and release signing uncertain.
- npm.dependencies, npm.license, advisories.total: Zero runtime dependencies, MIT license, and zero OSV advisories.
- scorecard.score, scorecard.checks: 7.7 overall, code review 9, branch protection and fuzzing 0, packaging and signed releases unscored.
- github.com/tj/commander.js/releases/tag/v15.1.0: GitHub identifies the release author and source commit.
- github.com/tj/commander.js/blob/master/docs/release-policy.md: The policy commits to 12 months of security fixes for maintenance lines.
Good
- It has no runtime dependencies, so a published CLI stays small and carries few supply-chain risks.
- Its API is simple and well documented, with subcommands, help generation, env-var options, choices and mandatory options, and AI agents write it correctly most of the time.
- It is actively maintained, with a written release policy that gives old major versions 12 months of security fixes.
- It has a very large user base (over a million dependent repos), so examples and answers are easy to find.
Bad
- It only parses arguments. Prompts and interactive terminal UIs need another library, such as Clack, Inquirer or Ink.
- Method chaining limits end-to-end type inference. Strong typing needs the separate @commander-js/extra-typings package.
- v15 is ESM-only and needs Node 22.12 or newer, which breaks some CommonJS test setups and projects still on Node 20.
- It has fewer built-in features than yargs: no shell completions, no middleware, and only light validation.
The numbers
- npm downloads, 4 weeks
- 3B ×3.1 in a year
- GitHub stars
- 28k
- Commits, 12 months
- 86
- npm version
- 15.1.0 Nov 2026
- Versions, 12 months
- 3
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- 7.7 out of 10, Nov 2026
- Licence
- MIT
Read on 21 November 2026 from GitHub (tj/commander.js), npm (commander), OSV and the OpenSSF Scorecard.