Commands Not Recieving Context #3418

Open
opened 2026-02-16 17:40:00 -05:00 by yindo · 4 comments
Owner

Originally created by @AbbasCiatek on GitHub (Dec 9, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

I create a command in the .opencode/command directory in a project, if I run the command in the terminal via
opencode run translate --model opencode/big-pickle or another model the command context "template" is not being provided, while if I run it in the GUI it puts the template in the message and it runs.

I'm sure about this because I even copied the commit command md file while keeping the command file the same in the opencode project and still the model outputed this:

➜ opencode run translate --model nvidia/minimaxai/minimax-m2

<think>The user has just said "translate" which is very vague. I need to understand what they want me to translate. They could want me to:

1. Translate text from one language to another
2. Translate code from one programming language to another
3. Translate documentation
4. Something else entirely

Since this is ambiguous, I should ask for clarification about what specifically they want translated and from/to what languages or formats.
</think>

I need more information to help you translate. Could you please specify:

1. What do you want translated? (text, code, documentation, etc.)
2. What is the source language/format?
3. What is the target language/format?

For example:
- "Translate this English text to Spanish"
- "Convert this Python code to JavaScript"
- "Translate this API documentation from English to French"

```



### OpenCode version

1.0.137

### Steps to reproduce

1. Create a command md file
2. Run command in terminal via opencode run <command> --model
3. Profit

### Screenshot and/or share link

_No response_

### Operating System

ArchLinux Btw

### Terminal

Wezterm
Originally created by @AbbasCiatek on GitHub (Dec 9, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description I create a command in the .opencode/command directory in a project, if I run the command in the terminal via opencode run translate --model opencode/big-pickle or another model the command context "template" is not being provided, while if I run it in the GUI it puts the template in the message and it runs. I'm sure about this because I even copied the commit command md file while keeping the command file the same in the opencode project and still the model outputed this: ```` ➜ opencode run translate --model nvidia/minimaxai/minimax-m2 <think>The user has just said "translate" which is very vague. I need to understand what they want me to translate. They could want me to: 1. Translate text from one language to another 2. Translate code from one programming language to another 3. Translate documentation 4. Something else entirely Since this is ambiguous, I should ask for clarification about what specifically they want translated and from/to what languages or formats. </think> I need more information to help you translate. Could you please specify: 1. What do you want translated? (text, code, documentation, etc.) 2. What is the source language/format? 3. What is the target language/format? For example: - "Translate this English text to Spanish" - "Convert this Python code to JavaScript" - "Translate this API documentation from English to French" ``` ### OpenCode version 1.0.137 ### Steps to reproduce 1. Create a command md file 2. Run command in terminal via opencode run <command> --model 3. Profit ### Screenshot and/or share link _No response_ ### Operating System ArchLinux Btw ### Terminal Wezterm
yindo added the bug label 2026-02-16 17:40:00 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 9, 2025):

This is a specific issue about custom commands not receiving context when executed via the CLI (opencode run) compared to the GUI.

While there are some related issues about command execution problems:

  • #3154: Commands lock OpenCode
  • #1852: Commands that need sudo access break the UI
  • #3213: opencode run hangs on v0.15+

This appears to be a distinct bug where the command template/context is missing in CLI execution but present in GUI execution. The root cause seems to be that the frontmatter context from the command markdown file is not being properly passed to the model when invoked via CLI.

@github-actions[bot] commented on GitHub (Dec 9, 2025): This is a specific issue about custom commands not receiving context when executed via the CLI (`opencode run`) compared to the GUI. While there are some related issues about command execution problems: - #3154: Commands lock OpenCode - #1852: Commands that need sudo access break the UI - #3213: `opencode run` hangs on v0.15+ This appears to be a distinct bug where the command template/context is missing in CLI execution but present in GUI execution. The root cause seems to be that the frontmatter context from the command markdown file is not being properly passed to the model when invoked via CLI.
Author
Owner

@AbbasCiatek commented on GitHub (Dec 9, 2025):

Side note the command will not work without specifying a model, it will throw a default provider error.

@AbbasCiatek commented on GitHub (Dec 9, 2025): Side note the command will not work without specifying a model, it will throw a default provider error.
Author
Owner

@rekram1-node commented on GitHub (Dec 9, 2025):

to run a command with opencode run you need to use command flag are you doing that?

@rekram1-node commented on GitHub (Dec 9, 2025): to run a command with opencode run you need to use command flag are you doing that?
Author
Owner

@iamralch commented on GitHub (Dec 24, 2025):

In my case, the issue also occurs when running a command from the OpenCode TUI. This is a major blocker for my development workflow.

@iamralch commented on GitHub (Dec 24, 2025): In my case, the issue also occurs when running a command from the OpenCode TUI. This is a major blocker for my development workflow.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3418