跳到主要内容

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

提交记录
修改CHANGELOG.md+27 −0看文件
@@ -1,5 +1,32 @@
11# Changelog
22
3新增:## Unreleased
4新增:
5新增:### Added
6新增:
7新增:- `agent-vm code`: VS Code (code-server) served from the VM and opened in
8新增: the browser, until Ctrl-C. Opt-in at setup: `--preinstall=code-server`
9新增: for the editor alone, `code-claude`, `code-codex` and `code-vibe` for it
10新增: with that agent's extension, each starting with no permission prompts.
11新增: The wizard asks about the editor after the agents, then whether the
12新增: agents that have an extension get it, the command line, or both. An
13新增: extension ships its own copy of its agent: without the command line,
14新增: `agent-vm claude` (or `codex`, `vibe`) says it is not installed. Dark
15新增: theme, GitHub Copilot off, no telemetry or update checks.
16新增:- The editor's password is made in each VM on first use, never in the base,
17新增: of which every VM is a copy, and printed. Each VM's editor is at
18新增: `http://<vm-name>.localhost:<port>/`, a port of its own from 20000 to
19新增: 29999, the same on every start: browsers keep cookies per host name, not
20新增: per port, so at `127.0.0.1` a page served by any VM would get the session
21新增: of every editor, which logs into it. Safari may not resolve `*.localhost`:
22新增: then `127.0.0.1` in a private window kept for the editor. code-server's
23新增: port proxy is off.
24新增:
25新增:### Changed
26新增:
27新增:- A command that is not in the VM (`agent-vm run foo`, or an agent not
28新增: installed) says so, with status 127, instead of `env`'s error.
29新增:
330## 0.2.0
431
532### Security
修改README.md+2 −1看文件
@@ -23,6 +23,7 @@ cd your-project
2323agent-vm claude # or opencode, codex, vibe, pi
2424agent-vm shell # a shell in this project's VM
2525agent-vm run npm test # one command in it
26新增:agent-vm code # VS Code in the browser (setup --preinstall=default,code-claude)
2627agent-vm --readonly shell # nothing on the host writable from the VM
2728agent-vm --scratch claude # nothing of yours mounted, VM deleted on exit
2829agent-vm stop # or rm; list for all VMs
@@ -36,7 +37,7 @@ Everyday use: [Usage](https://www.agent-vm.org/#usage). Every command, option, f
3637The agent is root in its VM and has the network. What it can reach on your machine is what crosses the shares:
3738
3839- Every `.git` and `.hg`, and the folder of a `core.hooksPath` inside the project, are read-only for the VM with a Lima that has `sshfs.readonlyNames`, which `agent-vm setup` offers to install. Before a VM boots, agent-vm stops on what it cannot protect and asks whether to go on: [Protecting .git](https://www.agent-vm.org/#git).
39删除:- The agent writes the project folder: on your machine, open it in your editor and use git there, and run everything else in the VM. Open agent-vm projects in VS Code's Restricted Mode. Editors, agents, commit hooks and commands you run on the host can run code the agent wrote: [What else reads the project](https://www.agent-vm.org/#what-else-on-your-machine-reads-the-project).
40新增:- The agent writes the project folder: on your machine, open it in your editor and use git there, and run everything else in the VM. Open agent-vm projects in VS Code's Restricted Mode, and never connect an editor to the VM over SSH (Remote-SSH trusts the VM with your machine: [SSH from your machine](https://www.agent-vm.org/#ssh-from-your-machine)). Editors, agents, commit hooks and commands you run on the host can run code the agent wrote: [What else reads the project](https://www.agent-vm.org/#what-else-on-your-machine-reads-the-project).
4041- The VM reaches your machine's loopback and prints to your terminal: [Security](https://www.agent-vm.org/#security).
4142
4243## Development
修改agent-vm.setup.sh+77 −7看文件
@@ -30,8 +30,9 @@ apt_get() {
3030
3131# Component toggles. The host wizard prepends `export` lines for these before
3232# piping the script in. Members of the default install set (everything except
33删除:# Ruby/Rust/Go/Pi/Playwright MCP) default to 1 so running this script standalone (without the
34删除:# wizard) produces the same install you'd get from `agent-vm setup --preinstall=default`.
33新增:# Ruby/Rust/Go/Pi/Playwright MCP/code-server and its extensions) default to 1 so running this
34新增:# script standalone (without the wizard) produces the same install you'd get from
35新增:# `agent-vm setup --preinstall=default`.
3536INSTALL_PYTHON="${AGENT_VM_INSTALL_PYTHON:-1}"
3637INSTALL_NODE="${AGENT_VM_INSTALL_NODE:-1}"
3738INSTALL_RUBY="${AGENT_VM_INSTALL_RUBY:-0}"
@@ -45,10 +46,25 @@ INSTALL_OPENCODE="${AGENT_VM_INSTALL_OPENCODE:-1}"
4546INSTALL_CODEX="${AGENT_VM_INSTALL_CODEX:-1}"
4647INSTALL_VIBE="${AGENT_VM_INSTALL_VIBE:-1}"
4748INSTALL_PI="${AGENT_VM_INSTALL_PI:-0}"
49新增:INSTALL_CODE_SERVER="${AGENT_VM_INSTALL_CODE_SERVER:-0}"
50新增:# Each agent's code-server extension, which brings its own copy of the agent.
51新增:INSTALL_CODE_CLAUDE="${AGENT_VM_INSTALL_CODE_CLAUDE:-0}"
52新增:INSTALL_CODE_CODEX="${AGENT_VM_INSTALL_CODE_CODEX:-0}"
53新增:INSTALL_CODE_VIBE="${AGENT_VM_INSTALL_CODE_VIBE:-0}"
54新增:if [[ "$INSTALL_CODE_CLAUDE$INSTALL_CODE_CODEX$INSTALL_CODE_VIBE" == *1* ]]; then
55新增: INSTALL_CODE_SERVER=1
56新增:fi
4857# MCP servers wired into every installed agent's config (see lib/setup.sh).
4958INSTALL_MCP_CHROME="${AGENT_VM_INSTALL_MCP_CHROME:-1}"
5059INSTALL_MCP_PLAYWRIGHT="${AGENT_VM_INSTALL_MCP_PLAYWRIGHT:-0}"
5160
61新增:# An agent there in either form: its command line and its extension read the
62新增:# same config, which is written for both.
63新增:HAS_CLAUDE=0 HAS_CODEX=0 HAS_VIBE=0
64新增:[[ "$INSTALL_CLAUDE$INSTALL_CODE_CLAUDE" == *1* ]] && HAS_CLAUDE=1
65新增:[[ "$INSTALL_CODEX$INSTALL_CODE_CODEX" == *1* ]] && HAS_CODEX=1
66新增:[[ "$INSTALL_VIBE$INSTALL_CODE_VIBE" == *1* ]] && HAS_VIBE=1
67新增:
5268# For this session too: installers (Claude Code, Vibe) warn when ~/.local/bin
5369# is not on PATH, which ~/.zshenv only sets for the next ones.
5470export PATH="$HOME/.local/bin:$PATH"
@@ -223,7 +239,9 @@ if [[ "$INSTALL_CLAUDE" == "1" ]]; then
223239 echo "Installing Claude Code..."
224240 curl -fsSL https://claude.ai/install.sh | bash
225241 echo 'export PATH=$HOME/.claude/local/bin:$PATH' >> ~/.zshenv
242新增:fi
226243
244新增:if [[ "$HAS_CLAUDE" == "1" ]]; then
227245 # Enforce full autonomy via *managed* settings (highest precedence), not the
228246 # user's ~/.claude/. A user can bind-mount or overwrite their own ~/.claude/
229247 # dir freely; this system-level policy is untouched and always wins.
@@ -235,6 +253,7 @@ if [[ "$INSTALL_CLAUDE" == "1" ]]; then
235253 # "ask" permission mode. Settings are re-read on every (re)launch, so encoding
236254 # the policy here makes it survive those relaunches. `tui: fullscreen` also
237255 # pins fullscreen from the first launch, so the opt-in relaunch never fires.
256新增: # The extension's own copy of Claude Code reads it too.
238257 echo "Configuring Claude managed settings (bypass permissions + fullscreen)..."
239258 sudo mkdir -p /etc/claude-code
240259 cat << 'JSON' | sudo tee /etc/claude-code/managed-settings.json > /dev/null
@@ -290,6 +309,57 @@ JSON
290309 fi
291310fi
292311
312新增:# A top-level TOML key as the first line of <file>, where the tables the MCP
313新增:# config appends later cannot capture it. Skipped when the key is there.
314新增:toml_prepend() {
315新增: local file="$1" key="$2" value="$3"
316新增: mkdir -p "$(dirname "$file")"
317新增: if [[ -f "$file" ]] && grep -q "^$key *=" "$file"; then
318新增: return 0
319新增: fi
320新增: { printf '%s = %s\n' "$key" "$value"; [[ ! -f "$file" ]] || cat "$file"; } > "$file.tmp"
321新增: mv "$file.tmp" "$file"
322新增:}
323新增:
324新增:if [[ "$INSTALL_CODE_SERVER" == "1" ]]; then
325新增: # The editor of `agent-vm code` (lib/code.sh). No password here: every VM
326新增: # is a copy of this disk, so each one makes its own on first use.
327新增: echo "Installing code-server..."
328新增: curl -fsSL https://code-server.dev/install.sh | sh
329新增: extensions=()
330新增: [[ "$INSTALL_CODE_CLAUDE" == "1" ]] && extensions+=(--install-extension anthropic.claude-code)
331新增: [[ "$INSTALL_CODE_CODEX" == "1" ]] && extensions+=(--install-extension openai.chatgpt)
332新增: [[ "$INSTALL_CODE_VIBE" == "1" ]] && extensions+=(--install-extension mistralai.mistral-vibe-code)
333新增: if [[ ${#extensions[@]} -gt 0 ]]; then
334新增: echo "Installing the agents' extensions..."
335新增: code-server "${extensions[@]}" </dev/null
336新增: fi
337新增: # chat.disableAIFeatures turns off the GitHub Copilot chat and completions
338新增: # that code-server ships. The Claude keys start its conversations in bypass
339新增: # mode, as the managed settings above do for the CLI.
340新增: mkdir -p "$HOME/.local/share/code-server/User"
341新增: jq -n --arg claude "$INSTALL_CODE_CLAUDE" '
342新增: {
343新增: "workbench.colorTheme": "Dark 2026",
344新增: "chat.disableAIFeatures": true
345新增: } + if $claude == "1" then {
346新增: "claudeCode.allowDangerouslySkipPermissions": true,
347新增: "claudeCode.initialPermissionMode": "bypassPermissions"
348新增: } else {} end' > "$HOME/.local/share/code-server/User/settings.json"
349新增: # Codex and Vibe have no setting for it: their extensions start in the mode
350新增: # the agent's own config names. These match the flags the command line gets
351新增: # (_agent_vm_agent in agent-vm.sh).
352新增: if [[ "$INSTALL_CODE_CODEX" == "1" ]]; then
353新增: toml_prepend "$HOME/.codex/config.toml" sandbox_mode '"danger-full-access"'
354新增: toml_prepend "$HOME/.codex/config.toml" approval_policy '"never"'
355新增: fi
356新增: if [[ "$INSTALL_CODE_VIBE" == "1" ]]; then
357新增: toml_prepend "$HOME/.vibe/config.toml" default_agent '"auto-approve"'
358新增: fi
359新增: # Written by code-server on its first run, with a password of its own.
360新增: rm -rf "$HOME/.config/code-server"
361新增:fi
362新增:
293363# Wire one stdio MCP server into every installed agent's config. Each agent
294364# stores MCP servers in its own format, so that mapping is written once here
295365# instead of being copy-pasted per server.
@@ -313,7 +383,7 @@ configure_mcp() {
313383 local args_json
314384 args_json="$(printf '%s\n' "$@" | jq -R . | jq -sc .)"
315385
316删除: if [[ "$INSTALL_CLAUDE" == "1" ]]; then
386新增: if [[ "$HAS_CLAUDE" == "1" ]]; then
317387 echo "Configuring $name MCP server for Claude..."
318388 local config="$HOME/.claude.json"
319389 [ -f "$config" ] || echo '{}' > "$config"
@@ -344,7 +414,7 @@ configure_mcp() {
344414 fi
345415 fi
346416
347删除: if [[ "$INSTALL_VIBE" == "1" ]]; then
417新增: if [[ "$HAS_VIBE" == "1" ]]; then
348418 # Vibe uses TOML; append an array-of-tables entry (valid even if the wizard
349419 # later writes to the same file). Guard against duplicates on repeated runs.
350420 echo "Configuring $name MCP server for Vibe..."
@@ -361,7 +431,7 @@ configure_mcp() {
361431 fi
362432 fi
363433
364删除: if [[ "$INSTALL_CODEX" == "1" ]]; then
434新增: if [[ "$HAS_CODEX" == "1" ]]; then
365435 # Codex CLI uses TOML at ~/.codex/config.toml with [mcp_servers.NAME]
366436 # tables. Guard against duplicates on repeated setup runs.
367437 echo "Configuring $name MCP server for Codex..."
@@ -380,8 +450,8 @@ configure_mcp() {
380450# True when at least one agent is installed: nothing to configure otherwise,
381451# and no reason to print a "skipping" notice either.
382452any_agent_installed() {
383删除: [[ "$INSTALL_CLAUDE" == "1" || "$INSTALL_OPENCODE" == "1" \
384删除: || "$INSTALL_CODEX" == "1" || "$INSTALL_VIBE" == "1" ]]
453新增: [[ "$HAS_CLAUDE" == "1" || "$INSTALL_OPENCODE" == "1" \
454新增: || "$HAS_CODEX" == "1" || "$HAS_VIBE" == "1" ]]
385455}
386456
387457# Chrome DevTools MCP runs via `npx` and drives the Chromium installed above,
修改agent-vm.sh+10 −4看文件
@@ -52,7 +52,7 @@ fi
5252# The rest of agent-vm, one file per concern, sourced like this one. Only
5353# functions and settings: nothing runs until a command does. A file that is
5454# missing stops here, not half-way through a command.
55删除:for _agent_vm_lib in ui options host vm mounts git runtime env info install doctor help setup; do
55新增:for _agent_vm_lib in ui options host vm mounts git runtime env info install doctor help setup code; do
5656 _agent_vm_lib="$AGENT_VM_SCRIPT_DIR/lib/$_agent_vm_lib.sh"
5757 if [[ ! -r "$_agent_vm_lib" ]] || ! . "$_agent_vm_lib"; then
5858 echo "agent-vm: cannot load $_agent_vm_lib" >&2
@@ -700,7 +700,7 @@ agent-vm() {
700700 if [[ ${#lead[@]} -gt 0 ]]; then
701701 case "$cmd" in
702702 stop|rm|destroy|destroy-all|list|status|name|info|env|project-env|version|--version|-V|doctor|install|uninstall|help|--help|-h)
703删除: echo "Error: ${lead[*]:0:1} is an option for the commands that start a VM (claude, opencode, codex, vibe, pi, shell, run), not for '$cmd'." >&2
703新增: echo "Error: ${lead[*]:0:1} is an option for the commands that start a VM (claude, opencode, codex, vibe, pi, shell, run, code), not for '$cmd'." >&2
704704 return 1 ;;
705705 esac
706706 fi
@@ -731,6 +731,9 @@ agent-vm() {
731731 run)
732732 _agent_vm_run ${lead[@]+"${lead[@]}"} "$@"
733733 ;;
734新增: code)
735新增: _agent_vm_code ${lead[@]+"${lead[@]}"} "$@"
736新增: ;;
734737 stop)
735738 _agent_vm_stop "$@"
736739 ;;
@@ -813,7 +816,8 @@ agent-vm() {
813816# guest shell never re-parses them; `env` runs the command and keeps leading
814817# VAR=value assignments working. `env --`: GNU env still reads assignments
815818# after it, and a command starting with `-` (`run -i foo`) is not taken for
816删除:# one of its options.
819新增:# one of its options. A command that is not there is said so, with env's
820新增:# status: an agent installed only as an editor extension has no command.
817821#
818822# Usage: _agent_vm_lima_run <vm_name> <host_dir> <tty:1|""> <command> [args...]
819823_agent_vm_lima_run() {
@@ -821,7 +825,9 @@ _agent_vm_lima_run() {
821825 shift 3
822826 local shell_opts=(--workdir "$host_dir")
823827 [[ -n "$want_tty" ]] && shell_opts+=(--tty)
824删除: limactl shell "${shell_opts[@]}" "$vm_name" -- zsh -l -c 'exec env -- "$@"' agent-vm "$@"
828新增: limactl shell "${shell_opts[@]}" "$vm_name" -- zsh -l -c \
829新增: 'case "$1" in *=*) ;; *) command -v -- "$1" >/dev/null || { print -r -- "agent-vm: $1 is not installed in this VM." >&2; exit 127; } ;; esac; exec env -- "$@"' \
830新增: agent-vm "$@"
825831}
826832
827833# Starts this directory's VM with the caller's vm_opts, runs <function> with
新增lib/code.sh+184 −0看文件
@@ -0,0 +1,184 @@
1新增:# --- code: code-server in the VM, opened in the host's browser ----------------
2新增:
3新增:# Run in the VM before the editor starts, with the candidate ports as
4新增:# arguments. Prints `missing` without code-server, else its config file and
5新增:# password, the port of an editor of this VM already running, and which
6新增:# candidates something in the VM listens on.
7新增:#
8新增:# The password is made here, in the VM, on first use, never in the base:
9新增:# every VM is a copy of the base disk, and one VM knowing another's password
10新增:# could log into it through the host's loopback, which every VM reaches. The
11新增:# file is named after the hostname, which Lima sets per VM, so a file that
12新增:# came with the base is never used.
13新增:_AGENT_VM_CODE_PREP='
14新增:command -v code-server >/dev/null 2>&1 || { echo missing; exit 0; }
15新增:cfg="$HOME/.config/code-server/agent-vm-$(hostname).yaml"
16新增:if [ ! -s "$cfg" ]; then
17新增: pw="$(od -An -N16 -tx1 /dev/urandom | tr -d " \n")"
18新增: [ "${#pw}" = 32 ] || exit 1
19新增: mkdir -p "${cfg%/*}" || exit 1
20新增: (umask 077 && printf "auth: password\npassword: %s\ncert: false\n" "$pw" > "$cfg") || exit 1
21新增:fi
22新增:echo "config=$cfg"
23新增:echo "password=$(sed -n "s/^password: //p" "$cfg")"
24新增:pgrep -u "$(id -u)" -af -- "--config $cfg" \
25新增: | sed -n "s/.*--bind-addr 127\.0\.0\.1:\([0-9]*\).*/running=\1/p" | head -n 1
26新增:for p in "$@"; do
27新增: curl -s -o /dev/null --max-time 1 "http://127.0.0.1:$p/" && echo "listening=$p"
28新增:done
29新增:exit 0
30新增:'
31新增:
32新增:# Ten host ports for <vm>'s editor, from its name: the same on every start,
33新增:# so the browser finds the saved password at the same address.
34新增:_agent_vm_code_ports() {
35新增: local h base i
36新增: h="$(printf '%s' "$1" | _agent_vm_sha256 | cut -c1-4)"
37新增: [[ "$h" =~ ^[0-9a-f]{4}$ ]] || return 1
38新增: base=$((20000 + (16#$h % 1000) * 10))
39新增: for i in 0 1 2 3 4 5 6 7 8 9; do printf '%s ' $((base + i)); done
40新增:}
41新增:
42新增:# The host name the browser reaches <vm>'s editor at: <vm>.localhost, which
43新增:# Chrome and Firefox send to 127.0.0.1 on their own. Browsers keep cookies
44新增:# per host name, not per port: on 127.0.0.1, a page served by any VM would
45新增:# receive the session cookie of every editor, which logs into it. Lowercase,
46新增:# and at most 63 characters (a DNS label), the hash at the end kept.
47新增:_agent_vm_code_host() {
48新增: local label
49新增: label="$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')"
50新增: if [[ ${#label} -gt 63 ]]; then
51新增: label="${label:0:54}-${label:$((${#label} - 8))}"
52新增: fi
53新增: printf '%s.localhost\n' "$label"
54新增:}
55新增:
56新增:# 0 when something on this machine accepts connections on 127.0.0.1:<port>.
57新增:_agent_vm_host_port_open() {
58新增: (exec 3<>"/dev/tcp/127.0.0.1/$1") 2>/dev/null
59新增:}
60新增:
61新增:# The editor's <url> on <port>, and its <password>. Safari leaves *.localhost
62新增:# to macOS, which may not resolve it: 127.0.0.1 then, in a window of its own.
63新增:_agent_vm_code_say() {
64新增: echo "Editor: $1"
65新增: echo "Password: $3"
66新增: if [[ "$(uname -s)" == Darwin ]]; then
67新增: echo "(Safari may not resolve it: then http://127.0.0.1:$2/, in a private window kept for this editor, so pages from other VMs never get its cookie.)"
68新增: fi
69新增:}
70新增:
71新增:# Open <url> in the host's browser once Lima forwards <port>.
72新增:_agent_vm_code_open() {
73新增: local url="$1" port="$2" i=0
74新增: until _agent_vm_host_port_open "$port"; do
75新增: i=$((i + 1))
76新增: if [[ $i -ge 60 ]]; then
77新增: echo "Warning: nothing on 127.0.0.1:$port after 60s: Lima did not forward the editor's port." >&2
78新增: return 1
79新增: fi
80新增: sleep 1
81新增: done
82新增: if _agent_vm_on_windows; then
83新增: start "$url"
84新增: elif [[ "$(uname -s)" == Darwin ]]; then
85新增: open "$url"
86新增: elif [[ -n "${DISPLAY:-}${WAYLAND_DISPLAY:-}" ]] && command -v xdg-open >/dev/null 2>&1; then
87新增: xdg-open "$url"
88新增: fi >/dev/null 2>&1
89新增: return 0
90新增:}
91新增:
92新增:# `agent-vm code`: code-server for the project, in the foreground until
93新增:# Ctrl-C. Takes no argument of its own.
94新增:_agent_vm_code() {
95新增: local vm_opts=() rm="" tty="" args=()
96新增: _agent_vm_split_args "$@" || return 1
97新增: if [[ ${#args[@]} -gt 0 || -n "$tty" ]]; then
98新增: echo "Error: unknown argument for code: ${args[0]:---tty}" >&2
99新增: echo "Usage: agent-vm [vm options] code" >&2
100新增: return 1
101新增: fi
102新增: _agent_vm_in_vm _agent_vm_code_session
103新增:}
104新增:
105新增:_agent_vm_code_session() {
106新增: local vm_name="$1" host_dir="$2" ports out line cfg="" pw="" running="" listening=" " port="" p
107新增: local url opener="" want_tty="" st=0
108新增: ports="$(_agent_vm_code_ports "$vm_name")" || {
109新增: echo "Error: cannot hash the VM name: install shasum or sha256sum." >&2
110新增: return 1
111新增: }
112新增: # shellcheck disable=SC2086
113新增: if ! out="$(limactl shell "$vm_name" -- zsh -lc "$_AGENT_VM_CODE_PREP" agent-vm-code $ports </dev/null)"; then
114新增: echo "Error: could not set up the editor's password in VM '$vm_name'." >&2
115新增: return 1
116新增: fi
117新增: while IFS= read -r line; do
118新增: case "$line" in
119新增: missing)
120新增: echo "Error: code-server is not installed in VM '$vm_name'." >&2
121新增: echo " 'agent-vm setup --preinstall=default,code-claude' (or code-server alone) adds it to the base, then 'agent-vm --reset code'" >&2
122新增: echo " re-clones this VM (its disk is lost)." >&2
123新增: return 1 ;;
124新增: config=*) cfg="${line#config=}" ;;
125新增: password=*) pw="${line#password=}" ;;
126新增: running=*) running="${line#running=}" ;;
127新增: listening=*) listening="$listening${line#listening=} " ;;
128新增: esac
129新增: done <<< "$out"
130新增: # Printed to the terminal: nothing the VM wrote may carry escape sequences.
131新增: if [[ -z "$pw" || "$pw$cfg" == *[[:cntrl:]]* || ( -n "$running" && ! "$running" =~ ^[0-9]+$ ) ]]; then
132新增: echo "Error: could not read the editor's password in VM '$vm_name'." >&2
133新增: return 1
134新增: fi
135新增:
136新增: if [[ -n "$running" ]]; then
137新增: url="http://$(_agent_vm_code_host "$vm_name"):$running/"
138新增: echo "The editor of VM '$vm_name' already runs, from another terminal."
139新增: _agent_vm_code_say "$url" "$running" "$pw"
140新增: [[ -t 1 ]] && _agent_vm_code_open "$url" "$running"
141新增: return 0
142新增: fi
143新增:
144新增: # The first port free both here and in the VM: Lima forwards the VM's port
145新增: # to the same one here, and only when nothing holds it.
146新增: for p in $ports; do
147新增: [[ "$listening" == *" $p "* ]] && continue
148新增: _agent_vm_host_port_open "$p" && continue
149新增: port="$p"
150新增: break
151新增: done
152新增: if [[ -z "$port" ]]; then
153新增: echo "Error: no free port for the editor among: $ports" >&2
154新增: return 1
155新增: fi
156新增:
157新增: url="http://$(_agent_vm_code_host "$vm_name"):$port/"
158新增: _agent_vm_code_say "$url" "$port" "$pw"
159新增: echo "The password is kept in the VM, in $cfg. Ctrl-C stops the editor."
160新增: if [[ -t 1 ]]; then
161新增: _agent_vm_code_open "$url" "$port" &
162新增: opener=$!
163新增: fi
164新增: # A terminal for Ctrl-C to reach code-server: without one, it would keep
165新增: # running in the VM once this command ends.
166新增: [[ -t 0 && -t 1 ]] && want_tty=1
167新增: # Bound to the VM's loopback, which Lima forwards to this machine's only.
168新增: # The cookie suffix keeps sessions apart at 127.0.0.1, where two editors
169新增: # would overwrite each other's cookie. --disable-proxy: no route from the
170新增: # browser to the VM's other ports, and the proxy is where CVE-2025-47269 was.
171新增: _agent_vm_lima_run "$vm_name" "$host_dir" "$want_tty" code-server \
172新增: --config "$cfg" \
173新增: --bind-addr "127.0.0.1:$port" \
174新增: --cookie-suffix "$vm_name" \
175新增: --app-name "$vm_name" \
176新增: --disable-telemetry \
177新增: --disable-update-check \
178新增: --disable-workspace-trust \
179新增: --disable-proxy \
180新增: --disable-getting-started-override \
181新增: "$host_dir" || st=$?
182新增: [[ -z "$opener" ]] || kill "$opener" 2>/dev/null
183新增: return "$st"
184新增:}
修改lib/help.sh+8 −1看文件
@@ -21,6 +21,12 @@ Commands:
2121 run <cmd> [args] Run a command in the VM (no shell: for pipes/redirects
2222 use 'shell -c "..."' instead; pass --tty for TUIs like
2323 opencode, vibe, htop, etc.)
24新增: code Serve VS Code (code-server) from the VM, at
25新增: http://<vm-name>.localhost:<port>/, and open it in the
26新增: browser, until Ctrl-C. Its password is made in each VM
27新增: and printed. Opt-in at setup, with the agents'
28新增: extensions or without: --preinstall=default,code-claude
29新增: (or code-codex, code-vibe, code-server)
2430 stop [vm-name] Stop the VM for the current directory, or the named one
2531 rm [vm-name] Stop and delete the VM for the current directory, or the
2632 named one. Pass a name from 'agent-vm list' to reach a VM
@@ -64,7 +70,7 @@ Commands:
6470 (2 when the call itself is wrong). For integrators.
6571 help Show this help
6672
67删除:VM options (for claude, opencode, codex, vibe, pi, shell, run), read before the
73新增:VM options (for claude, opencode, codex, vibe, pi, shell, run, code), read before the
6874command or right after its name, never later: in 'agent-vm run docker run
6975--rm x', --rm belongs to docker.
7076 --disk GB VM disk size
@@ -120,6 +126,7 @@ Examples:
120126 agent-vm sh -c "ls -la | grep config" # One-shot command via login zsh
121127 agent-vm run npm install # Run a command in the VM
122128 agent-vm run --tty opencode -p "..." # Run a TUI with PTY allocated
129新增: agent-vm code # VS Code in the browser
123130 agent-vm claude -p "fix lint errors" # Pass args to claude
124131 agent-vm rm agent-vm-old-name-1a2b3c4d # Delete a VM by name (see 'list')
125132
修改lib/info.sh+1 −1看文件
@@ -109,7 +109,7 @@ _agent_vm_version() {
109109# --unsafe-disable-security-prompts to accept them, or --readonly.
110110#
111111# ssh_host is the Host alias in ssh_config, the file Lima rewrites with the
112删除:# current port on each start (https://www.agent-vm.org/#connect-an-ide-over-ssh).
112新增:# current port on each start (https://www.agent-vm.org/#ssh-from-your-machine).
113113_agent_vm_info() {
114114 local dir="${1:-$(pwd)}"
115115 local vm_name
修改lib/setup.sh+68 −11看文件
@@ -89,12 +89,37 @@ _agent_vm_node_needed_by() {
8989 elif [[ "$install_pi" == 1 ]]; then
9090 echo "Pi requires npm"
9191 elif [[ "$install_chromium" == 1 && "$install_mcp_chrome" == 1 \
92删除: && ( "$install_claude" == 1 || "$install_opencode" == 1 || "$install_vibe" == 1 ) ]]; then
92新增: && ( "$install_claude" == 1 || "$install_opencode" == 1 || "$install_vibe" == 1 \
93新增: || "$install_code_claude" == 1 || "$install_code_codex" == 1 || "$install_code_vibe" == 1 ) ]]; then
9394 echo "Chrome DevTools MCP uses npx"
9495 fi
9596 return 0
9697}
9798
99新增:# The wizard's question after code-server, on the caller's install_*: how the
100新增:# agents picked that have an extension (Claude Code, Codex, Vibe) are
101新增:# installed. Asked only when there is one.
102新增:_agent_vm_ask_code_extensions() {
103新增: local names="" choice
104新增: [[ "$install_code_server" == 1 ]] || return 0
105新增: [[ "$install_claude" == 1 ]] && names="$names, Claude Code"
106新增: [[ "$install_codex" == 1 ]] && names="$names, Codex"
107新增: [[ "$install_vibe" == 1 ]] && names="$names, Mistral Vibe"
108新增: [[ -n "$names" ]] || return 0
109新增: printf ' %s in the editor:\n' "${names#, }" >&2
110新增: choice="$(_agent_vm_ask_choice "Pick one" 1 \
111新增: "Extension and command line (agent-vm claude...)" \
112新增: "Extension only" \
113新增: "Command line only")"
114新增: [[ "$choice" == 3 ]] && return 0
115新增: install_code_claude="$install_claude"
116新增: install_code_codex="$install_codex"
117新增: install_code_vibe="$install_vibe"
118新增: if [[ "$choice" == 2 ]]; then
119新增: install_claude=0 install_codex=0 install_vibe=0
120新增: fi
121新增:}
122新增:
98123_agent_vm_setup() {
99124 local disk=10
100125 local memory=3
@@ -103,15 +128,17 @@ _agent_vm_setup() {
103128 local preinstall_seen=""
104129 # The default set, used without --preinstall when the wizard's first
105130 # question is accepted or there is no terminal. Opt-in: Ruby, Rust, Go, Pi
106删除: # (0.x, released several times a week) and Playwright MCP (a second
107删除: # browser-driving server, whose tools cost context in every agent). Only MCP
108删除: # servers with something to bake into the image belong here; a remote one
109删除: # is per-project config.
131新增: # (0.x, released several times a week), Playwright MCP (a second
132新增: # browser-driving server, whose tools cost context in every agent), and
133新增: # code-server with its agent extensions (an editor most use on the host).
134新增: # Only MCP servers with something to bake into the image belong here; a
135新增: # remote one is per-project config.
110136 local install_python=1 install_node=1
111137 local install_ruby=0 install_rust=0 install_golang=0
112138 local install_docker=1 install_chromium=1 install_gh=1
113139 local install_claude=1 install_opencode=1 install_codex=1 install_vibe=1
114140 local install_pi=0
141新增: local install_code_server=0 install_code_claude=0 install_code_codex=0 install_code_vibe=0
115142 local install_mcp_chrome=1 install_mcp_playwright=0
116143
117144 local vm_opts=() rm="" taken
@@ -141,8 +168,8 @@ Usage: agent-vm setup [options]
141168
142169Create a base VM template with dev tools and agents pre-installed. Runs an
143170interactive wizard by default; the first prompt offers a "default install"
144删除:(everything except the opt-in Ruby, Rust, Go, Pi, Playwright MCP). Answer 'n' for
145删除:per-component prompts. Pass --preinstall=... to skip the wizard and pick a
171新增:(everything except the opt-in Ruby, Rust, Go, Pi, Playwright MCP, code-server
172新增:and its extensions). Answer 'n' for per-component prompts. Pass --preinstall=... to skip the wizard and pick a
146173specific subset non-interactively. When no terminal is available (e.g. CI),
147174the wizard is skipped automatically and the default set is installed.
148175
@@ -155,13 +182,21 @@ Options:
155182 skipped. Use:
156183 'default' for the default set
157184 (everything except Ruby, Rust, Go, Pi,
158删除: mcp-playwright),
185新增: mcp-playwright, code-server, code-*),
159186 'all' for everything,
160187 'none' for nothing.
161188 Available names:
162189 python, node, ruby, rust, golang, docker, chromium,
163190 gh, claude, opencode, codex, vibe, pi, mcp-chrome,
164删除: mcp-playwright
191新增: mcp-playwright, code-server, code-claude,
192新增: code-codex, code-vibe
193新增: 'code-server' is VS Code in the browser, for
194新增: 'agent-vm code', with GitHub Copilot turned off.
195新增: 'code-claude', 'code-codex' and 'code-vibe' add that
196新增: agent's extension, and code-server with it. Each
197新增: extension brings its own copy of the agent: 'claude',
198新增: 'codex' and 'vibe' are the command-line ones, for
199新增: 'agent-vm claude' and the others.
165200 Selecting codex or pi also installs node (npm). So does
166201 mcp-chrome when chromium and an agent are selected
167202 (npx). mcp-playwright does not: list node yourself.
@@ -179,6 +214,7 @@ Options:
179214 --preinstall=default,rust # default set plus Rust
180215 --preinstall=python,docker,claude
181216 --preinstall=node,chromium,opencode # no chrome MCP
217新增: --preinstall=default,code-claude # plus the editor
182218 --help Show this help
183219EOF
184220 return 0
@@ -220,6 +256,7 @@ EOF
220256 install_docker=0 install_chromium=0 install_gh=0
221257 install_claude=0 install_opencode=0 install_codex=0 install_vibe=0
222258 install_pi=0
259新增: install_code_server=0 install_code_claude=0 install_code_codex=0 install_code_vibe=0
223260 install_mcp_chrome=0 install_mcp_playwright=0
224261 [[ -z "$preinstall" ]] && preinstall="default"
225262 # Iterate the comma-list by appending a trailing comma and peeling off
@@ -238,6 +275,7 @@ EOF
238275 install_docker=1 install_chromium=1 install_gh=1
239276 install_claude=1 install_opencode=1 install_codex=1 install_vibe=1
240277 install_pi=1
278新增: install_code_server=1 install_code_claude=1 install_code_codex=1 install_code_vibe=1
241279 install_mcp_chrome=1 install_mcp_playwright=1
242280 ;;
243281 default)
@@ -263,9 +301,13 @@ EOF
263301 pi) install_pi=1 ;;
264302 mcp-chrome) install_mcp_chrome=1 ;;
265303 mcp-playwright) install_mcp_playwright=1 ;;
304新增: code-server) install_code_server=1 ;;
305新增: code-claude) install_code_claude=1 ;;
306新增: code-codex) install_code_codex=1 ;;
307新增: code-vibe) install_code_vibe=1 ;;
266308 *)
267309 echo "Unknown preinstall name: $f (names are lowercase)" >&2
268删除: echo "Valid: python, node, ruby, rust, golang, docker, chromium, gh, claude, opencode, codex, vibe, pi, mcp-chrome, mcp-playwright, default, all, none" >&2
310新增: echo "Valid: python, node, ruby, rust, golang, docker, chromium, gh, claude, opencode, codex, vibe, pi, mcp-chrome, mcp-playwright, code-server, code-claude, code-codex, code-vibe, default, all, none" >&2
269311 return 1
270312 ;;
271313 esac
@@ -337,7 +379,7 @@ EOF
337379 printf ' Agents: Claude Code, OpenCode, Codex CLI, Mistral Vibe\n' >&2
338380 printf ' Tools: Python, Node.js, Docker, Chromium, gh,\n' >&2
339381 printf ' Chrome DevTools MCP\n' >&2
340删除: printf ' Skip: Pi, Ruby, Rust, Go, Playwright MCP\n\n' >&2
382新增: printf ' Skip: Pi, Ruby, Rust, Go, Playwright MCP, code-server\n\n' >&2
341383 local use_default_software
342384 use_default_software=$(_agent_vm_ask_yn "Use this default" Y)
343385 if [[ "$use_default_software" != "1" ]]; then
@@ -349,6 +391,11 @@ EOF
349391 install_vibe=$(_agent_vm_ask_yn "Mistral Vibe" Y)
350392 install_pi=$(_agent_vm_ask_yn "Pi" N)
351393
394新增: printf '\nEditor\n' >&2
395新增: printf '──────\n' >&2
396新增: install_code_server=$(_agent_vm_ask_yn "code-server (VS Code in the browser, for 'agent-vm code')" N)
397新增: _agent_vm_ask_code_extensions
398新增:
352399 printf '\nSystem tools\n' >&2
353400 printf '────────────\n' >&2
354401 install_docker=$(_agent_vm_ask_yn "Docker" Y)
@@ -411,6 +458,11 @@ EOF
411458 echo "Running security checks..."
412459 [[ -n "$declined_protection" ]] || _agent_vm_offer_git_protection
413460
461新增: # An extension needs the editor.
462新增: if [[ "$install_code_claude$install_code_codex$install_code_vibe" == *1* ]]; then
463新增: install_code_server=1
464新增: fi
465新增:
414466 # --preinstall can name what needs node without node.
415467 local node_reason
416468 node_reason="$(_agent_vm_node_needed_by)"
@@ -488,6 +540,10 @@ EOF
488540 printf 'export AGENT_VM_INSTALL_CODEX=%s\n' "$install_codex"
489541 printf 'export AGENT_VM_INSTALL_VIBE=%s\n' "$install_vibe"
490542 printf 'export AGENT_VM_INSTALL_PI=%s\n' "$install_pi"
543新增: printf 'export AGENT_VM_INSTALL_CODE_SERVER=%s\n' "$install_code_server"
544新增: printf 'export AGENT_VM_INSTALL_CODE_CLAUDE=%s\n' "$install_code_claude"
545新增: printf 'export AGENT_VM_INSTALL_CODE_CODEX=%s\n' "$install_code_codex"
546新增: printf 'export AGENT_VM_INSTALL_CODE_VIBE=%s\n' "$install_code_vibe"
491547 printf 'export AGENT_VM_INSTALL_MCP_CHROME=%s\n' "$install_mcp_chrome"
492548 printf 'export AGENT_VM_INSTALL_MCP_PLAYWRIGHT=%s\n' "$install_mcp_playwright"
493549 cat "${AGENT_VM_SCRIPT_DIR}/agent-vm.setup.sh"
@@ -524,6 +580,7 @@ EOF
524580 [[ "$install_codex" == "1" ]] && echo " agent-vm codex"
525581 [[ "$install_vibe" == "1" ]] && echo " agent-vm vibe"
526582 [[ "$install_pi" == "1" ]] && echo " agent-vm pi"
583新增: [[ "$install_code_server" == "1" ]] && echo " agent-vm code"
527584 # Only worth saying to someone who has a VM to re-clone: on a first install
528585 # there is nothing to reset, and the advice reads like a missed step.
529586 if [[ -n "$(_agent_vm_project_vms)" ]]; then
修改lib/ui.sh+20 −0看文件
@@ -37,6 +37,26 @@ _agent_vm_ask_yn() {
3737 esac
3838}
3939
40新增:# A numbered choice: the options as arguments after the prompt and the
41新增:# default's number. Prints the number picked. Re-asks on anything else.
42新增:_agent_vm_ask_choice() {
43新增: local prompt="$1" default="$2" reply i
44新增: shift 2
45新增: i=1
46新增: for reply in "$@"; do
47新增: printf ' %s) %s\n' "$i" "$reply" >&2
48新增: i=$((i + 1))
49新增: done
50新增: while true; do
51新增: reply="$(_agent_vm_ask "$prompt" "$default")"
52新增: if [[ "$reply" =~ ^[1-9][0-9]*$ && "$reply" -le $# ]]; then
53新增: printf '%s\n' "$reply"
54新增: return 0
55新增: fi
56新增: printf ' (a number from 1 to %s; got: %s)\n' "$#" "$reply" >&2
57新增: done
58新增:}
59新增:
4060# Can a question be asked, and seen? A terminal to read the answer from, and
4161# stderr, where the question goes, on a terminal too: a caller capturing
4262# stderr would otherwise wait on a question nobody sees.
修改tests/02-setup-output.sh+27 −0看文件
@@ -17,6 +17,33 @@ check "default leaves pi out" "$(preinstall_exports default PI)" "
1717check "all installs pi" "$(preinstall_exports all PI)" "1"
1818check "naming pi installs it" "$(preinstall_exports default,pi PI)" "1"
1919check "pi pulls node in" "$(preinstall_exports pi NODE)" "1"
20新增:check "default leaves code-server out" "$(preinstall_exports default CODE_SERVER)" "0"
21新增:check "all installs code-server" "$(preinstall_exports all CODE_SERVER)" "1"
22新增:check "naming code-server installs it" "$(preinstall_exports default,code-server CODE_SERVER)" "1"
23新增:check "code-server alone has no extension" "$(preinstall_exports code-server CODE_CLAUDE)" "0"
24新增:check "code-claude pulls code-server in" "$(preinstall_exports code-claude CODE_SERVER)" "1"
25新增:check "code-claude alone: no Claude CLI" "$(preinstall_exports code-claude CLAUDE)" "0"
26新增:check "default leaves the extensions out" "$(preinstall_exports default CODE_CODEX)" "0"
27新增:check "all installs the extensions" "$(preinstall_exports all CODE_VIBE)" "1"
28新增:check "code-codex needs no npm" "$(preinstall_exports code-codex NODE)" "0"
29新增:check "but the chrome MCP wired into it does" "$(preinstall_exports code-codex,chromium,mcp-chrome NODE)" "1"
30新增:
31新增:section "setup wizard: agents in the editor"
32新增:# The question after code-server, with the answer given.
33新增:code_ext() {
34新增: ( install_code_server="$1" install_claude="$2" install_codex="$3" install_vibe="$4"
35新增: install_code_claude=0 install_code_codex=0 install_code_vibe=0 answer="$5"
36新增: _agent_vm_ask_choice() { echo asked >> "$SB/asked.log"; echo "$answer"; }
37新增: _agent_vm_ask_code_extensions 2>/dev/null
38新增: echo "$install_claude$install_codex$install_vibe:$install_code_claude$install_code_codex$install_code_vibe" )
39新增:}
40新增:check "both: CLIs kept, extensions added" "$(code_ext 1 1 0 1 1)" "101:101"
41新增:check "extension only: CLIs dropped" "$(code_ext 1 1 1 0 2)" "000:110"
42新增:check "command line only: no extension" "$(code_ext 1 1 1 1 3)" "111:000"
43新增:: > "$SB/asked.log"
44新增:check "no code-server: not asked" "$(code_ext 0 1 1 1 2)" "111:000"
45新增:check "no agent with an extension: not asked" "$(code_ext 1 0 0 0 2)" "000:000"
46新增:check "and nothing was asked" "$(wc -l < "$SB/asked.log" | tr -d ' ')" "0"
2047
2148section "--preinstall: MCP names"
2249check "default wires the chrome MCP" "$(preinstall_exports default MCP_CHROME)" "1"
修改tests/06-help-and-setup-script.sh+78 −3看文件
@@ -5,10 +5,11 @@ section "release hygiene"
55# is a command nobody uses. (`sh`/`destroy`/`status` are aliases documented inline.)
66help_text="$(agent-vm help)"
77missing=""
8删除:for verb in setup claude opencode codex vibe pi shell run stop rm destroy-all \
8新增:for verb in setup claude opencode codex vibe pi shell run code stop rm destroy-all \
99 list name info env version help; do
10新增: # The word, then a space or a comma: `codex` is not `code`.
1011 case "$help_text" in
11删除: *" $verb"*) ;;
12新增: *" $verb "*|*" $verb,"*) ;;
1213 *) missing="$missing $verb" ;;
1314 esac
1415done
@@ -163,7 +164,7 @@ else
163164 (
164165 HOME="$MCPHOME"
165166 eval "$(awk '/^configure_mcp\(\) \{/,/^\}/' "$SETUP_SH")"
166删除: INSTALL_CLAUDE=1 INSTALL_OPENCODE=1 INSTALL_VIBE=1 INSTALL_CODEX=1
167新增: HAS_CLAUDE=1 INSTALL_OPENCODE=1 HAS_VIBE=1 HAS_CODEX=1
167168 for _ in 1 2; do # twice: the writer must be idempotent
168169 configure_mcp chrome-devtools npx -y chrome-devtools-mcp@latest --headless=true
169170 configure_mcp playwright env PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npx -y @playwright/mcp@latest
@@ -211,3 +212,77 @@ else
211212 run_pi_block "$PIH0" 0
212213 check "pi: skipped without node" "$( [ -e "$PIH0/sudo.log" ] || [ -e "$PIH0/.pi" ]; echo $?)" "1"
213214fi
215新增:
216新增:# =============================================================================
217新增:section "code-server install block"
218新增:# =============================================================================
219新增:# Lifted out like the Pi block, with curl and code-server recorded instead of
220新增:# run, then the MCP writer after it, as in the script.
221新增:if ! command -v jq >/dev/null 2>&1; then
222新增: printf ' skip code-server install tests (jq not installed)\n'
223新增:else
224新增: cs_block="$(awk '/^toml_prepend\(\) \{/,/^\}/' "$SETUP_SH")
225新增:$(awk '/^if \[\[ "\$INSTALL_CODE_SERVER" == "1" \]\]; then/,/^fi$/' "$SETUP_SH")
226新增:$(awk '/^configure_mcp\(\) \{/,/^\}/' "$SETUP_SH")"
227新增: # <home> <claude> <codex> <vibe>: the extensions asked for.
228新增: # Under set -e, as the script runs: a failing step must show here. Twice:
229新增: # setup can be run again on a base. The first run's state is kept in
230新增: # <home>/first.
231新增: run_cs_block() {
232新增: mkdir -p "$1/.config/code-server"; echo "password: from-the-base" > "$1/.config/code-server/config.yaml"
233新增: ( set -e
234新增: HOME="$1"; INSTALL_CODE_SERVER=1 INSTALL_CODE_CLAUDE="$2" INSTALL_CODE_CODEX="$3" INSTALL_CODE_VIBE="$4"
235新增: HAS_CLAUDE="$2" HAS_CODEX="$3" HAS_VIBE="$4" INSTALL_OPENCODE=0
236新增: curl() { echo "curl $*" >> "$HOME/calls.log"; }
237新增: code-server() { echo "code-server $*" >> "$HOME/calls.log"; }
238新增: eval "$cs_block"
239新增: mkdir -p "$HOME/first"
240新增: for f in .codex/config.toml .vibe/config.toml; do [ ! -f "$HOME/$f" ] || cp "$HOME/$f" "$HOME/first/${f%%/*}"; done
241新增: configure_mcp chrome-devtools npx -y chrome-devtools-mcp@latest
242新增: eval "$cs_block"
243新增: configure_mcp chrome-devtools npx -y chrome-devtools-mcp@latest
244新增: echo done > "$HOME/finished" ) >/dev/null 2>&1
245新增: }
246新增: CSB="$SB/cs-bare"; mkdir -p "$CSB"
247新增: run_cs_block "$CSB" 0 0 0
248新增: check "code-server alone: no extension installed" "$(grep -c '^code-server' "$CSB/calls.log")" "0"
249新增: check "code-server alone: Copilot off" \
250新增: "$(jq -r '."chat.disableAIFeatures"' "$CSB/.local/share/code-server/User/settings.json")" "true"
251新增: check "code-server alone: dark theme" \
252新增: "$(jq -r '."workbench.colorTheme"' "$CSB/.local/share/code-server/User/settings.json")" "Dark 2026"
253新增: check "code-server alone: no Claude settings" \
254新增: "$(jq -r 'keys | map(select(startswith("claudeCode"))) | length' "$CSB/.local/share/code-server/User/settings.json")" "0"
255新增: check "the password code-server wrote is not left in the base" \
256新增: "$([ -e "$CSB/.config/code-server" ] && echo left || echo gone)" "gone"
257新增:
258新增: check "code-server alone: runs to the end under set -e" "$(cat "$CSB/finished" 2>/dev/null)" "done"
259新增:
260新增: CSA="$SB/cs-all"; mkdir -p "$CSA"
261新增: run_cs_block "$CSA" 1 1 1
262新增: check "with the extensions: runs to the end under set -e" "$(cat "$CSA/finished" 2>/dev/null)" "done"
263新增: check "codex: written on a fresh home" "$(head -n 2 "$CSA/first/.codex" 2>/dev/null | sort | tr '\n' ' ')" \
264新增: 'approval_policy = "never" sandbox_mode = "danger-full-access" '
265新增: check "vibe: written on a fresh home" "$(cat "$CSA/first/.vibe" 2>/dev/null)" 'default_agent = "auto-approve"'
266新增: check "the three extensions, in one call" \
267新增: "$(grep '^code-server' "$CSA/calls.log" | head -n 1)" \
268新增: "code-server --install-extension anthropic.claude-code --install-extension openai.chatgpt --install-extension mistralai.mistral-vibe-code"
269新增: check "claude: bypass mode allowed and picked" \
270新增: "$(jq -r '[."claudeCode.allowDangerouslySkipPermissions", ."claudeCode.initialPermissionMode"] | join(" ")' \
271新增: "$CSA/.local/share/code-server/User/settings.json")" "true bypassPermissions"
272新增: check "codex: full access, once, before any table" \
273新增: "$(head -n 2 "$CSA/.codex/config.toml" | sort | tr '\n' ' '; grep -c '^approval_policy' "$CSA/.codex/config.toml")" \
274新增: 'approval_policy = "never" sandbox_mode = "danger-full-access" 1'
275新增: check "vibe: auto-approve, once, before any table" \
276新增: "$(head -n 1 "$CSA/.vibe/config.toml"; grep -c '^default_agent' "$CSA/.vibe/config.toml")" \
277新增: "$(printf 'default_agent = "auto-approve"\n1')"
278新增: if python3 -c 'import tomllib' 2>/dev/null; then
279新增: check "codex: the file parses, keys at the top level" \
280新增: "$(python3 -c 'import sys,tomllib; d=tomllib.load(open(sys.argv[1],"rb")); print(d["approval_policy"], "chrome-devtools" in d["mcp_servers"])' "$CSA/.codex/config.toml")" \
281新增: "never True"
282新增: check "vibe: the file parses, key at the top level" \
283新增: "$(python3 -c 'import sys,tomllib; d=tomllib.load(open(sys.argv[1],"rb")); print(d["default_agent"], len(d["mcp_servers"]))' "$CSA/.vibe/config.toml")" \
284新增: "auto-approve 1"
285新增: else
286新增: printf ' skip TOML parse checks (no python3 with tomllib)\n'
287新增: fi
288新增:fi
修改tests/11-recorded-commands.sh+3 −0看文件
@@ -69,6 +69,9 @@ case "$1" in
6969 esac
7070 [ -z "${AGENT_VM_TEST_RO:-}" ] || exit 1 ;;
7171 *"exec "*" -s"*) cat >> "${AGENT_VM_TEST_STDIN:-/dev/null}" ;;
72新增: # The editor's prep (lib/code.sh): AGENT_VM_TEST_CODE_PREP is its answer.
73新增: *"agent-vm-code "*)
74新增: printf '%b' "${AGENT_VM_TEST_CODE_PREP-config=/home/u/.config/code-server/agent-vm-lima-x.yaml\npassword=0123456789abcdef0123456789abcdef\n}" ;;
7275 esac ;;
7376 start) rm -f "$AGENT_VM_TEST_REC.stopped" ;;
7477 stop) cat >/dev/null; [ -n "${AGENT_VM_TEST_STOP_FAIL:-}" ] || touch "$AGENT_VM_TEST_REC.stopped" ;;
新增tests/22-code.sh+69 −0看文件
@@ -0,0 +1,69 @@
1新增:# =============================================================================
2新增:section "code: code-server in the VM"
3新增:# =============================================================================
4新增:# Against the recording limactl of tests/11-recorded-commands.sh.
5新增:ports="$(_agent_vm_code_ports "$PV")"
6新增:first="${ports%% *}"
7新增:check "ten ports per VM" "$(printf '%s\n' $ports | wc -l | tr -d ' ')" "10"
8新增:check "the same ones on every start" "$(_agent_vm_code_ports "$PV")" "$ports"
9新增:case "$first" in
10新增: 2[0-9][0-9][0-9][0-9]) pass "from 20000 to 29999" ;;
11新增: *) fail "port out of range: $first" ;;
12新增:esac
13新增:check "host name: the VM's, lowercased" "$(_agent_vm_code_host agent-vm-My-Proj-0a1b2c3d)" "agent-vm-my-proj-0a1b2c3d.localhost"
14新增:long="agent-vm-$(printf 'x%.0s' $(seq 1 80))-0a1b2c3d"
15新增:check "host name: a DNS label, the hash kept" \
16新增: "$(_agent_vm_code_host "$long" | sed 's/\.localhost$//' | awk '{ print length($0) <= 63, substr($0, length($0) - 8) }')" "1 -0a1b2c3d"
17新增:check "another VM, other ports" \
18新增: "$([ "$(_agent_vm_code_ports agent-vm-other-00000000)" != "$ports" ] && echo differ)" "differ"
19新增:
20新增:if _agent_vm_host_port_open "$first"; then
21新增: printf ' skip code launch tests (port %s is taken on this machine)\n' "$first"
22新增:else
23新增: out="$(rec code)"
24新增: rec_has "agent-vm code-server --config /home/u/.config/code-server/agent-vm-lima-x.yaml --bind-addr 127.0.0.1:$first --cookie-suffix $PV" \
25新增: && pass "code-server on the VM's loopback, the VM's own config and cookie" \
26新增: || fail "code: $(grep 'code-server --config' "$REC")"
27新增: rec_has "--disable-proxy --disable-getting-started-override $PROJ" \
28新增: && pass "no port proxy, and the project opened" || fail "code flags: $(grep 'code-server --config' "$REC")"
29新增: case "$out" in
30新增: *"Editor: http://$PV.localhost:$first/"*"Password: 0123456789abcdef0123456789abcdef"*)
31新增: pass "the VM's own host name, and the password" ;;
32新增: *) fail "code output: $out" ;;
33新增: esac
34新增: check "the Safari fallback, on macOS only" \
35新增: "$(uname() { echo Linux; }; _agent_vm_code_say u 20000 pw | grep -c 127.0.0.1; uname() { echo Darwin; }; _agent_vm_code_say u 20000 pw | grep -c 'http://127.0.0.1:20000/')" \
36新增: "$(printf '0\n1')"
37新增:
38新增: AGENT_VM_TEST_CODE_PREP="config=/c.yaml\npassword=pw\nlistening=$first\n" rec code >/dev/null
39新增: rec_has "--bind-addr 127.0.0.1:$((first + 1))" \
40新增: && pass "a port taken in the VM is skipped" || fail "taken port: $(grep 'code-server --config' "$REC")"
41新增:
42新增: out="$(AGENT_VM_TEST_CODE_PREP="config=/c.yaml\npassword=pw\nrunning=$first\n" rec code)"
43新增: rec_has "code-server --config" && fail "a second editor was started" \
44新增: || pass "an editor already running is not started again"
45新增: case "$out" in
46新增: *"already runs"*"http://$PV.localhost:$first/"*"Password: pw"*) pass "and its address is given" ;;
47新增: *) fail "running: $out" ;;
48新增: esac
49新增:fi
50新增:
51新增:out="$(AGENT_VM_TEST_CODE_PREP='missing\n' rec code; echo "rc=$?")"
52新增:case "$out" in
53新增: *"code-server is not installed"*"--preinstall=default,code-claude"*"rc=1") pass "without code-server: says how to add it" ;;
54新增: *) fail "missing: $out" ;;
55新增:esac
56新增:rec_has "code-server --config" && fail "missing: started anyway" || pass "and starts nothing"
57新增:
58新增:out="$(AGENT_VM_TEST_CODE_PREP='config=/c.yaml\npassword=a\033]0;x\a\n' rec code; echo "rc=$?")"
59新增:case "$out" in
60新增: *"could not read the editor's password"*"rc=1") pass "a password with control characters is not printed" ;;
61新增: *) fail "control chars: $(printf '%s' "$out" | cat -v)" ;;
62新增:esac
63新增:
64新增:out="$(rec code foo; echo "rc=$?")"
65新增:case "$out" in
66新增: *"unknown argument for code: foo"*"rc=1") pass "code takes no argument" ;;
67新增: *) fail "code foo: $out" ;;
68新增:esac
69新增:rec_has "shell" && fail "code foo: the VM was entered" || pass "and enters no VM"
修改www/src/i18n/en.ts+20 −7看文件
@@ -169,7 +169,7 @@ export const en = {
169169 {
170170 title: 'Get inside',
171171 body: 'A shell to poke around, or a single command when you already know what you want.',
172删除: code: 'agent-vm shell # zsh in the VM\nagent-vm run npm install # one-off command\nagent-vm run --tty opencode # allocate a PTY for TUIs\nagent-vm sh -c "ls -la | grep config"',
172新增: code: 'agent-vm shell # zsh in the VM\nagent-vm run npm install # one-off command\nagent-vm run --tty opencode # allocate a PTY for TUIs\nagent-vm sh -c "ls -la | grep config"\nagent-vm code # VS Code in the browser, if set up',
173173 },
174174 {
175175 title: 'Manage the fleet',
@@ -192,9 +192,9 @@ export const en = {
192192 code: 'agent-vm env set GH_TOKEN # pasted unseen, not in history\nagent-vm env list # names only, never values\nagent-vm env has ANTHROPIC_API_KEY\n\n# scoped to this project only\nagent-vm project-env set SOME_PATH ./config',
193193 },
194194 {
195删除: title: 'Connect an IDE over SSH',
196删除: body: 'VS Code Remote-SSH, JetBrains Gateway or a GUI agent can work in the VM over SSH, through the alias `agent-vm info` prints as `ssh_host`. Put these lines at the top of `~/.ssh/config`: a `ForwardAgent yes` found before them would hand the VM your SSH keys. `--ssh-port` pins the port for tools that save it.',
197删除: code: '# top of ~/.ssh/config\nInclude ~/.lima/*/ssh.config\nHost lima-agent-vm-*\n ForwardAgent no\n ForwardX11 no\n\nagent-vm info | grep ^ssh_host # the alias to use\nagent-vm --ssh-port 2222 shell # a fixed port',
195新增: title: 'Edit with the VM’s tools',
196新增: body: 'For language servers, linters, the debugger and the VM’s packages, run the editor in the VM: `agent-vm code` serves VS Code (code-server) to a browser tab, the only part on your machine. Set it up with `code-server` or a `code-*` name ([What is in the VM](#what-is-in-the-vm)). The tab can still open links, and every VM reaches the editor’s port, hence a password and a host name per VM ([Network and ports](#network-and-ports)). Do not connect a desktop editor over SSH instead ([SSH from your machine](#ssh-from-your-machine)).',
197新增: code: 'agent-vm setup --preinstall=default,code-claude # once\nagent-vm code # prints the address and the password\n # Ctrl-C stops the editor',
198198 },
199199 ],
200200 gitTitle: 'Letting the agent commit',
@@ -229,6 +229,7 @@ export const en = {
229229 rows: [
230230 ['shell, sh', 'Open a zsh shell in the VM. `-c "…"` runs a one-shot command through a login shell.'],
231231 ['run <cmd> [args]', 'Run a command with no shell. `--tty` allocates a PTY for TUIs.'],
232新增: ['code', 'Serve VS Code (code-server) from the VM at `http://<vm-name>.localhost:<port>/` and open it in your browser, until Ctrl-C. Its password is made in the VM on first use and printed. Needs `code-server` or a `code-*` name at setup ([What is in the VM](#what-is-in-the-vm)).'],
232233 ],
233234 },
234235 {
@@ -262,7 +263,7 @@ export const en = {
262263 },
263264 ],
264265 optionsTitle: 'VM options',
265删除: optionsNote: 'For `claude`, `opencode`, `codex`, `vibe`, `pi`, `shell` and `run`, placed before the command or right after its name. Anything later belongs to the command: in `agent-vm run docker run --rm x`, `--rm` is docker’s.',
266新增: optionsNote: 'For `claude`, `opencode`, `codex`, `vibe`, `pi`, `shell`, `run` and `code`, placed before the command or right after its name. Anything later belongs to the command: in `agent-vm run docker run --rm x`, `--rm` is docker’s.',
266267 optionsHeaders: ['Flag', 'What it does', 'Default'],
267268 options: [
268269 ['--disk GB', 'VM disk size. Can grow, never shrink.', 'the template’s (10)'],
@@ -526,6 +527,15 @@ export const en = {
526527 ],
527528 code: '',
528529 },
530新增: {
531新增: title: 'SSH from your machine',
532新增: paras: [
533新增: 'Do not connect VS Code Remote-SSH or open-remote-ssh to an agent VM. They run a server in the VM, which root in the VM controls, and the editor on your machine trusts it. Microsoft’s Remote-SSH page says so: “a compromised remote could use the VS Code Remote connection to execute code on your local machine”, and it is by design. Public write-ups show it opening a terminal on the host and running commands there. That removes the boundary agent-vm sets up, which is worse than opening the project in Restricted Mode. JetBrains Gateway most likely works the same way; it has not been checked. For language servers and a debugger with the VM’s packages, use [`agent-vm code`](#edit-with-the-vm-s-tools).',
534新增: 'For scripts, `scp` or `rsync`, `agent-vm info` prints the SSH alias as `ssh_host`. Put these lines at the top of `~/.ssh/config`: a `ForwardAgent yes` found before them would hand the VM your SSH keys. `--ssh-port` pins the port for tools that save it.',
535新增: ],
536新增: list: [],
537新增: code: '# top of ~/.ssh/config\nInclude ~/.lima/*/ssh.config\nHost lima-agent-vm-*\n ForwardAgent no\n ForwardX11 no\n\nagent-vm info | grep ^ssh_host # the alias to use\nagent-vm --ssh-port 2222 shell # a fixed port',
538新增: },
529539 {
530540 title: 'Shell, commands, hooks',
531541 paras: [],
@@ -570,6 +580,7 @@ export const en = {
570580 title: 'Network and ports',
571581 paras: [
572582 'The VM reaches the internet and every service on your machine’s loopback, at `192.168.5.2`. Lima forwards every port a VM listens on to your `127.0.0.1` when it is free: a VM that listens first on 5432 receives the connections, and passwords, meant for your local Postgres. Blocking this is [on the roadmap](#roadmap).',
583新增: 'So every VM can reach the editor of every other one. `agent-vm code` gives each its own password, made in that VM, and its own host name, `<vm-name>.localhost`: browsers keep cookies per host name and not per port, so at `127.0.0.1` any page a VM serves would receive the editor sessions of the others, and with them a way in. Chrome and Firefox resolve `*.localhost` themselves; Safari may not, and then `127.0.0.1` in a private window kept for the editor does the same.',
573584 ],
574585 list: [],
575586 code: '',
@@ -641,11 +652,13 @@ export const en = {
641652 ['AI agents', 'Pi', 'pi', 'no'],
642653 ['MCP', 'Chrome DevTools MCP, wired into every installed agent but Pi (no MCP support)', 'mcp-chrome', 'yes'],
643654 ['MCP', 'Playwright MCP, reusing the same Chromium', 'mcp-playwright', 'no'],
655新增: ['Editor', 'code-server (VS Code in the browser, for `agent-vm code`), dark theme, GitHub Copilot off', 'code-server', 'no'],
656新增: ['Editor', 'The Claude Code, Codex or Mistral Vibe extension, each starting with no permission prompts, with code-server', 'code-claude, code-codex, code-vibe', 'no'],
644657 ],
645658 contentsCode:
646删除: 'agent-vm setup --preinstall=default # no prompts\nagent-vm setup --preinstall=default,rust # plus Rust\nagent-vm setup --preinstall=python,docker,claude # minimal Claude setup\nagent-vm setup --disk 50 --memory 16 --cpus 8 # a bigger template',
659新增: 'agent-vm setup --preinstall=default # no prompts\nagent-vm setup --preinstall=default,rust # plus Rust\nagent-vm setup --preinstall=python,docker,claude # minimal Claude setup\nagent-vm setup --preinstall=default,code-claude # plus the editor\nagent-vm setup --disk 50 --memory 16 --cpus 8 # a bigger template',
647660 contentsNote:
648删除: '`codex` and `pi` pull in `node`, and so does `mcp-chrome` with `chromium` and an agent. Both MCP servers are skipped without `node` and `chromium`. This is only what the template ships: the agent is root in the VM and has the network, so it installs whatever else it needs.',
661新增: '`codex` and `pi` pull in `node`, and so does `mcp-chrome` with `chromium` and an agent. Both MCP servers are skipped without `node` and `chromium`. Each editor extension ships its own copy of its agent (200 to 600 MB): the wizard asks whether to keep the command-line one too. Without it, `agent-vm claude` says it is not installed. This is only what the template ships: the agent is root in the VM and has the network, so it installs whatever else it needs.',
649662 dockerTitle: 'Why not Docker',
650663 dockerLede:
651664 'On Linux, containers share the host kernel, so a compromised dependency that finds a kernel bug is on your host. On macOS, Docker Desktop already runs a VM, which narrows the gap, but it is one VM shared by every container rather than one per project. A VM brings its own kernel, and root inside it still has the hypervisor between it and your machine. The practical differences matter as much as the security one.',
修改www/src/i18n/fr.ts+20 −7看文件
@@ -171,7 +171,7 @@ export const fr: Dictionary = {
171171 {
172172 title: 'Entrer dans la VM',
173173 body: 'Un shell pour aller voir ce qui s\'y passe, ou une commande isolée quand tu sais déjà ce que tu veux.',
174删除: code: 'agent-vm shell # zsh dans la VM\nagent-vm run npm install # commande unique\nagent-vm run --tty opencode # un PTY pour les TUI\nagent-vm sh -c "ls -la | grep config"',
174新增: code: 'agent-vm shell # zsh dans la VM\nagent-vm run npm install # commande unique\nagent-vm run --tty opencode # un PTY pour les TUI\nagent-vm sh -c "ls -la | grep config"\nagent-vm code # VS Code dans le navigateur, si installé',
175175 },
176176 {
177177 title: 'Gérer le parc',
@@ -194,9 +194,9 @@ export const fr: Dictionary = {
194194 code: 'agent-vm env set GH_TOKEN # masqué, hors historique\nagent-vm env list # les noms, jamais les valeurs\nagent-vm env has ANTHROPIC_API_KEY\n\n# limité à ce projet\nagent-vm project-env set SOME_PATH ./config',
195195 },
196196 {
197删除: title: 'Brancher un IDE en SSH',
198删除: body: 'VS Code Remote-SSH, JetBrains Gateway ou un agent graphique peuvent travailler dans la VM en SSH, par l\'alias qu\'`agent-vm info` affiche comme `ssh_host`. Mets ces lignes en haut de `~/.ssh/config` : un `ForwardAgent yes` trouvé avant elles donnerait tes clés SSH à la VM. `--ssh-port` fixe le port pour les outils qui l\'enregistrent.',
199删除: code: '# en haut de ~/.ssh/config\nInclude ~/.lima/*/ssh.config\nHost lima-agent-vm-*\n ForwardAgent no\n ForwardX11 no\n\nagent-vm info | grep ^ssh_host # l\'alias à utiliser\nagent-vm --ssh-port 2222 shell # un port fixe',
197新增: title: 'Éditer avec les outils de la VM',
198新增: body: 'Pour les serveurs de langage, les linters, le débogueur et les paquets de la VM, fais tourner l\'éditeur dans la VM : `agent-vm code` sert VS Code (code-server) dans un onglet du navigateur, seule partie sur ta machine. Il s\'installe avec `code-server` ou un nom `code-*` ([Ce qu\'il y a dans la VM](#what-is-in-the-vm)). L\'onglet peut toujours ouvrir des liens, et chaque VM atteint le port de l\'éditeur, d\'où un mot de passe et un nom d\'hôte par VM ([Réseau et ports](#network-and-ports)). N\'y branche pas plutôt un éditeur de bureau en SSH ([SSH depuis ta machine](#ssh-from-your-machine)).',
199新增: code: 'agent-vm setup --preinstall=default,code-claude # une fois\nagent-vm code # affiche l\'adresse et le mot de passe\n # Ctrl-C arrête l\'éditeur',
200200 },
201201 ],
202202 gitTitle: 'Laisser l\'agent commiter',
@@ -231,6 +231,7 @@ export const fr: Dictionary = {
231231 rows: [
232232 ['shell, sh', 'Ouvre un shell zsh dans la VM. `-c "…"` exécute une commande unique via un shell de connexion.'],
233233 ['run <cmd> [args]', 'Exécute une commande sans shell. `--tty` alloue un PTY pour les TUI.'],
234新增: ['code', 'Sert VS Code (code-server) depuis la VM à `http://<nom-de-vm>.localhost:<port>/` et l\'ouvre dans ton navigateur, jusqu\'à Ctrl-C. Son mot de passe est créé dans la VM à la première utilisation, puis affiché. Demande `code-server` ou un nom `code-*` au setup ([Ce qu\'il y a dans la VM](#what-is-in-the-vm)).'],
234235 ],
235236 },
236237 {
@@ -264,7 +265,7 @@ export const fr: Dictionary = {
264265 },
265266 ],
266267 optionsTitle: 'Options de VM',
267删除: optionsNote: 'Pour `claude`, `opencode`, `codex`, `vibe`, `pi`, `shell` et `run`, à placer avant la commande ou juste après son nom. Tout ce qui suit appartient à la commande : dans `agent-vm run docker run --rm x`, `--rm` est l\'option de docker.',
268新增: optionsNote: 'Pour `claude`, `opencode`, `codex`, `vibe`, `pi`, `shell`, `run` et `code`, à placer avant la commande ou juste après son nom. Tout ce qui suit appartient à la commande : dans `agent-vm run docker run --rm x`, `--rm` est l\'option de docker.',
268269 optionsHeaders: ['Option', 'Rôle', 'Défaut'],
269270 options: [
270271 ['--disk GB', 'Taille du disque. Peut grandir, jamais rétrécir.', 'celle de l\'image (10)'],
@@ -528,6 +529,15 @@ export const fr: Dictionary = {
528529 ],
529530 code: '',
530531 },
532新增: {
533新增: title: 'SSH depuis ta machine',
534新增: paras: [
535新增: 'Ne branche pas VS Code Remote-SSH ou open-remote-ssh sur une VM d\'agent. Ils font tourner un serveur dans la VM, que contrôle root dans la VM, et l\'éditeur sur ta machine lui fait confiance. La page de Remote-SSH chez Microsoft le dit : « a compromised remote could use the VS Code Remote connection to execute code on your local machine », et c\'est voulu. Des articles publics le montrent ouvrant un terminal sur l\'hôte et y lançant des commandes. Cela supprime la frontière que pose agent-vm, ce qui est pire qu\'ouvrir le projet en mode restreint. JetBrains Gateway fonctionne très probablement de la même façon ; ce n\'est pas vérifié. Pour les serveurs de langage et un débogueur avec les paquets de la VM, utilise [`agent-vm code`](#edit-with-the-vm-s-tools).',
536新增: 'Pour des scripts, `scp` ou `rsync`, `agent-vm info` affiche l\'alias SSH comme `ssh_host`. Mets ces lignes en haut de `~/.ssh/config` : un `ForwardAgent yes` trouvé avant elles donnerait tes clés SSH à la VM. `--ssh-port` fixe le port pour les outils qui l\'enregistrent.',
537新增: ],
538新增: list: [],
539新增: code: '# en haut de ~/.ssh/config\nInclude ~/.lima/*/ssh.config\nHost lima-agent-vm-*\n ForwardAgent no\n ForwardX11 no\n\nagent-vm info | grep ^ssh_host # l\'alias à utiliser\nagent-vm --ssh-port 2222 shell # un port fixe',
540新增: },
531541 {
532542 title: 'Shell, commandes, hooks',
533543 paras: [],
@@ -572,6 +582,7 @@ export const fr: Dictionary = {
572582 title: 'Réseau et ports',
573583 paras: [
574584 'La VM atteint Internet et tous les services de la boucle locale de ta machine, à `192.168.5.2`. Lima redirige chaque port qu\'écoute une VM vers ton `127.0.0.1` s\'il est libre : une VM qui écoute la première sur 5432 reçoit les connexions, et les mots de passe, destinés à ton Postgres local. Le bloquer est [sur la feuille de route](#roadmap).',
585新增: 'Chaque VM peut donc joindre l\'éditeur de toutes les autres. `agent-vm code` donne à chacune son propre mot de passe, créé dans cette VM, et son propre nom d\'hôte, `<nom-de-vm>.localhost` : les navigateurs rangent les cookies par nom d\'hôte et non par port, si bien qu\'à `127.0.0.1` n\'importe quelle page servie par une VM recevrait les sessions d\'éditeur des autres, et avec elles une porte d\'entrée. Chrome et Firefox résolvent `*.localhost` eux-mêmes ; Safari peut ne pas le faire, et `127.0.0.1` dans une fenêtre privée réservée à l\'éditeur fait alors la même chose.',
575586 ],
576587 list: [],
577588 code: '',
@@ -643,11 +654,13 @@ export const fr: Dictionary = {
643654 ['Agents IA', 'Pi', 'pi', 'non'],
644655 ['MCP', 'Chrome DevTools MCP, câblé dans chaque agent installé sauf Pi (pas de support MCP)', 'mcp-chrome', 'oui'],
645656 ['MCP', 'Playwright MCP, réutilisant le même Chromium', 'mcp-playwright', 'non'],
657新增: ['Éditeur', 'code-server (VS Code dans le navigateur, pour `agent-vm code`), thème sombre, GitHub Copilot désactivé', 'code-server', 'non'],
658新增: ['Éditeur', 'L\'extension Claude Code, Codex ou Mistral Vibe, chacune démarrant sans demande de permission, avec code-server', 'code-claude, code-codex, code-vibe', 'non'],
646659 ],
647660 contentsCode:
648删除: 'agent-vm setup --preinstall=default # sans question\nagent-vm setup --preinstall=default,rust # avec Rust en plus\nagent-vm setup --preinstall=python,docker,claude # Claude seul, minimal\nagent-vm setup --disk 50 --memory 16 --cpus 8 # une image plus grosse',
661新增: 'agent-vm setup --preinstall=default # sans question\nagent-vm setup --preinstall=default,rust # avec Rust en plus\nagent-vm setup --preinstall=python,docker,claude # Claude seul, minimal\nagent-vm setup --preinstall=default,code-claude # avec l\'éditeur\nagent-vm setup --disk 50 --memory 16 --cpus 8 # une image plus grosse',
649662 contentsNote:
650删除: '`codex` et `pi` entraînent `node`, tout comme `mcp-chrome` avec `chromium` et un agent. Les deux serveurs MCP sont ignorés sans `node` et `chromium`. Ce n\'est que ce que l\'image contient au départ : l\'agent est root dans la VM et a le réseau, il installe lui-même ce qui lui manque.',
663新增: '`codex` et `pi` entraînent `node`, tout comme `mcp-chrome` avec `chromium` et un agent. Les deux serveurs MCP sont ignorés sans `node` et `chromium`. Chaque extension de l\'éditeur apporte sa propre copie de son agent (200 à 600 Mo) : l\'assistant demande s\'il faut garder aussi celle en ligne de commande. Sans elle, `agent-vm claude` dit qu\'il n\'est pas installé. Ce n\'est que ce que l\'image contient au départ : l\'agent est root dans la VM et a le réseau, il installe lui-même ce qui lui manque.',
651664 dockerTitle: 'Pourquoi pas Docker',
652665 dockerLede:
653666 'Sous Linux, les conteneurs partagent le noyau de l\'hôte : une dépendance compromise qui trouve une faille dans le noyau se retrouve sur ta machine. Sous macOS, Docker Desktop fait déjà tourner une VM, ce qui réduit l\'écart, mais c\'est une seule VM partagée par tous tes conteneurs, pas une par projet. Une VM a son propre noyau, et root dans la VM a encore l\'hyperviseur entre lui et ton poste. Les différences pratiques comptent autant que celle-ci.',