Skip to main content

Module config

Module config 

Source
Expand description

/config show + /config doctor trait + value types.

zero-commands intentionally does not depend on zero-config: the command crate is compiled for tests and non-TUI callers where the real TOML + keychain layer is overkill. Instead a tiny ConfigSource trait lives here and the production adapter in zero/src/main.rs plugs in the real implementation. Same pattern as crate::SessionSource.

Data is returned as plain Rust — no toml::Value, no keyring::Entry. That keeps the command crate side-effect free (no file or network access from inside tests) and means adapter-side changes never ripple into dispatch.

Structs§

ConfigDoctorFinding
One doctor finding. message is rendered verbatim; the dispatcher does not prepend severity or reformat text, so the adapter can choose its own phrasing (“token: set in keychain”, “config file missing — run zero init”, etc.) without the dispatcher needing to know the domain.
ConfigShowRow
One labelled /config show row.
MockConfig
In-memory ConfigSource used by tests. Lets a test fix a deterministic set of rows + findings without touching zero-config or the filesystem.

Enums§

DoctorSeverity
Severity of a doctor finding. Drives the OutputLine kind the dispatcher emits:

Traits§

ConfigSource
Read-only trait over the operator’s on-disk config + its secret-resolution state. Kept read-only at this layer because write paths (zero init, zero pair) already live in dedicated non-interactive entrypoints; the TUI should never silently rewrite config.toml.