GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [FEATURE]: allow shell commands in the frontmatter · Issue #5082 · anomalyco/opencode

[FEATURE]: allow shell commands in the frontmatter #5082

New issue
Copy link
New issue
Copy link
Closed as not planned
ariane-emory/opencode
#30
ariane-emory/opencode#30
Closed as not planned
[FEATURE]: allow shell commands in the frontmatter#5082
ariane-emory/opencode
#30
Copy link
Assignees
rekram1-node
Labels
discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Description

@rwese
rwese
opened on Dec 4, 2025
Issue body actions

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Why - to be able to customize commands, agents configuration to set different models by cost or using local models for testing.

shellcmd.md

---
description: !`echo "${PWD}"`
model: !`echo "${OPENCODE_MODEL_PREMIUM:-anthropic/claude-haiku-4-5}"`
---  
Command prompt...

can be used like this:

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

I implemented this here:

rwese@2c9bf37

Reacted by Brian Sunter and Juan Abia

Activity

  1. rwese
    added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Dec 4, 2025
  2. github-actions commented on Dec 4, 2025

    @github-actions
    github-actionsBot
    on Dec 4, 2025 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • [FEATURE]: {env:MY_VAR} support in agent yaml #5054: [{env:MY_VAR} support in agent yaml] - Requests environment variable substitution support in agent YAML files
    • Custom environment variables when running commands #718: [Custom environment variables when running commands] - Requests ability to set custom environment variables for command execution
    • [FEATURE]: custom model aliases #3439: [custom model aliases] - Similar concept of dynamic model selection without editing files, proposes using aliases
    • [FEATURE]: Configurable command timeout in config.json #3950: [Configurable command timeout in config.json] - Related feature of environment-based configuration through config files
    • Define opencode cache folder as an Environment variable - OPENCODE_CACHE #2432: [Define opencode cache folder as an Environment variable] - Example of using environment variables for configuration

    The core feature request appears to be dynamic configuration through shell command evaluation in frontmatter, which would enable:

    • Setting different models based on environment variables
    • Cost-based model selection
    • Local vs. remote model switching for testing

    Feel free to ignore if your specific case differs from these existing feature requests.

  3. rwese commented on Dec 4, 2025

    @rwese
    rwese
    on Dec 4, 2025
    ContributorAuthor
    More actions

    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

  4. ariane-emory commented on Dec 4, 2025

    @ariane-emory
    ariane-emory
    on Dec 4, 2025
    Contributor
    More actions

    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
  5. ariane-emory commented on Dec 4, 2025

    @ariane-emory
    ariane-emory
    on Dec 4, 2025
    Contributor
    More actions

    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.

  6. rekram1-node
    self-assigned this
    on Dec 13, 2025
  7. Toady00 commented on Mar 1, 2026

    @Toady00
    Toady00
    on Mar 1, 2026
    More actions

    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.

  8. github-actions commented on May 1, 2026

    @github-actions
    github-actionsBot
    on May 1, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  9. github-actions
    closed this as not plannedon May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.