跳到主要内容

斜杠命令

斜杠命令是以 / 开头的 command message。在 TUI 中,命令由本地 command catalog 加上 gateway command catalog 提供补全和分组。在 messaging channels 中,只会分发该 channel 支持的命令; 以未知斜杠开头的普通文本不会被当成隐藏运行时操作。

在 TUI 中使用 /help 列出命令,或使用 /help COMMAND 查看某个命令的 source、running behavior、surfaces、handler、audit category 和 usage。

Surfaces 与 Busy Behavior

Surface命令如何解析
TUI先检查本地 TUI commands,再使用 gateway command metadata。
One-shot CLIShell commands 不是 slash commands;prompt 使用 anyy chat
Messaging channelsAdapter 只分发暴露给 channel surfaces 的命令。
API/runtime clients通过 gateway command descriptors 驱动命令。

Running behavior 是每个 command descriptor 的一部分:

Behavior含义
local_only由当前 surface 处理,不进入 gateway execution。
bypassTurn 活跃时也可以运行。
queue排到 active turn 后面。
steer给 active turn 增加指导。
reject_while_runningActive turn 完成或停止前拒绝运行。

TUI 斜杠命令

本地 TUI 命令在终端应用内处理:

命令用途
/help [topic]显示帮助或某个命令的详情。
/quit退出 TUI。
/new开始新 session;如果当前 session 有可见内容,会先确认。
`/compact onoff`
/resume [SESSION_ID]打开 session picker 或恢复指定 session。
`/busy queuesteer
/copy在剪贴板可用时复制最近的 assistant response。
/paste显示当前终端的 paste 指引。
`/details hiddencompact
`/reasoning showhide
/fast显示或切换 fast model mode。
/logs显示本地 TUI messages。
/insights显示轻量 usage information。
/history显示当前 session history。
/save将当前 session 导出到文件。
/branch [title]分支当前 session。
/background <prompt>在后台 child agent 中运行 prompt。
/agents显示当前 session 的 child agents。
/jobs显示当前 session 的 background jobs。
/job <id> / /job kill <id>检查或停止一个 background job。
/profile显示 active profile detail。
/config显示 active configuration。
/statusbar切换 status bar。
/queue检查或排队 messages。
/redraw清屏并重绘终端。
/undo在没有 turn 正在运行时撤销上一次 exchange。
/retry在没有 turn 正在运行时重试上一条 user message。

TUI 也会显示当前 surface 可用的 gateway commands。如果 gateway command 与 local command 同名, 在 TUI 中 local command 优先。

Messaging 斜杠命令

运行时 command registry 会向 messaging adapters 暴露 channel-capable commands。当前带 channel surfaces 的内置命令包括:

命令用途
/help显示可用命令。
/new开始新的 channel session。
/resume在 surface 支持时恢复现有 session。
/sessions列出最近 sessions。
/status显示 runtime status。
/stop停止正在运行的 turn。
/queue将输入排到正在运行的 turn 之后。
/btw给正在运行的 turn 添加指导;/steer 是 alias。
/retry重试上一次失败的 turn。
/approve批准 pending request。
/deny拒绝 pending request。
/voice管理某个 channel conversation 的 voice replies。

Channel adapters 也可以暴露动态 skill commands。这些命令通过 active skill catalog 解析,并 作为 session input 发送,同时为该 turn 加载 skill 内容。

Session Commands

命令行为
/new创建新 session。
/resume [SESSION_ID]恢复已知 session,或打开 picker/list。
/sessions列出最近 sessions。
/history显示当前 session 的 messages。
/branch [title]创建链接到当前 session 的 child session。
/compress通过 gateway 压缩 session context。
/stop停止正在运行的 turn。
/queue <text>在 turn 活跃时排队 text。
/btw <text>用额外指导 steer active turn。
/undo回退最近一次 exchange。
/retry重新运行上一条 user message。

有些命令会在 turn 运行时被拒绝;有些会 bypass busy turn,或有意 queue/steer。

Model Commands

命令行为
/model显示当前 session 的 active model。
/model list列出 models。
/model set ...在当前 runtime 支持时改变 model scope。
/provider检查 configured providers 和 provider auth。

具体 model/provider 子命令由 gateway command handler 解析,而不是 TUI 解析。请在 TUI 中使用 /help /model/help /provider 查看当前加载的 command metadata。

Cron Commands

命令行为
/cron通过 runtime command handler 管理 scheduled tasks。

非交互式 cron 管理请查看 CLI 参考:CLI 命令

Skill Commands

命令行为
/skills列出可用 skills。
/skill显示 skill 详情。
/reload-skillsReload skill metadata。
/tools列出可用 tools。
/toolsets列出可用 toolsets。
/mcp显示 MCP server 和 tool status。
/reload-mcpReload MCP server catalogs。

已安装 skills 声明 commands 时,也可能出现动态 skill commands。它们受 active profile、role、 surface 和 runtime visibility 限定。

Runtime Management Commands

这些 built-ins 由 gateway command catalog 注册。实际可用性仍可能受 surface、profile configuration 和 active runtime state 影响。

命令行为
/title显示或设置当前 session title。
/goal设置、查看、暂停、恢复或清除 session goal。
/changeplans列出 pending 或 recent ChangePlans。
/plan显示或更新一个 ChangePlan。
/channels管理 channel runtime state。
/weixin status显示 Weixin channel status。
/pair为支持的 channel flows 创建 pairing request。
/secrets通过 runtime handler 管理 secret references。
/usage显示 provider 和 tool usage。
/logs显示 recent runtime logs。
/audit显示 audit events。
/doctor运行 runtime diagnostics。
/debug在没有 turn 正在运行时创建 redacted debug bundle。
/footer在 local TUI 支持时切换 TUI footer detail。