Skip to content

CLI

Installation

shell
bun add @kubb/cli
shell
pnpm add @kubb/cli
shell
npm install @kubb/cli
shell
yarn add @kubb/cli

Usage

sh
kubb --config kubb.config.js
mdx
kubb/2.0.0

Usage:
  $ kubb [input]

Commands:
  [input]           Path of the input file(overrides the one in `kubb.config.js`)
  generate [input]  Path of the input file(overrides the one in `kubb.config.js`)
  init              Init Kubb

For more info, run any command with the `--help` flag:
  $ kubb --help
  $ kubb generate --help
  $ kubb init --help

Options:
  -h, --help     Display this message
  -v, --version  Display version number

Generate

TIP

kubb generate and kubb are the same.

mdx
kubb/2.0.0

Usage:
  $ kubb generate [input]

Options:
  -c, --config <path>     Path to the Kubb config
  -l, --log-level <type>  Info, silent or debug
  -w, --watch             Watch mode based on the input file
  -h, --help              Display this message

Path of the input file(overrides the one in kubb.config.js)

sh
kubb petStore.yaml

Options

--config (-c)

INFO

Path to the Kubb config.

sh
kubb --config kubb.config.ts

--log-level (-l)

INFO

Type of the logging(overrides the one in kubb.config.js).

silent will hide all information that is not relevant

info will show all information possible(not related to the PluginManager)

debug will show all information possible(related to the PluginManager), handy for seeing logs

sh
kubb --log-level info

--watch (-w)

Watch mode based on the input file.

INFO

sh
kubb --watch

--version (-v)

Output the version number.

INFO

sh
kubb --version

--help (-h)

Display the help.

INFO

sh
kubb --help

Released under the MIT License.