npm.io
1.8.3 • Published 2 years agoCLI

@kubb/cli

Licence
MIT
Version
1.8.3
Deps
11
Size
104 kB
Vulns
0
Weekly
0
Stars
1.7K

Commands

kubb init

Initialize a new Kubb project with an interactive setup wizard.

npx kubb init

Use the -y / --yes flag to skip all prompts and accept the defaults:

npx kubb init -y

Defaults when using -y:

  • Input path: ./openapi.yaml
  • Output path: ./src/gen
  • Plugins: OpenAPI Parser + TypeScript

This command will:

  1. Detect or create a package.json if it doesn't exist
  2. Prompt you for your OpenAPI specification path (default: ./openapi.yaml)
  3. Ask for the output directory for generated files (default: ./src/gen)
  4. Let you select which Kubb plugins to use (default: OpenAPI Parser + TypeScript)
  5. Install the selected packages using your package manager (npm, pnpm, yarn, or bun)
  6. Generate a kubb.config.ts file with your chosen configuration
kubb generate

Generate files based on your kubb.config.ts configuration.

npx kubb generate

Options:

  • -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 mcp

Supporting 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:

My sponsors

Keywords