Skip to content

kubb-labs/kubb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7,004 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Kubb

The meta framework for code generation

Point Kubb at an OpenAPI spec and it generates types, clients, hooks, validators, mocks, and more.

Installation

bun add kubb
# or
pnpm add kubb
# or
npm install kubb

Quick start

Run the setup wizard to create a kubb.config.ts:

npx kubb init

The 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 generate

See the documentation for detailed usage and advanced features.

Features

  • Generate from a spec: point Kubb at an OpenAPI document and it produces TypeScript types, type-safe API clients, TanStack Query hooks for React and Vue, SWR hooks, Zod validators, Faker mocks, and MSW handlers.
  • Read Swagger 2.0, OpenAPI 3.0, and 3.1, with TypeScript-first output that runs on Node.js and Bun.
  • Pick what you generate from the plugin ecosystem: plugin-ts, plugin-client, plugin-react-query, plugin-vue-query, plugin-swr, plugin-zod, plugin-faker, plugin-msw, plugin-cypress, plugin-redoc, and plugin-mcp. Enable only the ones a project needs.
  • Choose your HTTP client: use the axios or fetch presets, or point at a custom client module so generated requests run through your own wrapper.
  • Control the generated tree: group files by tag, emit barrel exports, and include or exclude operations to keep the output focused.
  • Build your own output with custom plugins, adapters, and the JSX-based renderer (@kubb/renderer-jsx) for full control over what lands on disk.
  • Hook into your bundler with unplugin-kubb, which runs generation inside Vite, Nuxt, Astro, webpack, and other build tools.
  • Drive generation from AI tools through the built-in Model Context Protocol (MCP) server, which works with Claude, Cursor, and other MCP-compatible assistants.
  • Generate from inside Claude Code with the Kubb plugin, which adds slash commands, a config skill, and an agent that run the Kubb CLI.

Supporting Kubb

Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:

My sponsors

Contributing

We welcome contributions that help improve Kubb. A few ways to get involved:

See CONTRIBUTING.md for the project structure, local setup, and commands.

Contributors Contributors

Stijn Van Hulle
Stijn Van Hulle

💻
Alfred
Alfred

💻
Kirill Agalakov
Kirill Agalakov

💻
Nick Williams
Nick Williams

📖
helt
helt

💻
Vasily Mikhaylovsky
Vasily Mikhaylovsky

💻
Chaim Lev-Ari
Chaim Lev-Ari

💻
Pavel Belousov
Pavel Belousov

💻
Dmitry Belov
Dmitry Belov

💻
Alex Burgel
Alex Burgel

💻
Daniel Garcia
Daniel Garcia

💻
wuyuanyi135
wuyuanyi135

💻
Chris Thompson
Chris Thompson

💻
Caleb Hoyoul Kang
Caleb Hoyoul Kang

💻
Gregory Zhukovsky
Gregory Zhukovsky

💻
Christoffer Nørbjerg
Christoffer Nørbjerg

💻
CHE1RON
CHE1RON

💻
ekaradon
ekaradon

💻
Thijmen Stavenuiter
Thijmen Stavenuiter

💻
Bohdan Husak
Bohdan Husak

📖
Éric Le Maître
Éric Le Maître

💻
Rubens Pereira do Nascimento
Rubens Pereira do Nascimento

💻
Matt Sutkowski
Matt Sutkowski

💻
Vítor Camacho
Vítor Camacho

💻
Václav Procházka
Václav Procházka

💻
Luiz Bett
Luiz Bett

💻
Sebastian Andersen
Sebastian Andersen

💻
Akino
Akino

💻
Ricardo Machado
Ricardo Machado

💻
Simon El Nahas
Simon El Nahas

📖
maartenvansambeek
maartenvansambeek

💻
Stefan du Fresne
Stefan du Fresne

💻
Hugo Felippe de Souza Cruz
Hugo Felippe de Souza Cruz

💻
Sébastien Vanvelthem
Sébastien Vanvelthem

💻
Vitaly Gashkov
Vitaly Gashkov

📖
Duco Drupsteen
Duco Drupsteen

💻
th3l0g4n
th3l0g4n

💻
rxliuli
rxliuli

💻
humarkx
humarkx

💻
Jakub Cerovsky
Jakub Cerovsky

💻
Pachara Chantawong
Pachara Chantawong

💻
Volodymyr Kushnir
Volodymyr Kushnir

💻
GKNewsrooms
GKNewsrooms

💻
Kamil Stepczuk
Kamil Stepczuk

💻
João Brilhante
João Brilhante

💻
Kamil Sieradzki
Kamil Sieradzki

💻
Eric Pierlot
Eric Pierlot

💻
Alexander Sjöcrona Tholin
Alexander Sjöcrona Tholin

💻
Stephen Zhou
Stephen Zhou

💻
Ilia Choly
Ilia Choly

💻
Alex Skoropad
Alex Skoropad

💻
Jay Patel
Jay Patel

💻
Hamza Mihai Daniel
Hamza Mihai Daniel

💻
DesselBane
DesselBane

💻

License

This repository is licensed under the MIT License, Copyright © 2025 Stijn Van Hulle.

See LICENSE for details.

Star history

Star History Chart

About

🧡 The meta framework for code generation. Automate OpenAPI to type-safe TypeScript, Zod, and TanStack Query with a modular, plugin-based engine.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors

Languages

Generated from stijnvanhulle/template