Commands
Commands
Reference for every command and flag exposed by the kubb CLI including init, generate, validate, mcp, studio, add, update, and list.
The kubb CLI is the main way to run Kubb. It reads your configuration and runs the generation pipeline. It also scaffolds projects, validates specs, starts a Model Context Protocol server for LLM clients, connects a project to Kubb Studio, and installs extensions from the Kubb registry.
Usage
Terminal
USAGE kubb [COMMAND] [OPTIONS]
COMMANDS
init Initialize a new Kubb project with interactive setup
generate [input] Generate files based on a 'kubb.config.ts' file (default)
validate Validate a Swagger/OpenAPI file
mcp Start the MCP server so an MCP client can interact with the LLM
studio [action] Connect this project to Kubb Studio, or manage its pairing and snapshots
add <id> Install an extension from the Kubb registry at its reviewed version
update [ids...] Update installed extensions to the version the Kubb registry pins
list List the installed Kubb extensions and available updates
Use kubb <command> --help for more information about a command.Run kubb with no command and it runs kubb generate.
Available commands
| Command | Description |
|---|---|
kubb init | Scaffold a new Kubb project with an interactive wizard. |
kubb generate | Run the code-generation pipeline from your kubb.config.ts. |
kubb validate | Validate a Swagger/OpenAPI document without running the pipeline. |
kubb mcp | Start a Model Context Protocol server for LLM clients. |
kubb studio | Connect the project to Kubb Studio, or manage its pairing and snapshots. |
kubb add | Install a plugin, adapter, or parser from the Kubb registry and add a plugin to the config. |
kubb update | Move installed extensions to the version the Kubb registry pins. |
kubb list | List the installed extensions, their versions, and available updates. |
Environment variables
The CLI reads these shared environment variables.
| Variable | Type | Used by | Description |
|---|---|---|---|
KUBB_DISABLE_TELEMETRY | boolean | all | Turn off anonymous usage telemetry. Set it to 1 or true. |
DO_NOT_TRACK | boolean | all | Standard opt-out convention. Set it to 1 or true. |
KUBB_HOME | string | studio | Directory the CLI keeps its Studio state in. Defaults to ~/.kubb. |
KUBB_AGENT_TOKEN | string | studio | Connect with an existing agent token instead of approving this machine. |
KUBB_TOKEN | string | studio snapshot | Organization CI API key. Same as --token. |
KUBB_REGISTRY | string | add, update, list | Base URL of the extension registry. Defaults to https://kubb.dev/registry. |