Skip to content
Commands

kubb update

The update command moves installed Kubb extensions to the version the Kubb extension registry pins, or lists the available updates with --check.

Run kubb update to move installed extensions to the version the Kubb registry pins. It lists the updates, asks for confirmation, and installs them. It does not change kubb.config.ts.

Usage

Update every installed extension the registry lists:

Terminal
kubb update

List the updates without installing them:

Terminal
kubb update --check

Update two extensions without the confirmation:

Terminal
kubb update plugin-zod plugin-ts --yes

Arguments

ArgumentRequiredDescription
[ids...]falseRegistry ids to update, as <owner>/<slug> or a bare <slug> for kubb-labs/<slug>. Without ids, every installed extension the registry lists is checked.

Options

OptionDefaultDescription
--checkfalseList the available updates without installing them.
--yes, -yfalseSkip the confirmation.

What it does

  1. Fetches <registry>/index.json. Entries that fail validation are skipped.
  2. Matches each entry's artifact.package against the dependencies and devDependencies in package.json of the current directory.
  3. Reads the installed version of each match from node_modules. An entry gets an update when the installed version is older than the pinned one, or when the package is not installed. A version newer than the pin is left alone, so kubb update never downgrades.
  4. Checks each update's manifest compatibility against the running Kubb and Node.js versions. An incompatible update is skipped with Skipped <id>: <reason>.
  5. Prints one line per update, <package> <installed> -> <pinned>. With --check, it stops here.
  6. Asks Install <n> updates? unless you pass --yes, then installs every <package>@<version> in one run of the package manager.

An id that matches no installed extension prints <id> is not installed, or not in the registry. and the other ids still update. When nothing is outdated, the CLI prints Every installed extension is up to date.

The package manager is detected the same way as in kubb add.

Environment variables

VariableDefaultDescription
KUBB_REGISTRYhttps://kubb.dev/registryBase URL of the registry to read. See Host your own registry.

Exit codes

kubb update exits with code 1 when an id is invalid, the registry index cannot be read or is invalid, or the install fails. It exits with code 0 when there is nothing to update, with --check, and when you cancel at the prompt.

See also