Skip to content

Support generic environment config overrides #199

@ewgdg

Description

@ewgdg

Summary

Add generic environment-variable overrides for cliamp configuration values, mainly so secrets do not need to be stored in ~/.config/cliamp/config.toml.

Proposal

Support environment variables with this shape:

CLIAMP_CONFIG__<KEY>
CLIAMP_CONFIG__<SECTION>__<KEY>

Mapping examples:

CLIAMP_CONFIG__PROVIDER=ytmusic
CLIAMP_CONFIG__YTMUSIC__CLIENT_ID=...
CLIAMP_CONFIG__YTMUSIC__CLIENT_SECRET=...
CLIAMP_CONFIG__NAVIDROME__PASSWORD=...
CLIAMP_CONFIG__PLEX__TOKEN=...
CLIAMP_CONFIG__JELLYFIN__TOKEN=...

These map to TOML values like:

provider = "ytmusic"

[ytmusic]
client_id = "..."
client_secret = "..."

[navidrome]
password = "..."

Nested sections can use additional __ separators, for example:

CLIAMP_CONFIG__PLUGINS__LASTFM__API_KEY

maps to:

[plugins.lastfm]
api_key = "..."

Precedence

defaults < config.toml < environment overrides < CLI flags

Scope

  • Support config values generically, including top-level keys and existing config sections.
  • Do not execute shell commands from config or environment variables.
  • No stdin config support needed.
  • Keep provider-specific environment variable sprawl out of the codebase.

Why

  • Keeps secrets out of ~/.config/cliamp/config.toml.
  • Works with secret managers and deployment tools that inject environment variables.
  • Small, safe, cross-platform feature.
  • Avoids adding separate env var names for every provider and secret.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions