Expand description
Configuration and authentication for the ROMM client.
This module is deliberately independent of any particular frontend:
both the TUI and the command-line subcommands share the same Config
and AuthConfig types.
§Environment file precedence
Call load_config to read config:
- Variables already set in the process environment (highest priority).
- Project
.envin the current working directory (viadotenvy). - User config:
{config_dir}/romm-cli/.env— fills keys not already set (so a repo.envwins over user defaults). - OS keyring — secrets stored by
romm-cli init(lowest priority fallback).
§load_config vs config.json
load_config merges sources per field: process environment wins over values from
config.json for API_BASE_URL, ROMM_DOWNLOAD_DIR, API_USE_HTTPS, and auth-related
variables. The keyring is used only to fill missing or placeholder secrets after that merge.
Structs§
Enums§
Constants§
- KEYRING_
SECRET_ PLACEHOLDER - Written to
config.jsonwhen the real secret is stored in the OS keyring (persist_user_config).
Functions§
- is_
keyring_ placeholder - True if
sis the sentinel written to disk when the secret lives in the keyring. - keyring_
store - Store a secret in the OS keyring under the
romm-cliservice name. - load_
config - normalize_
romm_ origin - RomM site URL: the same origin you use in the browser (scheme, host, optional port).
- openapi_
cache_ path - Where the OpenAPI spec is cached (
.../romm-cli/openapi.json). - persist_
user_ config - Write user-level
romm-cli/config.jsonand store secrets in the OS keyring when possible (same layout as interactiveromm-cli init). - read_
user_ config_ json_ from_ disk - Reads
config.jsonfrom disk only (no env merge, no keyring resolution). Used by the TUI setup wizard to detect<stored-in-keyring>placeholders. - user_
config_ dir - Directory for user-level config (
romm-cliunder the OS config dir). - user_
config_ json_ path - Path to the user-level
config.jsonfile (.../romm-cli/config.json).