Skip to content
GitHub

Configuration

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")
# Defaults
config = CLIConfig()
KeyTypeDefaultEnv VarDescription
default_templatestr"web-api"LEX_CLI__DEFAULT_TEMPLATEProject template used by lexigram new project
default_databasestr"postgres"LEX_CLI__DEFAULT_DATABASEDefault database driver for scaffolding
colorboolTrueLEX_CLI__COLOREnable coloured terminal output
verboseboolFalseLEX_CLI__VERBOSEPrint verbose/debug output
application.yaml
cli:
default_template: "full"
default_database: "sqlite"
color: true
verbose: false
Terminal window
export LEX_CLI__DEFAULT_TEMPLATE=full
export LEX_CLI__DEFAULT_DATABASE=sqlite
export LEX_CLI__COLOR=true
export LEX_CLI__VERBOSE=true

Environment variable overrides take precedence over values in application.yaml.

  • Use application.yaml for project-wide defaults checked into version control
  • Use environment variables for CI/CD and per-deployment overrides
  • Set LEX_CLI__VERBOSE=true during troubleshooting for detailed output