Expand description
Engine config file and credential-storage selection. Engine configuration file and credential-storage selection.
cli-engine reads an optional per-application TOML config file at
<config-base>/<app_id>/config.toml, where <config-base> is
$XDG_CONFIG_HOME, $HOME/Library/Application Support (macOS),
$HOME/.config (other Unix), or %APPDATA% (Windows) (see
config_base_dir).
Loading is best-effort: a missing file yields defaults, and a malformed file
logs a warning and falls back to defaults rather than failing the command.
Two engine-reserved settings live here today:
-
Where credentials are stored — see
CredentialStore. The effective mode is resolved with the precedence--credential-store flag > ${PREFIX}_CREDENTIAL_STORE env > config file > default (Auto)See
resolve_credential_storeand the pureresolve_credential_store_with. -
The default output format for a user who never sets
--output/--json/--human/--toon— seecrate::config::OutputConfig. Resolved with the precedence--output/--json/--human/--toon flag > ${PREFIX}_OUTPUT env > config file > TTY-based defaultSee
crate::flags::default_output_formatand the purecrate::flags::resolve_default_output_format.
where ${PREFIX} is the app id sanitized by
app_id_env_prefix.
Structs§
- Config
File - A loaded per-application config file.
- Credentials
Config - The
[credentials]table of the engine config file. - Engine
Config - Top-level engine configuration parsed from
config.toml. - Output
Config - The
[output]table of the engine config file. - Parse
Credential Store Error - Error returned when a string does not name a
CredentialStorevariant.
Enums§
- Credential
Store - Where an auth provider stores credentials.
Functions§
- config_
file_ path - Returns the path to the engine config file for
app_id, if a base config directory can be resolved andapp_idis a safe single path component. - credential_
store_ env_ var - Derives the credential-store override env var from an app id, e.g.
godaddy->GODADDY_CREDENTIAL_STORE. - load
- Loads the engine-reserved config for
app_id. - resolve_
credential_ store - Resolves the effective
CredentialStoreforapp_idagainst process state. - resolve_
credential_ store_ with - Resolves the effective
CredentialStorefrom explicit inputs.