unstale

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 init

@unstale/cli on npm

yargs 1822 changes

Breaking changes 5

  • The process now exits after an asynchronous handler is done.

    18.0.0release notes

  • Command names are no longer derived from modules passed to command; specify command names explicitly.

    18.0.0release notes

  • The minimum supported Node.js versions are now ^20.19.0, ^22.12.0, or >=23.

    18.0.0release notes

  • Singleton usage, including yargs.foo and yargs().argv, has been removed.

    18.0.0release notes

  • Yargs is now ESM first, affecting how developers use it in ESM projects.

    18.0.0release notes

Security 1

  • Fixes a local prototype pollution vulnerability in apply-extends.

    18.1.0release notes

New APIs and options 2

  • Completions can now be created for the fish shell.

    18.2.0release notes

  • The visit option can be used to extend ESM module commands.

    18.0.0release notes

Behavior and default changes 3

  • Bun is ignored when yargs determines the bin name.

    18.1.0release notes

  • commandDir now works with ESM files.

    18.0.0release notes

  • Zsh completion now uses default completion as a fallback.

    18.0.0release notes

Fixes and other changes 11

  • Removes a spurious single quote from zsh loadautofunc detection.

    18.2.0release notes

  • Fixes the 'count' translation for the de locale.

    18.1.0release notes

  • Adds a Georgian translation.

    18.1.0release notes

  • Bash completion now handles spaces.

    18.0.0release notes

  • coerce now works with parser configuration.

    18.0.0release notes

  • Absolute command directories are now supported.

    18.0.0release notes

  • The value type now propagates Dictionary values that include undefined.

    18.0.0release notes

  • A Hebrew translation is available for localized yargs output.

    18.0.0release notes

  • Parser configuration now works with generated completion scripts.

    18.0.0release notes

  • Browser shims were fixed so yargs continues working in browser contexts.

    18.0.0release notes

  • Autoloaded zsh completion no longer requires a double tab.

    18.0.0release notes

yargs 1721 changes

Breaking changes 7

  • Coercion is applied before validation, and async coerce functions are supported.

    17.0.0release notes

  • getCompletion invokes its callback with err and completions, and returns a promise of completions.

    17.0.0release notes

  • Parsing now returns a promise when a handler is async.

    17.0.0release notes

  • Node 10 is no longer supported.

    17.0.0release notes

  • onFinishCommand is removed; callers can await the promise instead.

    17.0.0release notes

  • The deprecated reset() method is now private; call yargs() instead.

    17.0.0release notes

  • yargs now returns a promise if async operations or checks are asynchronous.

    17.0.0release notes

New APIs and options 6

  • Async builders are supported, and nested builders are awaited.

    17.0.0release notes

  • Adds a commands alias, similar to the options function.

    17.0.0release notes

  • Custom completion functions can call the standard completion function and reference or modify the default completion.

    17.0.0release notes

  • Adds parseSync and parseAsync methods.

    17.0.0release notes

  • Adds support for showVersion, similar to showHelp.

    17.0.0release notes

  • Adds a Ukrainian locale.

    17.0.0release notes

Behavior and default changes 2

  • Async middleware can run before validation, and global middleware runs when no command is configured.

    17.0.0release notes

  • .positional() is now allowed at the root level of yargs.

    17.0.0release notes

Fixes and other changes 6

  • Uses an entry point with a file extension for targets that support exports.

    17.7.3release notes

  • Positionals are excluded from default completion.

    17.0.0release notes

  • Help messages are always cached when running commands.

    17.0.0release notes

  • The parse callback is called only after asynchronous operations complete.

    17.0.0release notes

  • showHelp() and .getHelp() now return the same output for commands as --help.

    17.0.0release notes

  • Zsh completion is now autoloadable.

    17.0.0release notes

yargs 1615 changes

Breaking changes 6

  • An export map limits which files can be imported in Node 12 and later.

    16.0.0release notes

  • This API is renamed to hideBin.

    16.0.0release notes

  • Renames getProcessArgvWithoutBin to hideBin.

    16.0.0release notes

  • Support for EOL Node 8 is dropped.

    16.0.0release notes

  • The rebase helper is no longer provided on the yargs instance and is now a blessed helper.

    16.0.0release notes

  • The ESM/Deno API now exports the yargs function by default.

    16.0.0release notes

New APIs and options 4

Behavior and default changes 3

  • applyExtends is now available as a blessed helper.

    16.0.0release notes

  • Single-character aliases are shown first in help output.

    16.0.0release notes

  • Parser is now available as a blessed helper.

    16.0.0release notes

Fixes and other changes 2

  • The yargs export now uses an entry point with a .cjs file extension.

    16.2.2release notes

  • Fixes the missing command(module) signature.

    16.0.0release notes

yargs 156 changes

Breaking changes 3

  • Node 6 is no longer supported.

    15.0.0release notes

  • The package.json-based parserConfiguration was removed.

    15.0.0release notes

  • yargs-parser now throws on invalid combinations of config.

    15.0.0release notes

New APIs and options 1

  • Parser is now exposed from require('yargs/yargs').

    15.0.0release notes

Fixes and other changes 2

  • An update to yargs-parser fixes array default values.

    15.0.0release notes

  • stop-parse is now respected by commands.

    15.0.0release notes

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.

    9.0.0release notes

  • parse() behaves as an alias for .argv unless a parseCallback is provided.

    9.0.0release notes

  • version() is enabled by default and appears in help output.

    9.0.0release notes

Behavior and default changes 3

  • conflicts now accepts array values.

    9.0.0release notes

  • implies now accepts array values.

    9.0.0release notes

  • Both undefined and null values are allowed, for TypeScript compatibility.

    9.0.0release notes

Fixes and other changes 4

  • An undefined default value no longer causes choices validation to fail.

    9.0.0release notes

  • Positional arguments are excluded from completion output.

    9.0.0release notes

  • Defaulting keys to undefined no longer interferes with conflicting key logic.

    9.0.0release notes

  • Strict mode no longer fails for hidden options.

    9.0.0release notes

yargs 87 changes

Breaking changes 5

  • Commands are now applied from left to right, so their order affects how they are applied.

    8.0.0release notes

  • extends now always loads the provided JSON instead of reading from a specific key.

    8.0.0release notes

  • Help now takes precedence over command recommendation.

    8.0.0release notes

  • Node 4+ is now required, enabling the project to update its dependencies.

    8.0.0release notes

  • The first argument to strict() now enables or disables strict mode, rather than controlling whether it is global.

    8.0.0release notes

Behavior and default changes 1

Fixes and other changes 1

  • Positional arguments now work when an inner command has no handler.

    8.0.0release notes

yargs 716 changes

Breaking changes 5

  • Context takes precedence over parsed argv and defaults.

    7.0.0release notes

  • Environment variables now take precedence over config files.

    7.0.0release notes

  • Errors not generated internally are no longer aggressively suppressed and can bubble from sub-commands to the top level.

    7.0.0release notes

  • Arguments passed to functions are validated, which may throw exceptions when the API is used unexpectedly.

    7.0.0release notes

  • Options and many parsing helpers are applied globally by default and are no longer reset before being passed into commands.

    7.0.0release notes

New APIs and options 5

  • Supports default commands using the '*' identifier.

    7.0.0release notes

  • Adds a shorthand for declaring conflicting options.

    7.0.0release notes

  • Introduces a custom yargs error object.

    7.0.0release notes

  • The extends key in a config file is used to extend other config files.

    7.0.0release notes

  • Adds a shorthand for declaring implied options.

    7.0.0release notes

Behavior and default changes 2

  • Incorrect API signatures produce console.warn() messages rather than throwing errors.

    7.0.0release notes

  • When only one column is provided for examples, it can take up the entire line.

    7.0.0release notes

Fixes and other changes 4

  • Context variables are recognized in strict mode.

    7.0.0release notes

  • Fixes a regression in min/max validation messages.

    7.0.0release notes

  • Calling parse() multiple times on the same yargs instance no longer causes an exception when help() is enabled.

    7.0.0release notes

  • Fixes strict-mode handling of positional arguments, including positional arguments of sub-commands.

    7.0.0release notes