Skip to content

Introduction

Kubb is the meta framework for code generation. Just like Nuxt gives structure on top of Vue, Kubb gives you a complete, plugin-based generation pipeline on top of any API specification. An adapter reads your spec, parsers convert the AST into source files, plugins generate the output, and the pipeline handles writing, formatting, and linting. Everything runs from a single config file.

The default adapter supports OpenAPI 2.0, 3.0, and 3.1. For other formats (GraphQL, JSON Schema, gRPC) you can bring your own adapter. Whether you need TypeScript types, React Query hooks, Zod validators, MSW mocks, or a fully custom output, Kubb lets you focus on building your application instead of maintaining generated code by hand. And unlike AI or LLM-generated code, Kubb's output is deterministic: the same spec always produces the same result.

Features

Feature Description
TypeScript types Type-safe interfaces and types from your schemas
API clients Type-safe HTTP clients for Axios or Fetch
React Query hooks useQuery and useMutation hooks for React Query
Vue Query composables The same hooks, for Vue Query
Zod schemas Runtime validation schemas via Zod
MSW handlers Mock Service Worker handlers for frontend development and testing
Faker mocks Realistic mock data using Faker.js
Cypress tests End-to-end API tests with Cypress
MCP servers Model Context Protocol servers so AI assistants can interact with your API
Custom plugins Write your own using the same APIs the official plugins use

Start with Installation or Basic Usage. For deeper reference see Configuration, Recipes, and Integrations.

Community

Join the Discord server, file an issue on GitHub, or sponsor the project.