词元之母TOK.MOM - 平台充值汇率 1:1 即 1 人民币充值到账 1 美元,支持一个 Key 调用近 600+ 海内外模型,限时特价模型低至 1 折,欢迎上岸!
在输入框输入 /即可触发命令菜单,或按Ctrl+P打开命令面板

| 命令 | 功能 | 说明 |
|---|---|---|
/new | 新建会话 | 创建新对话 |
/sessions | 会话列表 | 查看历史会话 |
/models | 模型切换 | 选择模型 |
/connect | 添加提供商 | 配置 API Key |
/undo | 撤销 | 撤销文件修改 |
/redo | 重做 | 重做撤销的修改 |
/share | 分享 | 生成分享链接 |
/unshare | 取消分享 | 取消分享 |
/compact | 压缩 | 压缩上下文 |
/editor | 编辑器 | 打开外部编辑器 |
/export | 导出 | 导出会话 |
/theme | 主题 | 切换主题 |
/init | 初始化 | 生成项目规则 |
/help | 帮助 | 显示帮助 |
注意:命令没有短别名。例如 /themes应为/theme。
/new/sessions/models/connect~/.local/share/opencode/auth.json。/undo # 撤销上一次修改
/redo # 重做撤销的修改/share # 生成分享链接
/unshare # 取消分享/compact/editor/export/themeopencode - 默认system - 自适应终端tokyonight - 东京之夜catppuccin - 猫布奇诺gruvbox - Gruvboxnord - 北欧注意:命令是 /theme,不是/themes。
/init/help项目级:.opencode/command/*.md
全局级:~/.config/opencode/command/*.md/review @src/main.ts| 占位符 | 说明 |
|---|---|
$ARGUMENTS | 全部参数 |
$1, $2, ... | 第 N 个参数 |
!command`` | Shell 命令输出 |
@file | 文件引用 |
来源:commands.mdx
{
"command": {
"test": {
"template": "运行测试并报告失败的用例",
"description": "运行测试",
"agent": "build",
"model": "anthropic/claude-sonnet-4-20250514",
"subtask": false
}
}
}| 选项 | 类型 | 必填 | 说明 |
|---|---|---|---|
template | string | ✅ | 发送给 LLM 的提示词 |
description | string | 可选 | TUI 中显示的命令描述 |
agent | string | 可选 | 执行命令的 Agent |
model | string | 可选 | 覆盖默认模型 |
subtask | boolean | 可选 | 强制作为子任务执行(不污染主上下文) |
subtask 说明:如果命令指定的 agent 是 subagent,默认会触发子任务调用。设置 subtask: false可禁用此行为;设置subtask: true则强制以子任务方式执行,即使 agent 的 mode 是 primary。
| 我要... | 输入 |
|---|---|
| 开始新对话 | /new |
| 看历史对话 | /sessions |
| 换个模型 | /models |
| 添加提供商 | /connect |
| 撤销修改 | /undo |
| 压缩对话 | /compact |
| 换个主题 | /theme |
| 分享会话 | /share |