Skip to content
Commands

kubb remove

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

kubb remove deletes a plugin or parser from your kubb.config.ts and uninstalls its package. It shows the lines it removes and asks first.

Ids, versions, and project files work as in Extension commands.

Terminal
kubb remove plugin-zod                  # remove and uninstall
kubb remove plugin-zod --no-uninstall   # keep the package installed
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?

Arguments

ArgumentRequiredWhat it does
<id>YesThe registry id.

What it removes

kubb remove drops the call and its unused import. It leaves the generated files on disk. With output.clean, the next kubb generate removes them.

It refuses to removeBecause
The adapterA config needs one. Change it by hand.
The last parserA config needs at least one.
An extension another plugin in the config depends onRemove that plugin first.

Extensions that ship with kubb, such as @kubb/plugin-barrel and @kubb/parser-md, leave the config but stay installed. See Command output.

Options

FlagAliasDefaultWhat it does
--config <path>-cPath to the Kubb config to edit.
--yes-yfalseSkip the confirmation.
--no-uninstallEdit the config only and keep the package installed.
--dry-runfalseShow what the command would uninstall or write, then stop.
Pass --yes in scripts and CI, where no one can answer the prompt.

Exit codes

CodeWhen
0The extension is removed, is not in the project, or you canceled a prompt.
1The id is invalid or unknown, no config is found, the extension cannot be removed, or the uninstall fails.

Less common cases

Command output

kubb remove removes the call, even one Kubb Studio switched off, and drops the unused import.

  • It leaves the plugin's generated files on disk. With output.clean, the next kubb generate removes them.
  • It refuses an adapter, such as @kubb/adapter-oas, because a config needs one. Change the adapter in the config by hand.
  • @kubb/parser-ts, @kubb/parser-md, and @kubb/plugin-barrel ship with kubb. They leave the config but stay installed.
  • A package that another config entry still imports also stays installed.
  • Only plugins that run count as dependents. A plugin Studio switched off does not block the removal.
  • When the extension is not in the project, nothing changes and the exit code is 0.