Commands

This section documents all available commands in the CLI Wizard.

cli-wizard

CLI Wizard - Generate modern CLI from OpenAPI.

Usage

cli-wizard [OPTIONS] COMMAND [ARGS]...

Options

--version

Show the version and exit.

-d, --debug

Enable debug output

bootstrap

Bootstrap a new CLI project: write a configuration file, then generate a basic CLI from it.

The prompts collect the main settings and write them to the configuration file, to evolve the project from with generate. The basic CLI is generated from that file without API commands, so no OpenAPI file is required. An existing configuration file is overwritten, after confirmation, without keeping any of its values.

–project-name sets ProjectName, which is then not prompted, and the CommandName prompt defaults to a name derived from it.

The basic CLI is written to the –output directory, by default a directory named after CommandName in the current directory.

Usage

cli-wizard bootstrap [OPTIONS]

Options

-c, --configuration <configuration>

Path for cli-wizard.yaml (default: ./cli-wizard.yaml)

-p, --project-name <project_name>

Human-readable project name; the default command name derives from it

-o, --output <output>

Output directory (default: CommandName in the current directory)

-f, --force

Skip the confirmation prompts to overwrite an existing configuration file or to write into a non-empty directory

config

Manage configurations.

Usage

cli-wizard config [OPTIONS] COMMAND [ARGS]...

get

Get a configuration value.

Usage

cli-wizard config get [OPTIONS] KEY

Arguments

KEY

Required argument

reset

Reset configuration to defaults and delete local config file.

Usage

cli-wizard config reset [OPTIONS]

set

Set a configuration value.

Usage

cli-wizard config set [OPTIONS] KEY VALUE

Arguments

KEY

Required argument

VALUE

Required argument

show

Show all configuration values as JSON.

Usage

cli-wizard config show [OPTIONS]

unset

Unset a configuration value, reverting it to the default.

Usage

cli-wizard config unset [OPTIONS] KEY

Arguments

KEY

Required argument

generate

Generate the CLI from an OpenAPI spec.

API commands are generated from the OpenAPI spec given with –api or with the Api parameter of the configuration file. Without either, a functional CLI is generated without API commands.

A configuration file is optional: without one, –project-name names the project and every other parameter takes its default.

The project is written to the –output directory, by default a directory named after CommandName in the current directory. Its previous contents are deleted.

Usage

cli-wizard generate [OPTIONS]

Options

-a, --api <api>

Path to the OpenAPI spec file, YAML or JSON

-c, --configuration <configuration>

Path to cli-wizard.yaml configuration file

-p, --project-name <project_name>

Human-readable project name; the generated command name derives from it, unless the configuration sets it

-o, --output <output>

Output directory (default: CommandName in the current directory)

-f, --force

Skip confirmation prompt if output directory exists and is not empty