Skip to main content

CLI WIZARD

cli-wizard-banner

PyPI version Python versions License Build status Tests Coverage Code style: ruff Downloads

Generate modern CLIs from OpenAPI specifications.

Table of Contents

Features

Code Generation

  • Generate complete Python CLI projects from OpenAPI v3 specifications
  • Automatic command grouping based on OpenAPI tags
  • Automatic help generation for all commands
  • Clean, colored terminal output
  • --debug flag for verbose logging
  • Built-in API client with configurable base URL and timeout
  • SSL/TLS support with custom CA certificate bundles
  • --ca-file option to specify custom CA certificates at runtime
  • --no-verify-ssl flag to disable certificate verification

Customization

  • YAML-based configuration for full customization
  • Configurable output directory and package name
  • Tag inclusion/exclusion filters
  • Custom command naming via TagMapping and CommandMapping
  • Customizable splash screen with color support
  • Configurable logging with colors, file output, and rotation

Developer Experience

  • Generated projects are pip-installable out of the box
  • Auto-generated pyproject.toml, README.md, and VERSION
  • Resources (CA certs, splash files) bundled in the package
  • Profile management for storing credentials and settings

Installation

pip install cli-wizard

Usage

Step 1: Prepare Your OpenAPI Specification

Ensure you have an OpenAPI v3 specification file (JSON or YAML format). For example, openapi.yaml:

openapi: 3.0.0
info:
  title: My API
  version: 1.0.0
paths:
  /users:
    get:
      operationId: listUsers
      summary: List all users
      tags:
        - Users
      responses:
        '200':
          description: OK

Step 2: Create a Configuration File

Create a cli-wizard.yaml file with your CLI settings. At minimum, you need PackageName and DefaultBaseUrl:

# Required parameters
PackageName: "my-cli"
DefaultBaseUrl: "https://api.example.com"

# Optional: customize the splash screen
SplashFile: "splash.txt"
SplashColor: "#00FFFF"

# Optional: filter which tags to include
IncludeTags:
  - Users
  - Products

Step 3: Generate the CLI

Run the generate command:

cli-wizard generate --openapi openapi.yaml --config cli-wizard.yaml --output my-cli

This creates a complete Python CLI project in the my-cli directory.

Step 4: Install the Generated CLI

Navigate to the generated project and install it:

pip install -e my-cli

Step 5: Use Your CLI

Your CLI is now ready to use:

my-cli --help
my-cli users list-users

Configuration

See configuration reference for full documentation. See the examples directory for complete configuration examples.

Commands

cli-wizard generate

Generate a CLI from an OpenAPI specification and configuration file.

cli-wizard generate [OPTIONS]

Options:

  • --openapi, -o - Path to OpenAPI spec file (default: openapi.yaml)
  • --config, -c - Path to config YAML file (default: cli-wizard.yaml)
  • --output, -d - Output directory for generated CLI (default: cli)
  • --working-dir, -w - Working directory for resolving relative paths

Issues

Please report any issues or feature requests on the GitHub Issues page.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cli_wizard-2.1.0.tar.gz (48.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cli_wizard-2.1.0-py3-none-any.whl (64.3 kB view details)

Uploaded Python 3

File details

Details for the file cli_wizard-2.1.0.tar.gz.

File metadata

  • Download URL: cli_wizard-2.1.0.tar.gz
  • Upload date:
  • Size: 48.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for cli_wizard-2.1.0.tar.gz
Algorithm Hash digest
SHA256 026930ab1849901f7b8dc4ed97fef7c21ab83957f5f8c060459edbffc17d2b4b
MD5 27948ce5b65a3df7a71f6afcce2f7d37
BLAKE2b-256 85cf25a8b6ab86e6a2686daa380f26922bb04b7a2d784b51649ddc984e3fc812

See more details on using hashes here.

File details

Details for the file cli_wizard-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: cli_wizard-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 64.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for cli_wizard-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b334a1cc22efcff78560a9165201b99f59addf2c1caacb3dba98aed1bda60777
MD5 458c78bf2d6d0aa66534cd226d7dbe26
BLAKE2b-256 f0764bd09eda129641b7d1845b851d5042866b22360e0c8bec277c04f021f4c8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 files

2.0.0

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page