词元之母TOK.MOM - 平台充值汇率 1:1 即 1 人民币充值到账 1 美元,支持一个 Key 调用近 600+ 海内外模型,限时特价模型低至 1 折,欢迎上岸!

一句话总结:自定义斜杠命令,用 /命令名一键触发复杂任务。

| 位置 | 作用范围 | 说明 |
|---|---|---|
.opencode/command/**/*.md | 当前项目 | 支持嵌套目录 |
.opencode/commands/**/*.md | 当前项目 | commands 复数形式也支持 |
~/.config/opencode/command/**/*.md | 全局 | 所有项目共享 |
来源:config.ts#L191
.opencode/
└── command/
├── review.md → /review
├── git/
│ ├── commit.md → /git/commit
│ └── changelog.md → /git/changelog
└── test/
└── coverage.md → /test/coverage.opencode/command/test.md:/testopencode.jsonc 中配置:{
"$schema": "https://opencode.ai/config.json",
"command": {
// 键名就是命令名
"test": {
// template 是必需字段
"template": "运行完整的测试套件,生成覆盖率报告。\n重点关注失败的测试并提供修复建议。",
"description": "运行测试并显示覆盖率",
"agent": "build",
"model": "anthropic/claude-opus-4-5-thinking"
}
}
}/test两种方式对比:Markdown 更适合复杂提示词(多行、格式化);JSON 适合简单命令或批量管理。
来源:config.ts#L450
来源:官方文档 - Agent
primary,也强制作为 subagent 执行来源:官方文档 - Subtask
/component Button → 将 $ARGUMENTS 替换为 Button$1 → config.json$2 → src$3 → { "key": "value" }command - Shell 命令输出#命令在项目根目录执行,输出成为提示词的一部分。
@src/file.ts - 相对路径@./relative/path.ts - 显式相对路径来源:markdown.ts#L6
.opencode/command/review.md