This chapter covers the core features and capabilities of Config Manager.
database.host notationCFG_DATABASE__HOST to database.host automaticallyFollow this guide to get Config Manager up and running in your environment.
# Get a single value by dot-path
python src/config_manager.py --config examples/config_manager_config.json --get database.host
# Set an override and see the result
python src/config_manager.py --config examples/config_manager_config.json --set database.port=3306
# Validate config against a schema
python src/config_manager.py --config examples/config_manager_config.json --validate --schema examples/schema.json
# Export the full merged config (secrets masked)
python src/config_manager.py --config examples/config_manager_config.json --export
# List all dot-path keys
python src/config_manager.py --config examples/config_manager_config.json --keys
# Diff two config files
python src/config_manager.py --config examples/config_manager_config.json --diff examples/schema.json| Flag | Default | Description |
|---|---|---|
--config, -c | — | Configuration file to load (JSON, INI, or .env) |
--get, -g | — | Get a value by dot-path (e.g. database.host) |
--set, -s | — | Set an override value (repeatable, e.g. --set db.port=5432) |
--validate, -V | — | Validate config against a schema file |
--schema | — | Schema file for --validate (JSON) |
--export, -e | — | Export merged config to stdout (secrets masked) |
--no-mask | — | Disable secret masking on --export |
--diff, -d | — | Show diff between loaded config and another file |
--keys, -k | — | List all dot-path keys in the merged config |
--env-prefix | CFG_ | Environment variable prefix |
--log-level | WARNING | Logging level (DEBUG, INFO, WARNING, ERROR) |
Schemas define expected types, required fields, allowed values, and constraints:
{
"properties": {
"database": {
"type": "object",
"required": true,
"properties": {
"host": {"type": "string", "required": true},
"port": {"type": "integer", "min": 1, "max": 65535},
"name": {"type": "string", "allowed": ["prod_db", "dev_db"]}
}
}
}
}Supported field-level keys: type, required, allowed, min, max, pattern, default.
Set CFG_-prefixed variables to override config at runtime. Double underscore (__) denotes nesting:
export CFG_DATABASE__HOST=prod-db.example.com
export CFG_DATABASE__PORT=5432
export CFG_APP__DEBUG=trueThese map to database.host, database.port, and app.debug respectively.
Get the full Config Manager and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.