coding-agent
它能做什么
设置一个独立的虚拟机,让编程智能体可以编辑你的项目并安装工具,同时保护你的电脑。它适合希望智能体以完整权限运行的开发者。
适用场景
- ✓当你希望编程智能体无需在每一步都请求许可即可运行的时候。
- ✓当你希望智能体的安装和实验与你自己的电脑隔离开时。
- ✓当你希望有一个一次性环境,同时仍能访问你的项目文件夹的时候。
技能链接
https://github.com/smol-machines/smolvm/blob/main/docs/coding-agent/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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
initruns once. Changing it later needs a new machine, or run the new commands withexec.- To keep the agent off your LAN and the host's ports, add
block_private = trueunder[network](from v1.28.1). SeeREADME.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
评论
- …
同一仓库的更多技能
branch-and-checkpoint
6.9k帮你的智能体将正在运行的 smolvm 虚拟机保存为检查点,之后恢复,暂停并继续运行,或分支为多个副本。
credentials
6.9k让你的智能体使用你的密钥调用 API,而密钥本身永远不会进入其虚拟机,因此不受信任的代码无法读取它。
dev-env
6.9k教你的智能体保持一个已安装工具的 smolvm 开发虚拟机,使其能快速重启,并在会话之间保留软件包。
docker-in-machine
6.9k帮你的智能体在 smolvm 虚拟机内运行 Docker 守护进程,使测试、构建以及需要启动容器的智能体能够在其中工作。