exec

GitHub

说明 exec 技能在 just-bash 环境中的运行机制、可用命令及限制,指导用户正确执行脚本与文件操作。

examples/worker-shell/src/skills/exec/SKILL.md cloudflare/computer

触发场景

需要在工作区执行 bash 命令 命令返回 not found 或行为异常时排查原因

安装

npx skills add cloudflare/computer --skill exec -g -y
更多选项

非标准路径

npx skills add https://github.com/cloudflare/computer/tree/main/examples/worker-shell/src/skills/exec -g -y

不安装直接使用

npx skills use cloudflare/computer@exec

指定 Agent (Claude Code)

npx skills add cloudflare/computer --skill exec -a claude-code -g -y

安装 repo 全部 skill

npx skills add cloudflare/computer --all -g -y

预览 repo 内 skill

npx skills add cloudflare/computer --list

SKILL.md

Frontmatter
{
    "name": "exec",
    "description": "How exec works in this workspace. Commands run in just-bash, a bash interpreter inside a Dynamic Worker, not on a Linux machine. Read this before running a command, and when a command is \"not found\" or behaves differently from real bash."
}

Running commands

Every exec call runs your command in just-bash, a bash interpreter written in JavaScript. It runs inside a Dynamic Worker that the durable object starts for the call. There is no Linux machine, no container, and no process table.

What works

  • Pipes, redirects, variables, loops, functions, && and ||, globs and here-documents, the same way they work in bash.
  • Text tools: cat, ls, find, grep, sed, awk, head, tail, sort, uniq, wc, cut, tr, diff, xargs and the rest of the usual set.
  • jq and curl. This example turns both on. They are optional command groups that the host chooses.
  • A built-in git for clone, status, diff, log and commits. It works directly on the workspace files.

What doesn't

  • No npm, node, python, compilers, package managers or other binaries. If a command isn't built in, it is "not found", and installing it isn't possible.
  • No direct network access. curl is there, but requests fail unless the host sets up an egress policy, and this example doesn't.
  • No background jobs that outlive the call. When the command finishes, the Worker is gone.

Files

  • cwd defaults to /workspace.
  • Every file operation goes straight to the durable object's storage. There's no copy to sync, so a write is visible to the next call and to the HTTP file routes right away.
  • /workspace/r2 is a read-only copy of an R2 bucket.
  • /workspace/.agents/skills (where this file lives) is a read-only copy of files shipped with the Worker.
  • A write under either read-only folder doesn't just fail that one command. It ends the whole call with exit code 1 and a "read-only mount" error, and output printed earlier in the call is lost. Write somewhere else under /workspace instead.

Tips

  • Starting a call is fast, so many small commands are fine.
  • For anything that needs a real runtime, such as building, testing or installing, use a workspace with a container backend.

版本历史

  • 7415a44 当前 2026-10-18 18:09

同 Skill 集合

.agents/skills/capnweb/SKILL.md
.agents/skills/cloudflare/SKILL.md
.agents/skills/debugging-computerd-fuse/SKILL.md
.agents/skills/prose/SKILL.md
.agents/skills/pull-requests/SKILL.md
.agents/skills/test-driven-development/SKILL.md
.gardener/SKILL.md
examples/container/src/skills/exec/SKILL.md
examples/vite-bundle/src/skills/hello/SKILL.md
examples/worker-javascript/src/skills/exec/SKILL.md

元信息

文件数
0
版本
7415a44
Hash
8cf9a1ec
收录时间
2026-10-18 18:09

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-19 05:13
浙ICP备14020137号-1