Skip to content

Support {file:...} / {env:...} variable interpolation for usage plugin secrets #17

@bogorad

Description

@bogorad

The usage plugin reads config/auth values as literal strings, so secret file references are not resolved. This makes it hard to use secret managers such as sops-nix where keys are exposed as files in /run/secrets/....

Current behavior

  • usage-config.jsonc fields (for example apiKey) are parsed as plain JSONC and used directly.
  • Auth entries used by providers are consumed as raw key / access strings.
  • Values like {file:/run/secrets/proxy_api_key} or {env:PROXY_API_KEY} are not expanded.

Expected behavior

Support the same variable interpolation style as OpenCode config:

  • {env:VAR_NAME}
  • {file:/absolute/or/relative/path}

Why this matters

Many setups (including NixOS + sops-nix) store secrets as files under /run/secrets/.... Without interpolation support, users must keep/duplicate secrets in plain text config, a big no-no for some setups.

Reference (OpenCode config behavior)

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