Configuration
Overview
Section titled “Overview”CLIConfig extends BaseConfig from lexigram.config with a config_section = "cli". It reads from the [cli] section of application.yaml or environment variables prefixed with LEX_CLI__.
from lexigram.cli import CLIConfig
# From YAML (reads [cli] section)config = CLIConfig.from_yaml("application.yaml")
# Defaultsconfig = CLIConfig()Options
Section titled “Options”| Key | Type | Default | Env Var | Description |
|---|---|---|---|---|
default_template | str | "web-api" | LEX_CLI__DEFAULT_TEMPLATE | Project template used by lexigram new project |
default_database | str | "postgres" | LEX_CLI__DEFAULT_DATABASE | Default database driver for scaffolding |
color | bool | True | LEX_CLI__COLOR | Enable coloured terminal output |
verbose | bool | False | LEX_CLI__VERBOSE | Print verbose/debug output |
YAML Example
Section titled “YAML Example”cli: default_template: "full" default_database: "sqlite" color: true verbose: falseEnvironment Variables
Section titled “Environment Variables”export LEX_CLI__DEFAULT_TEMPLATE=fullexport LEX_CLI__DEFAULT_DATABASE=sqliteexport LEX_CLI__COLOR=trueexport LEX_CLI__VERBOSE=trueEnvironment variable overrides take precedence over values in application.yaml.
Best Practices
Section titled “Best Practices”- Use
application.yamlfor project-wide defaults checked into version control - Use environment variables for CI/CD and per-deployment overrides
- Set
LEX_CLI__VERBOSE=trueduring troubleshooting for detailed output