macOS 轻量化 Linux 虚拟机工具发布
本地优先的 MicroVM 方案改善 Mac 开发体验。是有用的开发工具但与 AI 无直接关系。
本地优先的 MicroVM 方案改善 Mac 开发体验。是有用的开发工具但与 AI 无直接关系。
基于 macOS 的 Apple Virtualization.framework 和 Linux ARM64 的 KVM 构建的轻量级 Linux VM。默认即用即弃。无需 Docker。
每次运行都会从干净的 rootfs 开始。你可以安装任何东西,也可以随意折腾。除非主动保存,否则不会持久化任何内容。
将磁盘状态保存为命名快照。你可以恢复、创建分支并反复迭代,就像为运行环境创建 git commit 一样。
基于 Virtualization.framework 构建。没有模拟层,也不依赖 Docker。在 ARM64 上可实现接近原生的运行速度。
简单的 CLI。运行、创建 checkpoint、恢复。
只需一条命令,即可启动一个全新的 VM。退出后,所有更改都会消失。
Sandbox 默认离线。通过一个 flag 即可启用网络。
可以为每次运行设置 CPU、内存和磁盘大小,也可以在配置文件中统一设置。
将宿主机目录共享到 VM 中。默认只读;如需允许写入宿主机,请使用 :rw 显式开启。
将环境保存为快照。创建分支,并在不同运行之间重复使用。
将 guest 端口暴露给宿主机。即使没有网络访问权限也能使用。
$ shuru run -- echo "hello from the sandbox"
hello from the sandbox
$ shuru run -- cat /etc/os-release | head -1
NAME="Debian GNU/Linux"
$ shuru run -- curl https://example.com
curl: (6) Could not resolve host: example.com
$ shuru run --allow-net -- curl -s https://example.com | head -1
$ shuru run --cpus 4 --memory 4096 -- free -m | head -2
$ shuru run --disk-size 2048 -- df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/vda 2.0G 18M 1.9G 1% /
$ shuru run --mount ./src:/workspace -- ls /workspace
$ shuru run --allow-host-writes --mount ./src:/workspace:rw -- touch /workspace/new.py
$ shuru checkpoint create myenv --allow-net -- sh -c 'apt-get install -y nodejs npm'
shuru: checkpoint 'myenv' saved
$ shuru run --from myenv -- node -e 'console.log("ready")'
$ shuru checkpoint create py --allow-net -- apt-get install -y python3
shuru: checkpoint 'py' saved
$ shuru run --from py -p 8080:8000 -- python3 -m http.server 8000
shuru: forwarding 127.0.0.1:8080 -> guest:8000
$ curl http://127.0.0.1:8080/
在隔离的 VM 中运行 AI 生成的代码,并实时输出结果。
让 Agent 安全地安装软件包、编译代码并使用系统工具。
启动多个并行 Sandbox,在不同环境中执行可复现的 eval。
用于测试、调试和原型开发的一次性 Linux 环境。
在单个 shuru.json 文件中定义允许访问的域名、secret 和资源。
API key 保留在宿主机上。Guest 获取的是一个占位 token。
严格限制 Agent 可以访问哪些域名。
为不同服务配置多个 API key。
统一配置资源、挂载、secret 和网络。
"from": "OPENAI_API_KEY",
"hosts": ["api.openai.com"]
"allow": ["api.openai.com"]
"*.githubusercontent.com"
"from": "OPENAI_API_KEY",
"hosts": ["api.openai.com"]
"from": "ANTHROPIC_API_KEY",
"hosts": ["api.anthropic.com"]
"allow": ["api.openai.com", "api.anthropic.com"]
"mounts": ["./src:/workspace"],
"from": "OPENAI_API_KEY",
"hosts": ["api.openai.com"]
"allow": ["api.openai.com"]
Shuru 以 Agent skill 的形式提供。安装后,每当 AI Agent 需要在 Sandbox 中执行任务时,都会自动使用 shuru run,无需额外 prompt。
支持 Claude Code、Cursor、Copilot 等多种工具。
$ npx skills add superhq-ai/shuru
几秒钟即可开始使用。
一条命令安装,一条命令运行。
$ brew tap superhq-ai/tap && brew install shuru
$ curl -fsSL https://shuru.run/install.sh | sh
$ ls /dev/kvm && groups | grep -q kvm
$ curl -fsSL https://shuru.run/install.sh | sh