Contents

Chapter 1

Features

This chapter covers the core features and capabilities of Config Manager.

Features

  • Layered merge — Defaults < config file < environment variables < CLI overrides, with deep recursive merging
  • Multiple file formats — JSON, INI, and .env files supported out of the box
  • Dot-path access — Get and set nested values with database.host notation
  • Schema validation — Validate types, required keys, allowed values, numeric ranges, and regex patterns
  • Type coercion — Automatic and explicit conversion between str, int, float, bool, and list types
  • Secret masking — Export configs with passwords, tokens, and API keys automatically redacted
  • Config diff — Compare two config files side-by-side with added/removed/changed reporting
  • Environment variable overlay — Map CFG_DATABASE__HOST to database.host automatically

Requirements

  • Python 3.10+
  • No external dependencies (stdlib only)
Chapter 2

Quick Start

Follow this guide to get Config Manager up and running in your environment.

Quick Start

bash
# 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

Configuration Reference

CLI Options

FlagDefaultDescription
--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-prefixCFG_Environment variable prefix
--log-levelWARNINGLogging level (DEBUG, INFO, WARNING, ERROR)

Schema Format

Schemas define expected types, required fields, allowed values, and constraints:

json
{
    "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.

Environment Variable Mapping

Set CFG_-prefixed variables to override config at runtime. Double underscore (__) denotes nesting:

bash
export CFG_DATABASE__HOST=prod-db.example.com
export CFG_DATABASE__PORT=5432
export CFG_APP__DEBUG=true

These map to database.host, database.port, and app.debug respectively.

Chapter 3
🔒 Available in full product

Output

Chapter 4
🔒 Available in full product

04_License

You’ve reached the end of the free preview

Get the full Config Manager and unlock everything.

All Chapters

Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.

Full Tool Suite

Access all interactive tools with complete data, all workload profiles, and the full scenario library.

Source Files

Downloadable source code, configuration files, and working examples from every chapter.

Lifetime Updates

Free updates for life. Every new chapter, tool, and improvement included.

Buy Now — $19 →
📦 Free sample included — download another copy for the full product.
Config Manager v1.0.0 — Free Preview