Terminal Helper — a runbook for OpenClaw exec
This skill is not a “generic terminal tips” template.
It’s a concrete runbook for how to use OpenClaw’s exec tool effectively in a real workspace (like your /Users/.../clawd workspace), with attention to:
- - sandbox vs host execution
- predictable working directories
- long-running processes
- permissions on macOS (Peekaboo, screen recording, UI automation)
- avoiding “accidental shell scripting” disasters
OpenClaw skills are loaded from bundled skills, ~/.openclaw/skills, and <workspace>/skills with workspace taking precedence. :contentReference[oaicite:12]{index=12}
Operating principles (what I will do every time)
1) State the intent + the exact command before running it
Before calling
exec, I will say:
- - what the command is intended to do
- what directory it will run in
- what files it might read/write
- what output I expect (so we can spot anomalies)
2) Default to read-only exploration
When debugging or orienting:
- -
pwd, ls -la, git status, rg, cat, head, INLINECODE11 - only escalate to writes/installs after we know what’s going on
3) Prefer sandboxed execution for untrusted or high-churn work
Use the sandbox for:
- - tests, builds, dependency installs
- exploring unknown repos
- running scripts from third-party sources
Important nuance:
If a session is sandboxed, the sandbox does not inherit host process.env.
Global env and skills.entries.<skill>.env/apiKey apply to host runs only; sandbox env must be set separately. :contentReference[oaicite:13]{index=13}
4) Explicit confirmation for anything risky
I will require the user to confirm before:
- - deleting or overwriting files
- installing system-level packages
- touching
~/.ssh, keychains, browser profiles - changing network/system settings
- running privileged commands (
sudo, launchctl changes)
Execution patterns (the “how”)
A) Choose a working directory deliberately
When diagnosing OpenClaw itself, I’ll work inside your workspace (example:
/Users/proman/clawd) and be explicit about it.
Typical commands:
-
ls -la ./skills
-
find ./skills -maxdepth 2 -name SKILL.md -print
-
git status (if the workspace is a git repo)
- INLINECODE20
B) Keep commands single-purpose
Prefer multiple small commands over one “do everything” pipeline. This makes it easier to review and safer to approve.
C) Long-running commands: background + poll
When supported, run with a short yield and then poll a process session.
Examples you can adapt:
-
exec: make test (with a short yield)
-
process: poll (using the returned session id)
(Exact parameter names depend on your tool surface, but the pattern is: yield → poll.)
Practical playbooks
Playbook 1: “My skill isn’t loading”
1) Confirm skill location/precedence:
- OpenClaw loads
<workspace>/skills and that wins precedence. :contentReference[oaicite:14]{index=14}
2) Verify the skill folder has
SKILL.md and valid frontmatter.
3) If you changed files, ensure watcher is enabled:
-
skills.load.watch: true is the default pattern. :contentReference[oaicite:15]{index=15}
Playbook 2: “Peekaboo works in Terminal but fails in OpenClaw”
This is usually macOS TCC context + daemon behavior. A common fix is enabling PeekabooBridge in OpenClaw.app:
- - Settings → Enable Peekaboo Bridge :contentReference[oaicite:16]{index=16}
Then validate:
- -
peekaboo bridge status --verbose should select a host (OpenClaw.app) rather than local (in-process). :contentReference[oaicite:17]{index=17}
Playbook 3: “ClawHub sync rejects my skill docs”
ClawHub has a quality gate (language-aware word counting and heuristics) that rejects docs that are too thin/templated. :contentReference[oaicite:18]{index=18}
Fix by adding:
- - concrete examples
- troubleshooting
- environment notes (sandbox, PATH, permissions)
- “what/why/when/how” that is clearly specific to the skill
What I will NOT do
- - I will not run remote “install scripts” (e.g.,
curl | sh) without explicit user request and review. - I will not paste or echo secrets into commands.
- I will not make destructive changes without confirming the exact file paths.
Quick commands I often start with
- - INLINECODE29
- INLINECODE30
- INLINECODE31
- INLINECODE32
- INLINECODE33
- INLINECODE34
If you want raw, direct execution (no model involvement), use /term.
终端助手 — OpenClaw exec 操作手册
该技能并非“通用终端技巧”模板。
它是一份具体操作手册,指导如何在真实工作区(如 /Users/.../clawd 工作区)中有效使用 OpenClaw 的 exec 工具,重点关注:
- - 沙箱与宿主机执行
- 可预测的工作目录
- 长时间运行的进程
- macOS 权限(Peekaboo、屏幕录制、UI 自动化)
- 避免“意外 shell 脚本”灾难
OpenClaw 技能从捆绑技能、~/.openclaw/skills 和 /skills 加载,工作区优先级最高。:contentReference[oaicite:12]{index=12}
操作原则(我将始终遵循)
1) 在执行前说明意图和确切命令
调用 exec 前,我会说明:
- - 命令的预期功能
- 将在哪个目录运行
- 可能读取/写入哪些文件
- 预期输出(以便发现异常)
2) 默认以只读方式探索
调试或定位问题时:
- - pwd、ls -la、git status、rg、cat、head、tail
- 只有在了解情况后才升级为写入/安装操作
3) 对不可信或高频变更工作优先使用沙箱执行
沙箱适用于:
- - 测试、构建、依赖安装
- 探索未知仓库
- 运行第三方来源的脚本
重要细节:
如果会话处于沙箱中,沙箱不会继承宿主机的 process.env。
全局环境变量和 skills.entries..env/apiKey 仅适用于宿主机运行;沙箱环境变量需单独设置。:contentReference[oaicite:13]{index=13}
4) 任何风险操作需明确确认
在以下情况前,我需要用户确认:
- - 删除或覆盖文件
- 安装系统级软件包
- 操作 ~/.ssh、钥匙串、浏览器配置文件
- 更改网络/系统设置
- 运行特权命令(sudo、launchctl 变更)
执行模式(“如何”执行)
A) 有意识地选择工作目录
诊断 OpenClaw 自身问题时,我会在你的工作区(例如:/Users/proman/clawd)内操作,并明确说明。
典型命令:
- ls -la ./skills
- find ./skills -maxdepth 2 -name SKILL.md -print
- git status(如果工作区是 git 仓库)
- which peekaboo || echo peekaboo not on PATH
B) 保持命令单一用途
优先使用多个小命令,而非一个“包罗万象”的管道。这样更易于审查,也更安全。
C) 长时间运行命令:后台运行 + 轮询
在支持的情况下,先短时间运行,然后轮询进程会话。
可参考的示例:
- exec: make test(短时间运行)
- process: poll(使用返回的会话 ID)
(具体参数名称取决于你的工具接口,但模式为:运行 → 轮询。)
实用操作手册
操作手册 1:“我的技能无法加载”
1) 确认技能位置/优先级:
- OpenClaw 加载
/skills,且该位置优先级最高。:contentReference[oaicite:14]{index=14}
2) 验证技能文件夹包含 SKILL.md 和有效的前置元数据。
3) 如果修改了文件,确保监视器已启用:
- skills.load.watch: true 是默认模式。:contentReference[oaicite:15]{index=15}
操作手册 2:“Peekaboo 在终端中正常,但在 OpenClaw 中失败”
这通常是 macOS TCC 上下文和守护进程行为导致。常见解决方法是启用 OpenClaw.app 中的 PeekabooBridge:
- - 设置 → 启用 Peekaboo Bridge :contentReference[oaicite:16]{index=16}
然后验证:
- - peekaboo bridge status --verbose 应选择宿主机(OpenClaw.app)而非 local (in-process)。:contentReference[oaicite:17]{index=17}
操作手册 3:“ClawHub 拒绝同步我的技能文档”
ClawHub 设有质量门槛(基于语言感知的词数统计和启发式规则),会拒绝过于单薄/模板化的文档。:contentReference[oaicite:18]{index=18}
解决方法:添加
- - 具体示例
- 故障排除
- 环境说明(沙箱、PATH、权限)
- 明确针对该技能的“是什么/为什么/何时/如何”
我不会做的事情
- - 未经用户明确请求和审查,不会运行远程“安装脚本”(如 curl | sh)。
- 不会在命令中粘贴或回显密钥。
- 未经确认确切文件路径,不会进行破坏性更改。
我常用的快速命令
- - pwd
- ls -la
- git status
- rg -n error|warn|TODO .
- uname -a
- node -v && python -V
如需原始直接执行(无模型参与),请使用 /term。