Installation
Install Kubb in an existing project using your package manager. If you want to learn generation with a supplied specification and expected output, follow Generate your first client.
Prerequisites
- Node.js 22 or higher.
- TypeScript 5 or higher if you use a TypeScript config or import generated types.
Install Kubb
Add kubb as a development dependency. It includes the CLI, core runtime, default OpenAPI adapter, and TypeScript, TSX, and Markdown parsers.
pnpm add -D kubb
npm install -D kubb
yarn add -D kubb
bun add -d kubb
Verify the installation
Run the CLI from your project directory:
npx kubb --version
The command prints the installed Kubb version. Use pnpm exec kubb --version, yarn kubb --version, or bunx kubb --version with the corresponding package manager.
Install plugins
Each output is provided by a plugin package. Install only the plugins you need. For TypeScript types, install the TypeScript plugin and compiler:
pnpm add -D @kubb/plugin-ts typescript
npm install -D @kubb/plugin-ts typescript
yarn add -D @kubb/plugin-ts typescript
bun add -d @kubb/plugin-ts typescript
Browse available plugins to choose outputs for your project.
Configure your project
Run the initialization wizard to choose your specification, output directory, and plugins:
npx kubb init
For an existing config, use Configure generation. Install the runtime libraries required by your chosen output too: an Axios client uses axios, and React Query hooks use React and @tanstack/react-query. Each plugin documents its requirements.
Once configured, run npx kubb generate from the project directory. Kubb writes the generated files to output.path.
Next steps
- Generate your first client — follow a complete example with a supplied specification.
- Configure generation — choose a stack for your existing project.
- Configuration reference — look up options and defaults.