You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: allow shell commands in the frontmatter #5082
OPENCODE_MODEL_CHEAP=anthropic/claude-haiku-4-5
OPENCODE_MODEL_DEFAULT=anthropic/claude-sonnet-4-5
OPENCODE_MODEL_PREMIUM=anthropic/claude-opus-4-5
bun run dev
[FEATURE]: custom model aliases #3439: [custom model aliases] - Similar concept of dynamic model selection without editing files, proposes using aliases
A potentially more efficient alternative might be to employ the same {env:SOME_VAR} / {file:some_file} syntax that is already supported in the opencode.json file.
Accessing an environment variable is such a trivial task, very many programs (including opencode itself in the JSON context used for the config) can just read environment variables directly without needing to start up a whole new shell in order to do it.
The code that opencode uses to do this in the configuration file can be found in packages/opencode/src/config/config.ts somewhere near line ~725 or so.
Reacted by atkr, shuv, Brian Sunter and Juliusz Ćwiąkalski
Actually, we probably only want the f(env:SOME_VAR} syntax for MD frontmatter, the {file:some_file} syntax doesn't seem like it would be terribly useful in the context of frontmatter.
Adding another use case: I’m looking for actual shell command execution in frontmatter, not just variable substitution.
I keep a small YAML config file per repo to inform the agent about repo-specific details (e.g. where my specs directory is, other project paths, etc). I use yq to pull values out of that YAML and inject them into command markdown so the agent knows where to go look for things. I use this pattern pretty broadly.
One specific thing I’d like to drive from that same repo config is model selection per project. The goal is to keep command files generic/portable and avoid editing them per repo, while still letting each repo say "use model X for this project".
I could do this with env vars, but that tends to add more setup and tooling (direnv, docs, onboarding steps). Especially when collaborating, it’s much simpler if the repo just carries a YAML config and commands can read it directly.
So this feature would unlock a clean repo-config-controls-behavior pattern, not just templating convenience.
Activity
github-actions commentedon Dec 4, 2025
This issue might be a duplicate of existing issues. Please check:
The core feature request appears to be dynamic configuration through shell command evaluation in frontmatter, which would enable:
Feel free to ignore if your specific case differs from these existing feature requests.
rwese commentedon Dec 4, 2025
I could adapt it to be as #5054 my thought was to stick with the way the yaml files are currently using shell-commands.
#3439 would be too abstract for my liking
ariane-emory commentedon Dec 4, 2025
A potentially more efficient alternative might be to employ the same
{env:SOME_VAR}/{file:some_file}syntax that is already supported in theopencode.jsonfile.Accessing an environment variable is such a trivial task, very many programs (including opencode itself in the JSON context used for the config) can just read environment variables directly without needing to start up a whole new shell in order to do it.
The code that opencode uses to do this in the configuration file can be found in
packages/opencode/src/config/config.tssomewhere near line ~725 or so.ariane-emory commentedon Dec 4, 2025
Actually, we probably only want the
f(env:SOME_VAR}syntax for MD frontmatter, the{file:some_file}syntax doesn't seem like it would be terribly useful in the context of frontmatter.Toady00 commentedon Mar 1, 2026
Adding another use case: I’m looking for actual shell command execution in frontmatter, not just variable substitution.
I keep a small YAML config file per repo to inform the agent about repo-specific details (e.g. where my specs directory is, other project paths, etc). I use
yqto pull values out of that YAML and inject them into command markdown so the agent knows where to go look for things. I use this pattern pretty broadly.One specific thing I’d like to drive from that same repo config is model selection per project. The goal is to keep command files generic/portable and avoid editing them per repo, while still letting each repo say "use model X for this project".
I could do this with env vars, but that tends to add more setup and tooling (direnv, docs, onboarding steps). Especially when collaborating, it’s much simpler if the repo just carries a YAML config and commands can read it directly.
So this feature would unlock a clean repo-config-controls-behavior pattern, not just templating convenience.
github-actions commentedon May 1, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.