Skip to content

@kubb/cli 🦙 ​

Installation ​

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

Usage ​

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

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
kubb/1.2.1

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 ​

WARNING

kubb generate and kubb are the same.

mdx
kubb/1.2.1

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
kubb/1.2.1

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
kubb petStore.yaml

Options ​

--config (-c) ​

INFO

Path to the Kubb config.

sh
kubb --config kubb.config.ts
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
kubb --log-level info

--watch (-w) ​

Watch mode based on the input file.

INFO

sh
kubb --watch
kubb --watch

--version (-v) ​

Output the version number.

INFO

sh
kubb --version
kubb --version

--help (-h) ​

Display the help.

INFO

sh
kubb --help
kubb --help

Init ​

Create a starting package.json with dependencies needed to get started with generating files.

mdx
kubb/1.2.1

Usage:
  $ kubb init

Options:
  -h, --help  Display this message
kubb/1.2.1

Usage:
  $ kubb init

Options:
  -h, --help  Display this message

Depended ​

See getting-started on how to configure Kubb.

Released under the MIT License.