Point Kubb at a schema and it generates types, clients, hooks, validators, mocks, and more.
bun add kubb
# or
pnpm add kubb
# or
npm install kubbRun the setup wizard to create a kubb.config.ts:
npx kubb initThe wizard creates a package.json if needed, guides you through plugin selection, installs packages, and writes kubb.config.ts. Then generate your code:
npx kubb generateSee the documentation for detailed usage and advanced features.
- Generate TypeScript types, type-safe clients, TanStack Query and SWR hooks, Zod validators, Faker mocks, and MSW handlers from one schema.
- Generate a typed axios or Fetch client with status-keyed results, auth, validation, file uploads, server-sent events, interceptors, and a swappable transport.
- Read OpenAPI 2.0, 3.0, and 3.1 through adapters like
@kubb/adapter-oas, with output for Node.js and Bun. - Enable only the plugins you need:
plugin-ts,plugin-axios,plugin-fetch,plugin-react-query,plugin-vue-query,plugin-swr,plugin-zod,plugin-faker,plugin-msw,plugin-cypress,plugin-redoc,plugin-mcp. - Shape the output by grouping files by tag, including or excluding operations, and writing to disk, memory, or a custom storage backend.
- Build your own plugins, generators, adapters, and renderers with the
kubb/kitauthoring toolkit, plus a JSX renderer for component-based output. - Run generation in your bundler with
unplugin-kubbfor Vite, Nuxt, Astro, webpack, and more. - Drive generation from AI tools over the built-in MCP server (Claude, Cursor) or inside Claude Code.
Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:
We welcome contributions that help improve Kubb. A few ways to get involved:
- Found a bug? File it in the issue tracker.
- Have an idea to improve Kubb? Open an issue to share it.
- Need help? Ask the community on Discord.
See CONTRIBUTING.md for the project structure, local setup, and commands.
This repository is licensed under the MIT License, Copyright © 2025 Stijn Van Hulle.
See LICENSE for details.