/term — direct terminal execution (exec dispatch)
INLINECODE0 is a power-user shortcut: whatever you type after /term is forwarded as-is to OpenClaw’s exec tool.
This is intentionally “manual mode”:
- - You (the user) provide the exact shell command.
- OpenClaw does not rewrite, expand, or “helpfully” change it.
- It’s useful when you want quick, deterministic terminal actions without a planning loop.
How dispatch works (important)
OpenClaw supports command-dispatch: tool skills. When you run:
the raw argument string (ls -la) is forwarded to the configured tool (exec) without extra parsing. In tool-dispatch mode, OpenClaw invokes the tool with params shaped like:
INLINECODE7
See the Skills docs section on command-dispatch, command-tool, and command-arg-mode. :contentReference[oaicite:10]{index=10}
When to use /term vs normal “agent runs”
Use /term when:
- - You already know the exact command you want.
- You want a quick read-only check (files, git status, grep).
- You are debugging OpenClaw itself (skills folder, logs, Peekaboo bridge status).
Prefer normal agent flow when:
- - You want the model to decide the best approach.
- The task may need multiple steps, safety checks, or file edits.
Safety model (read this once, then follow it)
INLINECODE12 is equivalent to letting an assistant type into your terminal.
Good defaults:
1) Prefer read-only commands unless you mean to change state.
2) Avoid secrets in command lines (tokens, API keys, cookies).
3) Avoid remote execution one-liners:
- no curl ... | sh
- no “download and execute” pipelines
4) If the command could delete or overwrite files, slow down and double-check paths.
Host + sandbox notes
Your actual execution environment depends on how you invoke exec in your setup (sandbox vs host).
Also note: when a session is sandboxed, environment variables are not automatically inherited by the container; you must inject them via sandbox env settings or bake them into the image. :contentReference[oaicite:11]{index=11}
Practical examples
Quick inspection (safe, read-only)
- - INLINECODE15
- INLINECODE16
- INLINECODE17
- INLINECODE18
Debug Peekaboo bridge discovery (macOS)
If the output shows “no such file or directory” for all candidates and “Selected: local (in-process)”, you likely have no bridge host running (see troubleshooting below).
One-liners for structured output
If you want JSON output for parsing:
Troubleshooting
“command not found”
The tool runs in whatever PATH your OpenClaw runtime provides. If you rely on Homebrew, ensure the runtime sees
/opt/homebrew/bin.
“permission denied” / macOS privacy prompts
Some tools (screen capture / UI automation) require Screen Recording / Accessibility. Those permissions are per-process context on macOS; using PeekabooBridge is often the reliable path for automation.
I need richer guidance and guardrails
Install/use the companion skill
terminal-helper (model-invocable) which teaches safe patterns, confirmations, and runbooks.
/term — 直接终端执行(exec 调度)
/term 是一个高级用户快捷方式:你在 /term 后输入的任何内容都会原封不动地转发给 OpenClaw 的 exec 工具。
这有意采用“手动模式”:
- - 你(用户)提供确切的 shell 命令。
- OpenClaw 不会重写、扩展或“善意地”修改它。
- 当你想要快速、确定性的终端操作而不需要规划循环时,这非常有用。
调度工作原理(重要)
OpenClaw 支持 command-dispatch: tool 技能。当你运行:
原始参数字符串(ls -la)会被转发给配置好的工具(exec),无需额外解析。在工具调度模式下,OpenClaw 使用如下形状的参数调用工具:
{ command: <原始参数>, commandName: <斜杠命令>, skillName: <技能名称> }
请参阅技能文档中关于 command-dispatch、command-tool 和 command-arg-mode 的部分。:contentReference[oaicite:10]{index=10}
何时使用 /term 与常规“代理运行”
在以下情况使用 /term:
- - 你已经知道想要的确切命令。
- 你想要快速进行只读检查(文件、git 状态、grep)。
- 你在调试 OpenClaw 本身(技能文件夹、日志、Peekaboo 桥接状态)。
在以下情况优先使用常规代理流程:
- - 你希望模型决定最佳方法。
- 任务可能需要多个步骤、安全检查或文件编辑。
安全模型(仔细阅读一次,然后遵循)
/term 相当于让助手在你的终端中输入命令。
良好实践:
1) 除非你有意改变状态,否则优先使用只读命令。
2) 避免在命令行中包含机密信息(令牌、API 密钥、cookies)。
3) 避免远程执行的一行命令:
- 不要使用 curl ... | sh
- 不要使用“下载并执行”管道
4) 如果命令可能删除或覆盖文件,请放慢速度并仔细检查路径。
主机 + 沙箱说明
你的实际执行环境取决于你在设置中如何调用 exec(沙箱 vs 主机)。
另请注意:当会话被沙箱化时,环境变量不会自动继承到容器中;你必须通过沙箱环境设置注入它们,或将它们烘焙到镜像中。:contentReference[oaicite:11]{index=11}
实用示例
快速检查(安全,只读)
- - /term pwd
- /term ls -la
- /term git status
- /term rg -n TODO|FIXME .
调试 Peekaboo 桥接发现(macOS)
- - /term peekaboo bridge status --verbose
如果输出显示所有候选路径“没有此类文件或目录”且显示“Selected: local (in-process)”,则很可能没有运行中的桥接主机(请参阅下面的故障排除)。
结构化输出的一行命令
如果你想要用于解析的 JSON 输出:
- - /term python -c import json,platform; print(json.dumps({py:platform.python_version()}))
故障排除
“command not found”(命令未找到)
该工具在你的 OpenClaw 运行时提供的任何 PATH 中运行。如果你依赖 Homebrew,请确保运行时能看到 /opt/homebrew/bin。
“permission denied”(权限被拒绝)/ macOS 隐私提示
某些工具(屏幕捕获 / UI 自动化)需要屏幕录制 / 辅助功能权限。在 macOS 上,这些权限是按进程上下文分配的;使用 PeekabooBridge 通常是实现自动化的可靠路径。
我需要更丰富的指导和护栏
安装/使用配套技能 terminal-helper(可模型调用),该技能教授安全模式、确认和运行手册。