Skip to content

Commands

Env-spec management CLI.

======================================================================================================================== Name: pymodeller/env/cli.py Description: CLI entry-point for env-spec operations: example, check, diff, codegen, drift. Uses Typer for CLI parsing and a Service-based approach for logic.

Functions:

Name Description
banner_full

Create a banner.

check

Validate current .env file against the specification.

codegen

Generate typed Pydantic models for the environment.

example

Generate a template .env.example from the YAML spec.

generate_env

Generate .env and env. files from the YAML spec.

print_diff

Show the results.

setup

Generate models from yaml and .env.example.

show_version

Show version.

yaml_file

Generate environments.yaml from the YAML spec.

banner_full

banner_full(message: str, color: str = 'green') -> None

Create a banner.

check

check(spec: Path = models_yaml, env: Path = env) -> Exit

Validate current .env file against the specification.

codegen

codegen(
    spec: Path = models_yaml,
    model_type: DestinationType | None = None,
) -> Exit

Generate typed Pydantic models for the environment.

example

example(
    spec: Path = models_yaml,
    out: Path = env_example,
    secrets_only: bool = False,
) -> Exit

Generate a template .env.example from the YAML spec.

generate_env

generate_env(
    env_name: str, spec_path: Path = environment_file
) -> Exit

Generate .env and env. files from the YAML spec.

print_diff

print_diff(name: str, diff: dict) -> None

Show the results.

setup

setup() -> Exit

Generate models from yaml and .env.example.

show_version

show_version(value: bool) -> Exit | None

Show version.

yaml_file

yaml_file(
    spec: Path = models_yaml, out: Path = environment_file
) -> Exit

Generate environments.yaml from the YAML spec.