Skip to content

feat: allow env placeholders in config files#42

Merged
Helweg merged 3 commits intomainfrom
feature/issue-40-env-substitution
Mar 29, 2026
Merged

feat: allow env placeholders in config files#42
Helweg merged 3 commits intomainfrom
feature/issue-40-env-substitution

Conversation

@Helweg
Copy link
Copy Markdown
Owner

@Helweg Helweg commented Mar 29, 2026

Summary

Allow .opencode/codebase-index.json to reference environment variables with exact {env:VAR_NAME} placeholders so secrets such as custom provider API keys do not need to be committed.

Changes

  • add config placeholder resolution for exact {env:VAR_NAME} string values during parseConfig
  • resolve only the config fields that are actually used so inactive branches like unused customProvider settings do not fail startup
  • reject malformed placeholder-like strings early, add parser coverage, and document the supported syntax in the README

Testing

How were these changes tested?

  • Unit tests added/updated
  • Manual testing performed
  • Build passes (npm run build)
  • Typecheck passes (npm run typecheck)
  • Tests pass (npm run test:run)
  • Lint passes (npm run lint)

Release Labels

  • Added at least one release category label (feature, bug, performance, documentation, dependencies, refactor, test, chore, or skip-changelog)
  • Added at most one semver label (semver:major, semver:minor, semver:patch) when needed

Related Issues

Fixes #40

@Helweg Helweg added feature New feature or capability semver:minor New feature (minor bump) labels Mar 29, 2026
@github-actions github-actions bot added documentation Documentation changes test Test changes labels Mar 29, 2026
@Helweg Helweg merged commit 4898715 into main Mar 29, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes feature New feature or capability semver:minor New feature (minor bump) test Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Allow env substitution in config file

1 participant