Skip to content
Commands

kubb remove

The remove command deletes a plugin or parser from kubb.config.ts and uninstalls its package.

Run kubb remove to delete a plugin or parser from kubb.config.ts and uninstall its package. It shows the lines it removes and asks before it changes anything.

Usage

Remove a plugin:

Terminal
kubb remove plugin-zod
Output
◇  Plugin plugin-zod v5.13.0
│  Config    kubb.config.ts
│    - import { pluginZod } from '@kubb/plugin-zod'
│    - pluginZod({ output: { path: 'zod' } }),
│  Uninstalls @kubb/plugin-zod
│
◆  Remove it?
│  Yes
│
◇  pluginZod() removed from kubb.config.ts

✓ Plugin removed  3.42s

  Packages  @kubb/plugin-zod uninstalled with pnpm

Next     kubb generate

Files the plugin generated stay on disk until the next kubb generate.

Keep the package installed:

Terminal
kubb remove plugin-zod --no-uninstall

Arguments

ArgumentRequiredDescription
<id>trueRegistry id, as <owner>/<slug> or a bare <slug> for kubb-labs/<slug>.

Options

OptionDefaultDescription
--config, -ckubb.config.tsPath to the Kubb config file.
--yes, -yfalseRemove without asking.
--no-uninstallEdit the config only and keep the package installed.

What it removes

kubb remove deletes the plugin or parser from the config, also when Kubb Studio switched it off, and drops its unused import. With several config entries, it edits the first one.

It does not remove:

  • the adapter. A config needs one.
  • the last parser. A config needs at least one.
  • an extension another one depends on. Remove that one first.

@kubb/adapter-oas, @kubb/parser-ts, @kubb/parser-md, and @kubb/plugin-barrel ship with kubb. They leave the config but stay installed.

Environment variables

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

Exit codes

kubb remove exits with code 1 when it cannot remove the extension or the uninstall fails. It exits with code 0 when the extension is removed, was not in the project, or you cancel.