npm / yargs
yargs
What changed in yargs 7 to 18, from its official release notes, upgrade guides and advisories. Also covers @types/yargs. Sources checked 2026-11-30.
34 breaking1 security18 new APIs and options14 behavior and defaults30 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inityargs 1822 changes
Breaking changes 5
The process now exits after an asynchronous handler is done.
Command names are no longer derived from modules passed to command; specify command names explicitly.
The minimum supported Node.js versions are now ^20.19.0, ^22.12.0, or >=23.
Singleton usage, including yargs.foo and yargs().argv, has been removed.
Yargs is now ESM first, affecting how developers use it in ESM projects.
Security 1
Fixes a local prototype pollution vulnerability in apply-extends.
New APIs and options 2
Completions can now be created for the fish shell.
The visit option can be used to extend ESM module commands.
Behavior and default changes 3
Bun is ignored when yargs determines the bin name.
commandDir now works with ESM files.
Zsh completion now uses default completion as a fallback.
Fixes and other changes 11
Removes a spurious single quote from zsh loadautofunc detection.
Fixes the 'count' translation for the de locale.
Adds a Georgian translation.
Bash completion now handles spaces.
coerce now works with parser configuration.
Absolute command directories are now supported.
The value type now propagates Dictionary values that include undefined.
A Hebrew translation is available for localized yargs output.
Parser configuration now works with generated completion scripts.
Browser shims were fixed so yargs continues working in browser contexts.
Autoloaded zsh completion no longer requires a double tab.
yargs 1721 changes
Breaking changes 7
Coercion is applied before validation, and async coerce functions are supported.
getCompletion invokes its callback with err and completions, and returns a promise of completions.
Parsing now returns a promise when a handler is async.
Node 10 is no longer supported.
onFinishCommand is removed; callers can await the promise instead.
The deprecated reset() method is now private; call yargs() instead.
yargs now returns a promise if async operations or checks are asynchronous.
New APIs and options 6
Async builders are supported, and nested builders are awaited.
Adds a commands alias, similar to the options function.
Custom completion functions can call the standard completion function and reference or modify the default completion.
Adds parseSync and parseAsync methods.
Adds support for showVersion, similar to showHelp.
Adds a Ukrainian locale.
Behavior and default changes 2
Async middleware can run before validation, and global middleware runs when no command is configured.
.positional() is now allowed at the root level of yargs.
Fixes and other changes 6
Uses an entry point with a file extension for targets that support exports.
Positionals are excluded from default completion.
Help messages are always cached when running commands.
The parse callback is called only after asynchronous operations complete.
showHelp() and .getHelp() now return the same output for commands as --help.
Zsh completion is now autoloadable.
yargs 1615 changes
Breaking changes 6
An export map limits which files can be imported in Node 12 and later.
This API is renamed to hideBin.
Renames getProcessArgvWithoutBin to hideBin.
Support for EOL Node 8 is dropped.
The rebase helper is no longer provided on the yargs instance and is now a blessed helper.
The ESM/Deno API now exports the yargs function by default.
New APIs and options 4
Adds support for using yargs with ESM and Deno.
Adds i18n support for ESM and Deno.
Adds strictOptions() to enable strict option handling.
Types are now exported for Deno.
Behavior and default changes 3
applyExtends is now available as a blessed helper.
Single-character aliases are shown first in help output.
Parser is now available as a blessed helper.
Fixes and other changes 2
The yargs export now uses an entry point with a .cjs file extension.
Fixes the missing command(module) signature.
yargs 156 changes
Breaking changes 3
Node 6 is no longer supported.
The package.json-based parserConfiguration was removed.
yargs-parser now throws on invalid combinations of config.
New APIs and options 1
Parser is now exposed from require('yargs/yargs').
Fixes and other changes 2
An update to yargs-parser fixes array default values.
stop-parse is now respected by commands.
yargs 910 changes
Breaking changes 3
help() is enabled by default and appears in help output; it can now be disabled, and the implicit help command cannot be enabled or disabled independently.
parse() behaves as an alias for .argv unless a parseCallback is provided.
version() is enabled by default and appears in help output.
Behavior and default changes 3
conflicts now accepts array values.
implies now accepts array values.
Both undefined and null values are allowed, for TypeScript compatibility.
Fixes and other changes 4
An undefined default value no longer causes choices validation to fail.
Positional arguments are excluded from completion output.
Defaulting keys to undefined no longer interferes with conflicting key logic.
Strict mode no longer fails for hidden options.
yargs 87 changes
Breaking changes 5
Commands are now applied from left to right, so their order affects how they are applied.
extends now always loads the provided JSON instead of reading from a specific key.
Help now takes precedence over command recommendation.
Node 4+ is now required, enabling the project to update its dependencies.
The first argument to strict() now enables or disables strict mode, rather than controlling whether it is global.
Behavior and default changes 1
extends can now inherit from a module.
Fixes and other changes 1
Positional arguments now work when an inner command has no handler.
yargs 716 changes
Breaking changes 5
Context takes precedence over parsed argv and defaults.
Environment variables now take precedence over config files.
Errors not generated internally are no longer aggressively suppressed and can bubble from sub-commands to the top level.
Arguments passed to functions are validated, which may throw exceptions when the API is used unexpectedly.
Options and many parsing helpers are applied globally by default and are no longer reset before being passed into commands.
New APIs and options 5
Supports default commands using the '*' identifier.
Adds a shorthand for declaring conflicting options.
Introduces a custom yargs error object.
The extends key in a config file is used to extend other config files.
Adds a shorthand for declaring implied options.
Behavior and default changes 2
Incorrect API signatures produce console.warn() messages rather than throwing errors.
When only one column is provided for examples, it can take up the entire line.
Fixes and other changes 4
Context variables are recognized in strict mode.
Fixes a regression in min/max validation messages.
Calling parse() multiple times on the same yargs instance no longer causes an exception when help() is enabled.
Fixes strict-mode handling of positional arguments, including positional arguments of sub-commands.