Skip to content
Commands

Commands

Reference for every command and flag exposed by the kubb CLI including init, generate, validate, mcp and studio.

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, and connects a project to Kubb Studio.

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 and generate from the browser

Use kubb <command> --help for more information about a command.

Run kubb with no command and it runs kubb generate.

Available commands

CommandDescription
kubb initScaffold a new Kubb project with an interactive wizard.
kubb generateRun the code-generation pipeline from your kubb.config.ts.
kubb validateValidate a Swagger/OpenAPI document without running the pipeline.
kubb mcpStart a Model Context Protocol server for LLM clients.
kubb studioConnect the project to Kubb Studio and generate from the browser.

Environment variables

The CLI reads these shared environment variables.

VariableTypeUsed byDescription
KUBB_DISABLE_TELEMETRYbooleanallTurn off anonymous usage telemetry. Set it to 1 or true.
DO_NOT_TRACKbooleanallStandard opt-out convention. Set it to 1 or true.
KUBB_HOMEstringstudioDirectory the CLI keeps its Studio state in. Defaults to ~/.kubb.
KUBB_AGENT_TOKENstringstudioConnect with an existing agent token instead of approving this machine.