opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feature: {env:MY_VAR} support in the frontmatter of agent/command markdown files (resolves #5054, #5082)

Open ariane-emory opened this issue 1 month ago • 2 comments

Resolves #5054. Resolves #5082.

feat: add {env:VAR} interpolation support to markdown frontmatter

  • Add {env:VAR} interpolation to ConfigMarkdown.parse() for frontmatter fields only
  • Enables dynamic model selection via environment variables in markdown agents, amongst other possibilities
  • Gracefully handles missing environment variables with empty string fallback
  • Add comprehensive test coverage for interpolation functionality
  • Resolves GitHub issue #5054

Example usage:

description: "My agent" model: "{env:MODEL}" mode: primary

commit b9c1f100160d663e6372cf114d1d86d4c9575237 (upstream/dev, upstream/HEAD, origin/dev, origin/HEAD, dev)

ariane-emory avatar Dec 05 '25 02:12 ariane-emory