跳到主要内容

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

浏览文件

TestHelp.json

19 行 · 11.7 KB历史下载
1{
2 "TestHelp": [
3 {
4 "Dir": "{ROOT}",
5 "Stdin": "",
6 "Snippet": "\"$@\"",
7 "Env": [
8 "HOME={T0}/001"
9 ],
10 "Args": [
11 "_agent_vm_help"
12 ],
13 "Files": null,
14 "Stdout": "Usage: agent-vm [options] \u003ccommand\u003e [args]\n\nCommands:\n install Put agent-vm on your PATH (a link in ~/.local/bin, or\n AGENT_VM_BIN_DIR). Run it from the clone:\n ./agent-vm.sh install\n uninstall Remove that link. VMs and ~/.agent-vm are left alone.\n setup Create the base VM template (run once)\n claude [args] Run Claude Code in the VM for the current directory\n opencode [args] Run OpenCode in the VM for the current directory\n codex [args] Run Codex CLI in the VM for the current directory\n vibe [args] Run Mistral Vibe in the VM for the current directory\n pi [args] Run Pi in the VM for the current directory (opt-in at\n setup: --preinstall=default,pi)\n shell, sh Open a shell in the VM. Add -c \"...\" to run a one-shot\n command via login zsh and exit.\n run \u003ccmd\u003e [args] Run a command in the VM (no shell: for pipes/redirects\n use 'shell -c \"...\"' instead; pass --tty for TUIs like\n opencode, vibe, htop, etc.)\n code Serve VS Code (code-server) from the VM, at\n http://\u003cvm-name\u003e.localhost:\u003cport\u003e/, until Ctrl-C. The\n address and the password, made in each VM, are\n printed: open it in your browser. Opt-in at setup, with the agents'\n extensions or without: --preinstall=default,code-claude\n (or code-codex, code-vibe, code-server)\n stop [vm-name] Stop the VM for the current directory, or the named one\n rm [vm-name] Stop and delete the VM for the current directory, or the\n named one. Pass a name from 'agent-vm list' to reach a VM\n whose directory was renamed or deleted: its name is a\n hash of the old path, so no 'cd' can name it any more.\n destroy-all Stop and delete every agent-vm VM, the base template\n included ('agent-vm setup' rebuilds it)\n list, status List all agent-vm VMs, the current directory's marked\n with \u003e, with the agent-vm version and date of the base\n each was cloned from\n doctor Check the host, Lima, the base template and this\n directory, and say how to fix what is wrong. Read-only.\n name [dir] Print the VM name for a directory (default: cwd)\n info [dir] Print machine-readable state as key=value lines\n (version, template, state_dir, project_env, dir,\n vm_name, base_exists, vm_exists, vm_running, vm_stale,\n ssh_host, ssh_config, git_protected,\n security_questions).\n Use this from scripts instead of parsing the output\n of the human-facing commands.\n env \u003csub\u003e [args] Read/write ~/.agent-vm/env, the secrets pushed into every\n VM. Subcommands: set KEY [VALUE] (without VALUE, read\n from stdin, or typed unseen: out of your shell history),\n get KEY, has KEY (exit status only), unset KEY, list\n (key names, never values).\n Use this rather than editing the file: it is sourced by a\n shell, so one bad quote costs every secret in it.\n project-env \u003csub\u003e Same subcommands, for THIS directory's project only. Its\n values are pushed after the shared ones, so a key set in\n both takes the project's value. Stored IN the project\n (.agent-vm.env by default, AGENT_VM_PROJECT_ENV to put it\n elsewhere): so it follows the project and dies with it.\n Being in a repository, it is the wrong place for a secret:\n `agent-vm env` is outside any. `set` warns, with the line\n to run, when the file is not ignored by git. `info` prints\n the path as project_env=.\n version Print the agent-vm version\n version --min X.Y.Z\n Check it: silent and 0 when this engine is at least\n X.Y.Z, an actionable error and 1 when it is older\n (2 when the call itself is wrong). For integrators.\n help Show this help\n\nVM options (for claude, opencode, codex, vibe, pi, shell, run, code), read before the\ncommand or right after its name, never later: in 'agent-vm run docker run\n--rm x', --rm belongs to docker.\n --disk GB VM disk size\n --memory GB VM memory\n --cpus N Number of CPUs\n Without them, a new VM has the base template's: 10, 3\n and 1 unless 'setup' was given others.\n Memory and CPUs are clamped to a share of the host (half\n of it, with a notice) so the VM cannot starve the\n machine it runs on.\n AGENT_VM_HOST_SHARE overrides the divisor.\n --ssh-port N Fixed host port for the VM's SSH, for tools that save the\n port (default: a new one on each start; 0 goes back)\n --reset Destroy and re-clone the VM from the base template\n --readonly Make every host share read-only: the project and the\n ~/.agent-vm/volumes entries, rw ones included. Enforced\n on the host side, so root in the VM cannot lift it.\n A running VM in the other mode is restarted, asked first\n (no by default; declined or with no terminal, the\n command fails). The resource options ask the same, and\n declined, the VM keeps its settings.\n --unsafe-writable-git\n Leave every .git writable, so the agent can commit (see\n below). Also accepted as --unsafe-writable-git=1.\n --unsafe-disable-security-prompts\n Go on where a start would stop to ask about a security\n risk (below), without offering to change your git\n config; the warnings are still printed. For scripts\n with no terminal. Also\n AGENT_VM_UNSAFE_DISABLE_SECURITY_PROMPTS=1 in your shell.\n --rm Automatically destroy the VM after the command exits\n --scratch A new VM with nothing of yours mounted (no project, no\n volumes), deleted when the command ends, Ctrl-C included.\n On a terminal, the deletion is asked first: no opens a\n shell in the VM, and its exit asks again.\n The project's env file and runtime script stay out;\n ~/.agent-vm/env and runtime.sh go in. The folder's own\n VM is left alone, and several can run at once.\n\nExamples:\n agent-vm setup # Create base VM\n agent-vm claude # Run Claude in a VM\n agent-vm opencode # Run OpenCode in a VM\n agent-vm codex # Run Codex in a VM\n agent-vm vibe # Run Mistral Vibe in a VM\n agent-vm pi # Run Pi in a VM\n agent-vm --disk 50 --memory 16 --cpus 8 claude # Custom resources\n agent-vm --reset claude # Fresh VM from base template\n agent-vm --rm claude # Destroy VM after Claude exits\n agent-vm --readonly shell # Nothing on the host is writable\n agent-vm --scratch claude # Nothing of yours mounted, then deleted\n agent-vm shell # Shell into the VM\n agent-vm sh -c \"ls -la | grep config\" # One-shot command via login zsh\n agent-vm run npm install # Run a command in the VM\n agent-vm run --tty opencode -p \"...\" # Run a TUI with PTY allocated\n agent-vm code # VS Code in the browser\n agent-vm claude -p \"fix lint errors\" # Pass args to claude\n agent-vm rm agent-vm-old-name-1a2b3c4d # Delete a VM by name (see 'list')\n\nVMs are persistent and unique per directory. Running \"agent-vm shell\" or\n\"agent-vm claude\" in the same directory will reuse the same VM.\n\nEvery .git in the shared folders is read-only for the VMs when Lima supports\nit (sshfs.readonlyNames, not merged upstream yet: 'agent-vm setup' offers a\nLima build that has it). Every .hg is too, and so is the folder of each\ncore.hooksPath in the project (.husky for husky). 'agent-vm doctor' says\nwhere you stand.\n\nBefore a VM boots with writable shares, agent-vm stops on what it cannot\nprotect, and asks whether to go on (no by default, and when it cannot ask):\na Lima without readonlyNames, hooks at the top of a share, git config,\ncommands it names, or hooks linked to files, in the project or a writable\nvolume, and git ignoring safe.bareRepository=explicit (which it offers to\nset: git would otherwise use a folder with HEAD, objects/ and refs/ as a\nrepository, under any name). A VM that already runs gets the warnings only,\nand a restart when it lacks a protection; once stopped to boot again, it is\nasked like any other.\n'agent-vm info' lists what a start would ask\n(security_questions=).\n--unsafe-writable-git, or AGENT_VM_UNSAFE_WRITABLE_GIT=1 in your shell, leaves\n.git writable anyway, so the agent can commit in the project; a warning is\nprinted on every run. Changing it applies when the VM is next started.\n\nThe writable shares are served without sshfs's cache, so the VM never writes\nback a file as it was before you changed it. AGENT_VM_SSHFS_CACHE=1 in your\nshell turns the cache on, faster on many files (git status, find), at that\nrisk, for 20 seconds. It applies when a VM is next started.\n\nCustomization:\n ~/.agent-vm/env Shared env vars / tokens (dotenv-style;\n pushed into every VM, loaded in its shells)\n ~/.agent-vm/volumes Extra host paths to mount in VMs, one per\n line, directories or files:\n source[:destination][:ro|rw[:project]]\n (ro by default; a relative destination is\n in the project; project, after an explicit\n mode, limits the entry to the projects it\n matches, * as wildcard)\n ~/.agent-vm/setup.sh Per-user setup (runs under zsh during\n \"agent-vm setup\")\n \u003cproject\u003e/.agent-vm.env Per-project env (agent-vm project-env)\n Override the path with AGENT_VM_PROJECT_ENV\n ~/.agent-vm/runtime.sh Per-user runtime (runs on every command\n that enters a VM)\n \u003cproject\u003e/.agent-vm.runtime.sh Per-project runtime (same, after the\n per-user one)\n Override the path with AGENT_VM_PROJECT_RUNTIME\n (relative to the project, or absolute).\n Runtimes run under the shell their shebang\n names (bash, sh; zsh otherwise).\n\nMore info: https://www.agent-vm.org/\n",
15 "Stderr": "",
16 "Code": 0
17 }
18 ]
19}