Configuration

Configuration uses a YAML file with PascalCase parameter names. You can reference other parameters with #[ParamName] syntax and environment variables with ${VAR} syntax.

References are resolved before generation. A parameter must not reference itself, directly or through other parameters: a circular reference is reported as an invalid configuration instead of being expanded. A reference to a parameter that does not exist is left in the value as written.

See the examples for complete configuration examples.

pydantic model cli_wizard.config.schema.Config

CLI Wizard configuration schema.

Config:
  • extra: str = forbid

Fields:
Validators:
field AuthorEmail: str = 'your.email@example.com'

Author email

Validated by:
field AuthorName: str = 'Your Name'

Author name

Validated by:
field CaFile: str | None = None

CA certificate file for SSL verification (relative to config or absolute)

Validated by:
field CommandMapping: dict[str, str] [Optional]

Customize command names (operationId -> command name)

Validated by:
field CommandName: str | None = None

CLI command name (kebab-case, derived from ProjectName if not set)

Validated by:
field CopyrightYear: int | None = None

Copyright year for LICENSE and other files

Validated by:
field CoverageThreshold: int = 80

Minimum test coverage percentage to enforce (0 disables it)

Constraints:
  • ge = 0

  • le = 100

Validated by:
field DefaultBaseUrl: str = 'http://localhost:3000'

Default API base URL

Validated by:
field Description: str = 'A CLI application'

Project description

Validated by:
field ExcludeOperations: list[str] [Optional]

Operation IDs to exclude from generation

Validated by:
field ExcludeTags: list[str] [Optional]

Tags to exclude from generation

Validated by:
field GithubUser: str = 'username'

GitHub username

Validated by:
field HomePageUrl: str | None = None

Home page URL for the project, such as a documentation site. Defaults to RepositoryUrl

Validated by:
field IncludeGithubWorkflows: bool = False

Include .github folder with workflows, issue templates, etc.

Validated by:
field IncludeOperations: list[str] [Optional]

Operation IDs to include (if empty, all non-excluded operations are included)

Validated by:
field IncludeTags: list[str] [Optional]

Tags to include (if empty, all non-excluded tags are included)

Validated by:
field JsonIndent: int = 2

JSON indentation

Constraints:
  • ge = 0

Validated by:
field LogColorDebug: str = '#808080'

Color for DEBUG log level (hex code)

Validated by:
field LogColorError: str = '#FF0000'

Color for ERROR log level (hex code)

Validated by:
field LogColorInfo: str = '#00FF00'

Color for INFO log level (hex code)

Validated by:
field LogColorStyle: Literal['full', 'level'] = 'level'

Log color style: ‘full’ colors entire line, ‘level’ colors only the level prefix

Validated by:
field LogColorWarning: str = '#FFFF00'

Color for WARNING log level (hex code)

Validated by:
field LogFile: str | None = None

Path to log file (None means no file logging)

Validated by:
field LogFormat: str = '%(asctime)s [%(levelname)s] %(message)s'

Log message format (Python logging format)

Validated by:
field LogLevel: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR'] = 'INFO'

Default log level

Validated by:
field LogRotationBackupCount: int = 5

Number of backup log files to keep

Constraints:
  • ge = 0

Validated by:
field LogRotationDays: int = 30

Log rotation interval in days (when LogRotationType is ‘days’)

Constraints:
  • ge = 1

Validated by:
field LogRotationSize: int = 10

Log rotation size in MB (when LogRotationType is ‘size’)

Constraints:
  • ge = 1

Validated by:
field LogRotationType: Literal['size', 'days'] = 'days'

Log rotation type: ‘size’ for file size, ‘days’ for time-based

Validated by:
field LogTimestampFormat: str = '%Y-%m-%dT%H:%M:%S'

Timestamp format for log messages (strftime format)

Validated by:
field LogTimezone: Literal['UTC', 'Local'] = 'UTC'

Timezone for log timestamps

Validated by:
field MainDir: str = '${HOME}/.#[CommandName]'

Main directory for CLI data (config, cache, logging, etc.)

Validated by:
field OpenapiSpec: str | None = None

Path to OpenAPI spec (relative to config file or absolute)

Validated by:
field OutputColors: bool = True

Enable colored output

Validated by:
field OutputFormat: Literal['json', 'table', 'yaml'] = 'json'

Default output format

Validated by:
field PackageName: str | None = None

Python package name (snake_case, derived from ProjectName if not set)

Validated by:
field ProfileFile: str = '#[MainDir]/profiles.yaml'

Path to profiles YAML file

Validated by:
field ProjectName: str = 'My Project'

Human-readable project name (title case)

Validated by:
field PythonVersion: str = '3.12'

Minimum Python version, one of 3.12, 3.13, 3.14

Validated by:
field RepositoryUrl: str | None = None

Repository URL for the project

Validated by:
field RetryBackoffFactor: float = 0.5

Retry backoff factor

Constraints:
  • ge = 0

Validated by:
field RetryMaxAttempts: int = 3

Retry max attempts

Constraints:
  • ge = 0

Validated by:
field SplashColor: str = '#FFFFFF'

Color for splash text (hex code)

Validated by:
field SplashFile: str | None = None

Path to splash text file (relative to config or absolute)

Validated by:
field TableStyle: Literal['ascii', 'rounded', 'minimal', 'markdown'] = 'rounded'

Table style

Validated by:
field TagMapping: dict[str, str] [Optional]

Map OpenAPI tags to CLI command group names

Validated by:
field Timeout: int = 30

Request timeout in seconds

Constraints:
  • ge = 1

Validated by:
field Version: str = '1.0.0'

Project version

Validated by:
validator derive_names_from_project  »  all fields

Derive optional fields that have a sensible value from the others.

These derivations live here rather than in the bootstrap prompts so that generate gets them too. Leaving them unset previously rendered “Copyright (c) None” and ‘Homepage = “None”’ into generated projects.

validator validate_hex_color  »  LogColorWarning, LogColorError, SplashColor, LogColorDebug, LogColorInfo

Validate that color is a valid hex color code.

validator validate_package_name  »  PackageName

Validate that PackageName is usable as a Python package name.

The generated project imports itself by this name, so anything that is not a valid identifier produces source code that does not parse.

validator validate_python_version  »  PythonVersion

Validate that PythonVersion is one cli-wizard can generate for.

An unsupported value used to flow straight into requires-python and the mypy config, producing a project that claims support cli-wizard never tested and cannot express in its version matrix.