跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

提交记录

Merge pull request #1 from sylvinus/claude/forward-vm-arguments-EeIOt

Forward arguments from claude-vm to the underlying claude command

作者
Sylvain Zimmer
时间
2026/01/29 16:13
提交
180c575
这个版本的全部文件

这是一个合并提交,下面是和第一个上一提交相比的改动。

修改README.md+9 −1看文件
@@ -44,6 +44,14 @@ claude-vm
4444
4545Clones the template into a fresh VM, mounts your current directory, and runs `claude --dangerously-skip-permissions`. The VM is deleted when Claude exits.
4646
47新增:Any arguments passed to `claude-vm` are forwarded to the `claude` command:
48新增:
49新增:```bash
50新增:claude-vm -p "fix all lint errors" # Run with a prompt
51新增:claude-vm --resume # Resume previous session
52新增:claude-vm -c "explain this codebase" # Continue conversation
53新增:```
54新增:
4755### Debug shell
4856
4957```bash
@@ -77,7 +85,7 @@ docker compose up -d
7785## How it works
7886
79871. **`claude-vm-setup`** creates a Debian 13 VM with Lima, installs dev tools + Chrome + Claude Code, and stops it as a reusable template
80删除:2. **`claude-vm`** clones the template, mounts your working directory read-write, runs optional `.claude-vm.runtime.sh`, then launches Claude with full permissions
88新增:2. **`claude-vm [args]`** clones the template, mounts your working directory read-write, runs optional `.claude-vm.runtime.sh`, then launches Claude with full permissions (forwarding any arguments to the `claude` command)
81893. On exit, the cloned VM is stopped and deleted. The template persists for reuse
8290
8391Ports opened inside the VM (e.g. by Docker containers) are automatically forwarded to your host by Lima.
修改claude-vm.sh+3 −2看文件
@@ -8,7 +8,7 @@
88#
99# Functions:
1010# claude-vm-setup - Create the VM template (run once)
11删除:# claude-vm - Run Claude in a fresh VM with cwd mounted
11新增:# claude-vm [args] - Run Claude in a fresh VM with cwd mounted (args forwarded to claude)
1212# claude-vm-shell - Open a debug shell in a fresh VM
1313
1414CLAUDE_VM_TEMPLATE="claude-template"
@@ -111,6 +111,7 @@ VMEOF
111111}
112112
113113claude-vm() {
114新增: local args=("$@")
114115 local vm_name="claude-$(basename "$(pwd)" | tr -cs 'a-zA-Z0-9' '-' | sed 's/^-//;s/-$//')-$$"
115116 local host_dir="$(pwd)"
116117
@@ -139,7 +140,7 @@ claude-vm() {
139140 limactl shell --workdir "$host_dir" "$vm_name" bash -l < "${host_dir}/.claude-vm.runtime.sh"
140141 fi
141142
142删除: limactl shell --workdir "$host_dir" "$vm_name" claude --dangerously-skip-permissions
143新增: limactl shell --workdir "$host_dir" "$vm_name" claude --dangerously-skip-permissions "${args[@]}"
143144
144145 _claude_vm_cleanup
145146 trap - EXIT INT TERM