跳到正文
Skillpedia
智能体6.9k · #13715

coding-agent

它能做什么

设置一个独立的虚拟机,让编程智能体可以编辑你的项目并安装工具,同时保护你的电脑。它适合希望智能体以完整权限运行的开发者。

适用场景

  • ✓当你希望编程智能体无需在每一步都请求许可即可运行的时候。
  • ✓当你希望智能体的安装和实验与你自己的电脑隔离开时。
  • ✓当你希望有一个一次性环境,同时仍能访问你的项目文件夹的时候。

技能链接

https://github.com/smol-machines/smolvm/blob/main/docs/coding-agent/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/smol-machines/smolvm/blob/main/docs/coding-agent/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请设置一个安全的虚拟机,让 Claude Code 可以在我的项目文件夹上以完整权限运行。”

每周 5 个新技能,1 分钟读完。

工作原理

Smolfile 用于设置虚拟机并挂载你的项目。你启动虚拟机,并在其中运行智能体;文件的编辑会出现在你电脑上的项目文件夹中。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

A coding agent in a machine

Verified on smolvm v1.27.4 on Linux x86_64, 2026-10-14, and on v1.29.0 on macOS arm64, 2026-10-15. Done means the agent runs inside the machine from the project directory, its edits appear on the host, and git works on the mounted repo.

Procedure

1. Copy the Smolfile into the project. Edit the npm install line in init to the agents you use; any install command works.

cp docs/coding-agent/assets/agent.smolfile ./Smolfile

2. Create and start the machine. Pass API keys as references so they are read from your host at launch, never written to the machine record:

smolvm machine create --name agent -s Smolfile --secret-env ANTHROPIC_API_KEY=ANTHROPIC_API_KEY
smolvm machine start --name agent      # first start runs init: under a minute once the image is pulled

The Smolfile forwards your SSH agent, so start needs SSH_AUTH_SOCK set on the host: without it, it stops with ssh-agent: SSH_AUTH_SOCK is not set. Start one with eval $(ssh-agent), or delete the [auth] block.

3. Run the agent.

smolvm machine exec --name agent -it -- claude --dangerously-skip-permissions
smolvm machine exec --name agent -it -- opencode

machine shell --name agent gives a shell in /workspace for anything else.

4. Check git. smolvm machine exec --name agent -- git status must print the repo's status, not dubious ownership; if it does not, the safe.directory line in init did not run.

5. Stop or delete. machine stop --name agent keeps the installed agents for next time, and the next start takes about a second. machine delete --name agent -f removes the machine; the project stays on the host.

Notes

  • init runs once. Changing it later needs a new machine, or run the new commands with exec.
  • To keep the agent off your LAN and the host's ports, add block_private = true under [network] (from v1.28.1). See README.md.
  • An agent that needs Docker: add "/var/lib/docker", "/var/lib/containerd" to [dev] volumes (from v1.28.1) and see docker-in-machine.
常见问题

智能体会更改我电脑上的文件吗?

挂载的项目文件夹中的编辑会显示在你的电脑上。智能体在虚拟机内运行,而不是直接在你的系统上运行。

它支持哪些智能体?

该技能列出了 Claude Code、OpenCode 和 Codex,并说明任何带有安装命令的智能体都可以使用。

它需要我的 SSH 代理吗?

Smolfile 会转发你的 SSH 代理,因此宿主机需要运行一个代理,或者你可以从文件中删除该段配置。

详情

作者的原始描述

Runs a coding agent (Claude Code, OpenCode, Codex or any other) inside a persistent smolvm machine with the project mounted, so it can run with full permissions without touching the host. Use when someone wants to sandbox their coding agent, run it in skip-permissions or YOLO mode safely, or give it a disposable environment it can install anything into. Do not use it to run untrusted code with no network; use throwaway-machine for that.

repo: smol-machines/smolvm

热度

GitHub 星标
6.9k
排名
#13715
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能