Skip to main content

Module config

Module config 

Source
Expand description

Config-file + env-var loader per Client spec rev1 §5 and SDK config-file format decision 2026-05-20. TOML on disk at ~/.cleanlibrary/config.toml; env vars override file values.

Precedence (highest wins): explicit constructor args > env vars > ~/.cleanlibrary/config.toml > defaults. Constructor-arg precedence is consumer-side (CLI flags / SDK options); this module exposes file + env merging.

Structs§

AuthConfig
Config
Top-level config schema matching the canonical TOML structure.
EndpointConfig
TelemetryConfig

Enums§

ConfigError

Functions§

default_path
Default config-file path: $HOME/.cleanlibrary/config.toml. Returns None if the OS has no discoverable home dir.
load
Load + parse a TOML config file.
load_with_env_overrides
Load config with env-var overrides applied on top of file values. Returns Config::default() if path is None or the file doesn’t exist.
save
Save config to TOML file. Creates parent dirs if needed. Overwrites existing content as a whole-file rewrite — preserves all explicit Config field values (auth/endpoint/telemetry) but does NOT preserve comments or non-Config keys. Customer should use env-var precedence for dynamic auth values to avoid hand-editing the file.