Commands
kubb init
Initialize a new Kubb project with an interactive setup wizard.
npx kubb initUse the -y / --yes flag to skip all prompts and accept the defaults:
npx kubb init -yDefaults when using -y:
- Input path:
./openapi.yaml - Output path:
./src/gen - Plugins: OpenAPI Parser + TypeScript
This command will:
- Detect or create a
package.jsonif it doesn't exist - Prompt you for your OpenAPI specification path (default:
./openapi.yaml) - Ask for the output directory for generated files (default:
./src/gen) - Let you select which Kubb plugins to use (default: OpenAPI Parser + TypeScript)
- Install the selected packages using your package manager (npm, pnpm, yarn, or bun)
- Generate a
kubb.config.tsfile with your chosen configuration
kubb generate
Generate files based on your kubb.config.ts configuration.
npx kubb generateOptions:
-c, --config <path>- Path to the Kubb config file-l, --logLevel <level>- Set log level (silent, info, verbose, debug)-w, --watch- Watch mode based on the input file-d, --debug- Enable debug mode-v, --verbose- Enable verbose mode-s, --silent- Enable silent mode
kubb validate
Validate a Swagger/OpenAPI file.
npx kubb validate <path-to-openapi>kubb mcp
Start the MCP server to enable the MCP client to interact with the LLM.
npx kubb mcpSupporting Kubb
Kubb uses an MIT-licensed open source project with its ongoing development made possible entirely by the support of Sponsors. If you would like to become a sponsor, please consider: