Integrations
Integrate Kubb with Studio, CI, and build tools
See where Kubb runs besides the CLI, from Kubb Studio and CI snapshots to build tool plugins, openapi-import, and AI assistants, all from one kubb.config.ts.
Every integration runs the same kubb.config.ts. You pick where Kubb runs.
Pick an integration
CI snapshots
Publish an installable package per pull request from GitHub Actions, GitLab CI, or any CI.
Build tools
unplugin-kubb runs your kubb.config.ts when a build starts. It ships with kubb, and you import it from kubb/<tool>.
Vite, Nuxt, and Astro generate during builds only, not in their dev servers. Run
kubb generate before you start a dev server.Each tool page passes your kubb.config.ts as config. Without config, the plugin finds kubb.config.ts like the CLI does and builds every config in it that has an input.
| Tool | Import | Config file |
|---|---|---|
| Vite | kubb/vite | vite.config.ts |
| webpack | kubb/webpack | webpack.config.ts |
| Rspack | kubb/rspack | rspack.config.ts |
| Rollup | kubb/rollup | rollup.config.ts |
| Rolldown | kubb/rolldown | rolldown.config.ts |
| esbuild | kubb/esbuild | build.ts |
| Farm | kubb/farm | farm.config.ts |
| Nuxt | kubb/nuxt | nuxt.config.ts |
| Astro | kubb/astro | astro.config.mjs |
How the build runs Kubb
- The plugin applies the same defaults as
defineConfigand runsoutput.format,output.lint, andoutput.postGenerate. - It prints the run summary, not the
json,file, orhtmlreports. Usekubb generatefor those. - Watch rebuilds reuse the first output. Restart the build after you change the spec or
kubb.config.ts.
Import a spec as a module
Import a *.openapi.yaml or *.openapi.yml file to get the output of every plugin in your config as one module. Kubb writes no files for it, and it works in the Vite dev server too.
src/pets.ts
import { type Pet, petStatusEnum } from './petStore.openapi.yaml'- The import uses the config whose
inputis that spec, or else the first config without aninput. A config withoutinputonly serves imports. - Code a plugin writes to a separate file, such as a bundled client runtime, is not part of the module.
For types in tsc and your editor, add openapi-import.
