| @@ -49,14 +49,15 @@ Options: |
| 49 | 49 | python, node, ruby, rust, golang, docker, chromium, |
| 50 | 50 | gh, claude, opencode, codex, vibe, pi, mcp-chrome, |
| 51 | 51 | mcp-playwright, code-server, code-claude, |
| 52 | | −删除: code-codex, code-vibe |
| 52 | +新增: code-opencode, code-codex, code-vibe |
| 53 | 53 | 'code-server' is VS Code in the browser, for |
| 54 | 54 | 'agent-vm code', with GitHub Copilot turned off. |
| 55 | | −删除: 'code-claude', 'code-codex' and 'code-vibe' add that |
| 55 | +新增: 'code-claude', 'code-opencode', 'code-codex' and 'code-vibe' add that |
| 56 | 56 | agent's extension, and code-server with it. Each |
| 57 | 57 | extension brings its own copy of the agent: 'claude', |
| 58 | 58 | 'codex' and 'vibe' are the command-line ones, for |
| 59 | | −删除: 'agent-vm claude' and the others. |
| 59 | +新增: 'agent-vm claude' and the others (OpenCode's extension |
| 60 | +新增: requires its command-line tool, which is installed with it). |
| 60 | 61 | Selecting codex or pi also installs node (npm). So does |
| 61 | 62 | mcp-chrome when chromium and an agent are selected |
| 62 | 63 | (npx). mcp-playwright does not: list node yourself. |
| @@ -81,7 +82,7 @@ Options: |
| 81 | 82 | // The software of the base, as agent-vm.setup.sh names it |
| 82 | 83 | // (AGENT_VM_INSTALL_<NAME>). |
| 83 | 84 | var software = []string{"python", "node", "ruby", "rust", "golang", "docker", "chromium", "gh", "claude", "opencode", "codex", "vibe", "pi", |
| 84 | | −删除: "code-server", "code-claude", "code-codex", "code-vibe", "mcp-chrome", "mcp-playwright"} |
| 85 | +新增: "code-server", "code-claude", "code-opencode", "code-codex", "code-vibe", "mcp-chrome", "mcp-playwright"} |
| 85 | 86 | |
| 86 | 87 | // The default set. Opt-in: Ruby, Rust, Go, Pi (released several times a |
| 87 | 88 | // week), Playwright MCP (a second browser-driving server, whose tools cost |
| @@ -108,7 +109,7 @@ func (in install) nodeNeededBy() string { |
| 108 | 109 | return "Codex CLI requires npm" |
| 109 | 110 | case in["pi"]: |
| 110 | 111 | return "Pi requires npm" |
| 111 | | −删除: case in["chromium"] && in["mcp-chrome"] && (in["claude"] || in["opencode"] || in["vibe"] || in["code-claude"] || in["code-codex"] || in["code-vibe"]): |
| 112 | +新增: case in["chromium"] && in["mcp-chrome"] && (in["claude"] || in["opencode"] || in["vibe"] || in["code-claude"] || in["code-opencode"] || in["code-codex"] || in["code-vibe"]): |
| 112 | 113 | return "Chrome DevTools MCP uses npx" |
| 113 | 114 | } |
| 114 | 115 | return "" |
| @@ -195,6 +196,9 @@ func (e *app) setupCmd(ctx context.Context, args []string) int { |
| 195 | 196 | case f == "code-claude" || f == "code-codex" || f == "code-vibe": |
| 196 | 197 | // An extension needs the editor. |
| 197 | 198 | in.set(f, "code-server") |
| 199 | +新增: case f == "code-opencode": |
| 200 | +新增: // OpenCode's extension requires both the editor and the OpenCode CLI. |
| 201 | +新增: in.set(f, "code-server", "opencode") |
| 198 | 202 | case contains(software, f): |
| 199 | 203 | in.set(f) |
| 200 | 204 | default: |
| @@ -343,7 +347,12 @@ func (e *app) askCodeExtensions(in install) { |
| 343 | 347 | return |
| 344 | 348 | } |
| 345 | 349 | var names []string |
| 346 | | −删除: for _, a := range []struct{ key, name string }{{"claude", "Claude Code"}, {"codex", "Codex"}, {"vibe", "Mistral Vibe"}} { |
| 350 | +新增: for _, a := range []struct{ key, name string }{ |
| 351 | +新增: {"claude", "Claude Code"}, |
| 352 | +新增: {"opencode", "OpenCode"}, |
| 353 | +新增: {"codex", "Codex"}, |
| 354 | +新增: {"vibe", "Mistral Vibe"}, |
| 355 | +新增: } { |
| 347 | 356 | if in[a.key] { |
| 348 | 357 | names = append(names, a.name) |
| 349 | 358 | } |
| @@ -352,11 +361,15 @@ func (e *app) askCodeExtensions(in install) { |
| 352 | 361 | return |
| 353 | 362 | } |
| 354 | 363 | fmt.Fprintf(e.io.Stderr, " %s in the editor:\n", strings.Join(names, ", ")) |
| 355 | | −删除: choice := e.ui.AskChoice("Pick one", 1, "Extension and command line (agent-vm claude...)", "Extension only", "Command line only") |
| 364 | +新增: promptExtOnly := "Extension only" |
| 365 | +新增: if in["opencode"] { |
| 366 | +新增: promptExtOnly = "Extension only (OpenCode keeps the CLI, required by its extension)" |
| 367 | +新增: } |
| 368 | +新增: choice := e.ui.AskChoice("Pick one", 1, "Extension and command line (agent-vm claude...)", promptExtOnly, "Command line only") |
| 356 | 369 | if choice == 3 { |
| 357 | 370 | return |
| 358 | 371 | } |
| 359 | | −删除: in["code-claude"], in["code-codex"], in["code-vibe"] = in["claude"], in["codex"], in["vibe"] |
| 372 | +新增: in["code-claude"], in["code-opencode"], in["code-codex"], in["code-vibe"] = in["claude"], in["opencode"], in["codex"], in["vibe"] |
| 360 | 373 | if choice == 2 { |
| 361 | 374 | in["claude"], in["codex"], in["vibe"] = false, false, false |
| 362 | 375 | } |