yargs
A strong pick. 6th of 10 CLI frameworks and prompts.
yargs is a mature, feature-rich Node.js argument parser. It has built-in validation, help, i18n, middleware and shell completion. It still works well and is maintained, but releases are slow and its TypeScript inference is weaker than Commander's. Its share of downloads is also growing more slowly than the market, so it is a reasonable pick but no longer the default.
Best for: Teams building flag-heavy or internal Node CLIs that want built-in validation, coercion, middleware and shell completion out of the box.
Scores
Overall7.0
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
yargs is solid, safe and feature-rich, and the right tool when you need built-in validation and shell completion. For most new TypeScript CLIs, Commander is lighter, better typed and more actively developed, and citty or CAC suit minimal tools. Slow development and a shrinking relative share keep it below the top.
- peers Commander: More commits, more downloads and zero dependencies
- pistack.xyz/posts/2026-08-23-nodejs-cli-libraries-commander-yargs-meow-comparison: Recommends Commander for typed multi-command tools and yargs for flag-heavy ones
- npm downloads ratio: 2.9 vs 4.1 median, losing ground
GPT-6.2 Sol: 7.9, likely 6.8 to 8.9
yargs is a strong pick when a modern Node.js CLI needs substantial argument parsing, layered configuration, and shell completion. Commander.js is a simpler default for ordinary command trees, with bundled types and lower startup overhead in the available comparison. Current use in Angular CLI supports choosing yargs for demanding tools, while slower relative adoption and v18 migration friction temper the recommendation.
- github.com/yargs/yargs/blob/v18.2.0/docs/api.md: Shows the depth of yargs' command and configuration features.
- github.com/tj/commander.js/blob/master/package.json: Commander.js bundles TypeScript declarations.
- github.com/ofri-peretz/burgee: Measures lower startup overhead for Commander.js in one workload.
- github.com/yargs/yargs/issues/2603: Documents v18 migration changes, including ESM and removal of singleton usage.
- github.com/angular/angular-cli/blob/main/packages/angular/cli/package.json: Confirms adoption of the current release by a major developer tool.
- npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo, medianDownloadsRatio: Download growth trails the catalog baseline.
Needed by many5.3
How many developers need a tool for this job?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
Many JS/TS developers write CLIs or scripts that need argument parsing, but most app work does not. yargs covers only the parsing part of the category, not prompts or terminal UI.
- category scope: Argument parsing is common in tooling but not needed in most app code
- dependents.packages: 42,638 packages depend on it, so CLI parsing is a widespread need
GPT-6.2 Sol: 4.6, likely 3.5 to 5.8
Argument parsing and generated help are useful across developer tools, automation scripts, and internal CLIs. yargs mainly serves projects that build a CLI, and companion libraries cover prompts and richer terminal interfaces. The developer survey establishes that Node.js is widespread, while demand for building CLIs remains harder to measure.
- survey.stackoverflow.co/2026/technology/data: Shows broad Node.js usage across surveyed developers.
- github.com/yargs/yargs: Documents the Node.js CLI use case, generated help, and browser support.
- github.com/yargs/yargs/blob/v18.2.0/docs/api.md: Documents the parser and its terminal help features.
Helps a lot7.5
How well does it do the job for those who need it?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
It is the most feature-complete classic parser, with validation, middleware, commandDir, completion and i18n. Clear limits remain: TypeScript inference is weak, the API is verbose for simple commands, and parsing is permissive unless you turn on strict mode. Independent comparisons rate it best for complex flag sets, but they prefer Commander for typed multi-command tools.
- pkgpulse.com/guides/commander-vs-yargs-2026: Praises its validation and completion; calls it heavier and more verbose than Commander
- pistack.xyz/posts/2026-08-23-nodejs-cli-libraries-commander-yargs-meow-comparison: Recommends it for flag-heavy tools; says strict mode is needed and large command trees get awkward
- github.com/yargs/yargs/issues/2397: User reports having to cast args in TypeScript
- github.com/DefinitelyTyped/DefinitelyTyped/issues/68089: Reports a typing bug in @types/yargs default values
GPT-6.2 Sol: 8.0, likely 7.0 to 9.0
Version 18.2 handles nested commands, layered configuration, and localized help, and adds fish completions. The API reference includes examples for developers and coding agents, but TypeScript users report gaps in command-specific inference. A competing library's benchmark measured slower startup than Commander.js and CAC on one workload. That single workload and the limited evidence on agent-generated code leave room around the score.
- github.com/yargs/yargs/blob/v18.2.0/docs/api.md: Documents option validation, configuration precedence, help, and failure handling.
- github.com/yargs/yargs/releases/tag/v18.2.0: Adds fish completions and fixes a Zsh completion bug.
- github.com/yargs/yargs/issues/2487: A user reports a gap in command-specific type inference.
- reddit.com/r/typescript/comments/1sx37tj/tanstack_routerstyle_endtoend_inference_for: A CLI author reports maintaining parallel types by hand.
- github.com/ofri-peretz/burgee: A third-party Node 24 benchmark measured higher cold-start overhead for yargs than for Commander.js or CAC.
Holds up over time6.7
Will it still be a good choice in two years?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
It is still maintained: four releases in the last year, the latest in September 2026, and only 3 open pull requests. But it had 35 commits in a year, far fewer than Commander or Clack, and it relies on a small volunteer core. The v18 ESM and singleton changes broke existing code, and its relative download share is shrinking.
- github.commitsLastYear: 35 commits, low activity compared with peers
- github.com/yargs/yargs/releases: 18.1.0 in Jul 2026 and 18.2.0 in Sep 2026; v18 had breaking changes
- newreleases.io/project/npm/yargs/release/18.0.0: v18 is ESM-first, drops the singleton API and needs Node 20.19+
- scorecard Maintained: Maintained check scores 10
GPT-6.2 Sol: 7.4, likely 6.2 to 8.5
Four releases and 35 commits in the past year show ongoing maintenance at a slower pace than Commander.js. The project published a release policy and received a HeroDevs donation in 2026. Maintainers patched older branches for a Node.js compatibility break, while a newer config regression remains open. Funding continuity and the number of people who can approve releases are unclear.
- github commitsLastYear, github releasesLastYear, github openIssues, peers Commander.js: yargs had 35 commits and four releases, compared with 86 Commander.js commits.
- github.com/yargs/yargs/blob/main/docs/release-policy.md: Defines support for the current and older release lines.
- github.com/yargs/yargs/commit/f444858808bc11e9910fc5ed0d0322dc40d5638e: Records a HeroDevs donation in 2026.
- github.com/yargs/yargs/issues/2509: Tracks the Node.js compatibility break and backports for older lines.
- github.com/yargs/yargs/issues/2628: Tracks an open regression in resolving nested config paths.
Used widely8.0
How many use it, and is that growing?
Claude Opus 5.5: 8.0, likely 7.0 to 9.0
1.5 billion downloads in 4 weeks and about 4.9 million dependent repos are huge, but much of that comes in through Jest, Mocha and other tools. Its year-over-year ratio of 2.9 is below the 4.1 median, so it is losing ground. Fewer new projects choose it directly than Commander.
- npm downloadsLast4Weeks: 1.51B now vs 521M a year ago, a ratio of 2.9 against the 4.1 median
- dependents.repos: 4.89M repos, largely through transitive installs
- peers Commander downloadsLast4Weeks: Commander has about twice the downloads
GPT-6.2 Sol: 8.0, likely 6.8 to 9.1
The collector found 4.89 million dependent repositories and 42,638 dependent npm packages, indicating substantial installed reach. Downstream tools such as Jest bring yargs into projects indirectly, and automated installs inflate the download total. Downloads grew 2.89× year over year, below the 4.1× catalog median, Commander.js at 3.14×, and citty at 6.2×. That points to declining relative share, while direct choices for new projects remain hard to count.
- dependents repos, dependents packages, peers dependentRepos: yargs leads the supplied repository counts, with partial ecosystem coverage.
- npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo, medianDownloadsRatio, peers: Downloads rose from 521 million to 1.51 billion, below the catalog growth baseline.
- github stars, bluesky posts, hackerNews stories, peers: 11,509 stars show accumulated interest, with sparse recent discussion in the sampled channels.
- github.com/jestjs/jest/blob/main/packages/jest-cli/package.json: Jest CLI still pulls in the older yargs 17 line.
Vouched for7.6
Who stands behind it being good?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
Major tools have run it in production for years, including Jest, Mocha, Angular CLI and Nx. Independent 2026 comparisons still recommend it for complex CLIs. Developer surveys give no current satisfaction data, and community attention is almost nil (no HN stories, 1 Bluesky post).
- jest-cli, mocha, @angular/cli, nx: Large projects that depend on yargs
- pkgpulse.com/guides/commander-vs-yargs-2026: Independent guide recommends it for complex CLIs
- bluesky.posts: Only 1 post, low current buzz
GPT-6.2 Sol: 8.2, likely 7.1 to 9.0
Angular CLI and Google Chrome's Lighthouse both depend on yargs 18.2 for their shipped tooling. Jest supplies further evidence of real-world use on the older v17 line. These are independent examples of adoption, while direct satisfaction data is sparse and the available performance comparison covers one workload.
- github.com/angular/angular-cli/blob/main/packages/angular/cli/package.json: Angular CLI pins yargs 18.2.0.
- github.com/GoogleChrome/lighthouse/blob/main/package.json: Lighthouse declares yargs 18.2 as a runtime dependency.
- github.com/jestjs/jest/blob/main/packages/jest-cli/package.json: Jest CLI declares yargs 17 as a runtime dependency.
- github.com/ofri-peretz/burgee: An independently authored benchmark reports a startup disadvantage.
Safe7.9
How safe is it to depend on?
Claude Opus 5.5: 8.0, likely 7.0 to 9.0
OSV lists no advisories, the licence is MIT, and the Scorecard is 7.3 with strong workflow and token checks. A local prototype-pollution bug in apply-extends was fixed in 18.1.0. Its six dependencies come mostly from the yargs org itself. Weak spots are code review (4) and the lack of SAST and fuzzing.
- advisories.total: 0 known advisories
- scorecard.score: 7.3, with Code-Review at 4 and SAST at 0
- github.com/yargs/yargs/releases: Prototype pollution fix in 18.1.0
- npm dependencies: 6 runtime dependencies
GPT-6.2 Sol: 7.7, likely 6.6 to 8.8
yargs has an MIT license, six direct runtime dependencies, and a GitHub Actions workflow configured for staged npm publishing with provenance. The advisory feed lists zero entries for yargs, and the project documented a local prototype-pollution fix in 18.1. OpenSSF reports strong workflow permissions and a security policy, alongside a 4 out of 10 for code review and zeros for fuzzing and static analysis. Release approval access remains unclear.
- npm license, npm dependencies, advisories total: MIT, six direct dependencies, and zero advisories in the supplied feed.
- scorecard score, scorecard checks: 7.3 overall, with strong workflow controls and weaker review and testing signals.
- github.com/yargs/yargs/blob/v18.2.0/.github/workflows/release-please.yml: Configures staged npm publication with OIDC and provenance.
- github.com/yargs/yargs/releases/tag/v18.1.0: Documents a local prototype-pollution fix.
- github.com/advisories/GHSA-p9pc-299p-vxgp: A historical yargs-parser advisory was fixed in versions older than the v22 dependency used today.
Good
- Built-in validation, type coercion, choices, implies/conflicts and strict mode, with no extra code needed.
- Generates shell completion for bash, zsh and fish (fish support added in 18.2.0).
- Help output is auto-generated and localized in many languages.
- Used by Jest, Mocha, Angular CLI and Nx, so its edge cases are well tested.
Bad
- TypeScript inference is weaker than Commander's: types come from @types/yargs and often need casts or `as const`.
- Has about six dependencies and a larger install footprint than zero-dependency Commander or CAC.
- Version 18 made it ESM-first, removed the singleton API and raised the minimum Node version, so upgrades need code changes.
- Development is slow (35 commits, 4 releases in a year) and depends on a small group of maintainers.
The numbers
- npm downloads, 4 weeks
- 1.5B ×2.9 in a year
- GitHub stars
- 12k
- Commits, 12 months
- 35
- npm version
- 18.2.0 Sept 2026
- Versions, 12 months
- 4
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- 7.3 out of 10, Nov 2026
- Licence
- MIT
Read on 21 November 2026 from GitHub (yargs/yargs), npm (yargs), OSV and the OpenSSF Scorecard.