OpenCode — Commands
- File format
- Markdown
- Discovery path
-
.opencode/commands - Global install path
-
~/.config/opencode/commands - Syllago install method
- Symlink, Direct copy
- Symlink support
- Yes
- Native frontmatter fields
-
description,agent,model,subtask
Features
How each feature converts to syllago's canonical format. See format conversion for what these statuses mean.
Fields
Native frontmatter or config fields this provider exposes. The first column is the provider's own field name; the canonical key column links to syllago's cross-provider equivalent.
| Provider field | Conversion | Canonical key | Summary |
|---|---|---|---|
agent | Translated Conversion type: Translated Actively mapped to the target provider’s equivalent field during conversion. Learn more → | — | Frontmatter agent field routes the command to a specific named agent. If the agent is a subagent, the command triggers a subagent invocation by default (can be disabled with subtask: false). |
model | Translated Conversion type: Translated Actively mapped to the target provider’s equivalent field during conversion. Learn more → | — | Frontmatter model field overrides the default model for this command invocation. |
template | Translated Conversion type: Translated Actively mapped to the target provider’s equivalent field during conversion. Learn more → | — | When commands are defined inline in opencode.json under the command key, the prompt body is specified via a template string field (rather than markdown body). description, agent, model, and subtask are also valid fields. |
subtask | Conversion type: No canonical equivalent — appended as prose in a conversion notes block so nothing is silently lost. Learn more → | — | Frontmatter subtask boolean forces the command to trigger a subagent invocation, preventing pollution of the primary context. Useful even when the agent's mode is primary. |
Other features
Behaviors, conventions, and capabilities that aren't tied to a single named field — things like path-based activation, discovery rules, and lifecycle behavior.
| Feature | Conversion | Summary |
|---|---|---|
argument_substitution | Translated Conversion type: Translated Actively mapped to the target provider’s equivalent field during conversion. Learn more → | Commands support $ARGUMENTS (all arguments as a single string) and positional parameters $1, $2, $3, etc. for individual arguments; all placeholders are substituted from user input at invocation time |
builtin_commands | Translated Conversion type: Translated Actively mapped to the target provider’s equivalent field during conversion. Learn more → | OpenCode ships built-in commands including /init, /undo, /redo, /share, and /help; custom commands can override built-in commands if given the same name |
| @filename file content injection | Conversion type: No canonical equivalent — appended as prose in a conversion notes block so nothing is silently lost. Learn more → | Commands support @path/to/file syntax in the template body. The file content is automatically included in the prompt at invocation time. |
| Shell output injection | Conversion type: No canonical equivalent — appended as prose in a conversion notes block so nothing is silently lost. Learn more → | Commands support !`shell command` syntax in the template body. The shell command runs in the project root and its stdout is injected into the prompt at invocation time. |
Sources
| Source |
|---|
| https://opencode.ai/docs/commands/ |