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§
- Auth
Config - Config
- Top-level config schema matching the canonical TOML structure.
- Endpoint
Config - Telemetry
Config
Enums§
Functions§
- default_
path - Default config-file path:
$HOME/.cleanlibrary/config.toml. ReturnsNoneif 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()ifpathisNoneor 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
Configfield 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.