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.
Copyright ©2026 PyModeller. All rights reserved.
Classes:
| Name | Description |
|---|---|
EnvManager |
Service class to handle core env-spec 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. |
drift |
Check drift between YAML spec and generated code. |
example |
Generate a template .env.example from the YAML spec. |
print_diff |
Show the results. |
setup |
Generate models from yaml and .env.example. |
show_master_diff |
Show diff. |
show_version |
Show version. |
sync |
Check if generated models are in sync with the YAML spec. |
EnvManager
Service class to handle core env-spec logic.
Methods:
| Name | Description |
|---|---|
generate_example_content |
Build the content for the .env.example file. |
get_file_hash |
Compute SHA-256 hash of a file. |
check
Validate current .env file against the specification.
codegen
codegen(
spec: Path = spec,
pydantic_out: Path = pydantic_folder,
peewee_out: Path = peewee_folder,
pydantic_master: Path = pydantic_out,
peewee_master: Path = peewee_out,
) -> Exit
Generate typed Pydantic models for the environment.
drift
Check drift between YAML spec and generated code.
example
Generate a template .env.example from the YAML spec.
setup
setup() -> Exit
Generate models from yaml and .env.example.