Merge pull request #16 from benoitvx/feat/mistral-vibe
feat: add native support for Mistral Vibe
- 作者
- Sylvain Zimmer
- 时间
- 2026/06/30 01:28
- 提交
- 9ed321b
这是一个合并提交,下面是和第一个上一提交相比的改动。
feat: add native support for Mistral Vibe
这是一个合并提交,下面是和第一个上一提交相比的改动。
| @@ -4,7 +4,7 @@ Run AI coding agents inside sandboxed Linux VMs. The agent gets full autonomy wh | ||
| 4 | 4 | |
| 5 | 5 | Uses [Lima](https://lima-vm.io/) to create lightweight Debian VMs on macOS and Linux. Ships with dev tools, Docker, and a headless Chrome browser with [Chrome DevTools MCP](https://github.com/ChromeDevTools/chrome-devtools-mcp) pre-configured. |
| 6 | 6 | |
| 7 | 删除:Supports [Claude Code](https://claude.ai/code), [OpenCode](https://github.com/anomalyco/opencode), and [Codex CLI](https://github.com/openai/codex) out of the box. Other agents can be run via `agent-vm shell`. | |
| 7 | 新增:Supports [Claude Code](https://claude.ai/code), [OpenCode](https://github.com/anomalyco/opencode), [Codex CLI](https://github.com/openai/codex), and [Mistral Vibe](https://docs.mistral.ai/vibe/code/cli/install-setup) out of the box. Other agents can be run via `agent-vm shell`. | |
| 8 | 8 | |
| 9 | 9 | Never install attack vectors such as npm, claude or even Docker on your host machine again! |
| 10 | 10 | |
| @@ -56,6 +56,7 @@ cd your-project | ||
| 56 | 56 | agent-vm claude # Claude Code |
| 57 | 57 | agent-vm opencode # OpenCode |
| 58 | 58 | agent-vm codex # Codex CLI |
| 59 | 新增:agent-vm vibe # Mistral Vibe | |
| 59 | 60 | ``` |
| 60 | 61 | |
| 61 | 62 | Creates a persistent VM for the current directory (or reuses it if one already exists), mounts your working directory, and runs the agent with full permissions. The VM persists after the agent exits so you can reconnect later. Ports opened inside the VM (e.g. by Docker containers or dev servers) are automatically forwarded to your host by Lima. |
| @@ -64,6 +65,7 @@ Each agent runs with its respective auto-approve flag: | ||
| 64 | 65 | - `claude` runs with `--dangerously-skip-permissions` |
| 65 | 66 | - `opencode` does not yet have an auto-approve flag (waiting on [this PR](https://github.com/anomalyco/opencode/pull/11833)) |
| 66 | 67 | - `codex` runs with `--dangerously-bypass-approvals-and-sandbox` |
| 68 | 新增:- `vibe` runs with `--agent auto-approve` | |
| 67 | 69 | |
| 68 | 70 | Any extra arguments are forwarded to the agent command: |
| 69 | 71 | |
| @@ -72,6 +74,7 @@ agent-vm claude -p "fix all lint errors" # Run with a prompt | ||
| 72 | 74 | agent-vm claude --resume # Resume previous session |
| 73 | 75 | agent-vm opencode -p "refactor auth module" # OpenCode with a prompt |
| 74 | 76 | agent-vm codex -q "explain this codebase" # Codex with a query |
| 77 | 新增:agent-vm vibe -p "fix all lint errors" # Mistral Vibe with a prompt | |
| 75 | 78 | ``` |
| 76 | 79 | |
| 77 | 80 | ### Shell access and running commands |
| @@ -85,6 +85,14 @@ echo 'export PATH=$HOME/.local/bin:$HOME/.claude/local/bin:$HOME/.opencode/bin:$ | ||
| 85 | 85 | echo "Installing Codex CLI..." |
| 86 | 86 | sudo npm i -g @openai/codex |
| 87 | 87 | |
| 88 | 新增:# Install Mistral Vibe (installs uv and the `vibe`/`vibe-acp` commands into ~/.local/bin). | |
| 89 | 新增:# This setup script runs under bash, but the PATH export lives in ~/.zshrc/~/.zshenv, so | |
| 90 | 新增:# ~/.local/bin isn't on PATH here yet. The Vibe installer exits non-zero (aborting setup | |
| 91 | 新增:# under `set -e`) if it can't find its install dir on PATH, so export it for this session. | |
| 92 | 新增:echo "Installing Mistral Vibe..." | |
| 93 | 新增:export PATH="$HOME/.local/bin:$PATH" | |
| 94 | 新增:curl -LsSf https://mistral.ai/vibe/install.sh | bash | |
| 95 | 新增: | |
| 88 | 96 | # Configure Chrome DevTools MCP server for Claude |
| 89 | 97 | echo "Configuring Chrome MCP server for Claude..." |
| 90 | 98 | CONFIG="$HOME/.claude.json" |
| @@ -132,4 +140,22 @@ else | ||
| 132 | 140 | JSON |
| 133 | 141 | fi |
| 134 | 142 | |
| 143 | 新增:# Configure Chrome DevTools MCP server for Vibe | |
| 144 | 新增:# Vibe uses TOML; append an array-of-tables entry (valid even if the wizard later | |
| 145 | 新增:# writes to the same file). Guard against duplicates on repeated setup runs. | |
| 146 | 新增:echo "Configuring Chrome MCP server for Vibe..." | |
| 147 | 新增:VIBE_CONFIG_DIR="$HOME/.vibe" | |
| 148 | 新增:mkdir -p "$VIBE_CONFIG_DIR" | |
| 149 | 新增:VIBE_CONFIG="$VIBE_CONFIG_DIR/config.toml" | |
| 150 | 新增:if ! grep -q 'name = "chrome-devtools"' "$VIBE_CONFIG" 2>/dev/null; then | |
| 151 | 新增: cat >> "$VIBE_CONFIG" << 'TOML' | |
| 152 | 新增: | |
| 153 | 新增:[[mcp_servers]] | |
| 154 | 新增:name = "chrome-devtools" | |
| 155 | 新增:transport = "stdio" | |
| 156 | 新增:command = "npx" | |
| 157 | 新增:args = ["-y", "chrome-devtools-mcp@latest", "--headless=true", "--isolated=true"] | |
| 158 | 新增:TOML | |
| 159 | 新增:fi | |
| 160 | 新增: | |
| 135 | 161 | echo "VM setup complete." |
| @@ -11,6 +11,7 @@ | ||
| 11 | 11 | # agent-vm claude - Run Claude Code in a persistent VM for cwd |
| 12 | 12 | # agent-vm opencode - Run OpenCode in a persistent VM for cwd |
| 13 | 13 | # agent-vm codex - Run Codex CLI in a persistent VM for cwd |
| 14 | 新增:# agent-vm vibe - Run Mistral Vibe in a persistent VM for cwd | |
| 14 | 15 | # agent-vm shell - Open a shell in the persistent VM for cwd |
| 15 | 16 | # agent-vm stop - Stop the VM for cwd |
| 16 | 17 | # agent-vm rm - Stop and delete the VM for cwd |
| @@ -305,6 +306,9 @@ agent-vm() { | ||
| 305 | 306 | codex) |
| 306 | 307 | _agent_vm_codex "${vm_opts[@]}" "$@" |
| 307 | 308 | ;; |
| 309 | 新增: vibe) | |
| 310 | 新增: _agent_vm_vibe "${vm_opts[@]}" "$@" | |
| 311 | 新增: ;; | |
| 308 | 312 | shell) |
| 309 | 313 | _agent_vm_shell "${vm_opts[@]}" "$@" |
| 310 | 314 | ;; |
| @@ -346,6 +350,7 @@ Commands: | ||
| 346 | 350 | claude [args] Run Claude Code in the VM for the current directory |
| 347 | 351 | opencode [args] Run OpenCode in the VM for the current directory |
| 348 | 352 | codex [args] Run Codex CLI in the VM for the current directory |
| 353 | 新增: vibe [args] Run Mistral Vibe in the VM for the current directory | |
| 349 | 354 | shell Open a shell in the VM for the current directory |
| 350 | 355 | run <cmd> [args] Run a command in the VM for the current directory |
| 351 | 356 | stop Stop the VM for the current directory |
| @@ -355,7 +360,7 @@ Commands: | ||
| 355 | 360 | status Show status of all VMs (current dir marked with >) |
| 356 | 361 | help Show this help |
| 357 | 362 | |
| 358 | 删除:VM options (for claude, opencode, codex, shell, run): | |
| 363 | 新增:VM options (for claude, opencode, codex, vibe, shell, run): | |
| 359 | 364 | --disk GB VM disk size (default: 10) |
| 360 | 365 | --memory GB VM memory (default: 3) |
| 361 | 366 | --cpus N Number of CPUs (default: 1) |
| @@ -370,6 +375,7 @@ Examples: | ||
| 370 | 375 | agent-vm claude # Run Claude in a VM |
| 371 | 376 | agent-vm opencode # Run OpenCode in a VM |
| 372 | 377 | agent-vm codex # Run Codex in a VM |
| 378 | 新增: agent-vm vibe # Run Mistral Vibe in a VM | |
| 373 | 379 | agent-vm --disk 50 --memory 16 --cpus 8 claude # Custom resources |
| 374 | 380 | agent-vm --reset claude # Fresh VM from base template |
| 375 | 381 | agent-vm --rm claude # Destroy VM after Claude exits |
| @@ -491,7 +497,7 @@ _agent_vm_setup() { | ||
| 491 | 497 | date +%s > "$AGENT_VM_STATE_DIR/.agent-vm-base-version" |
| 492 | 498 | |
| 493 | 499 | echo "" |
| 494 | 删除: echo "Base VM ready. Run 'agent-vm shell', 'agent-vm claude', 'agent-vm opencode', or 'agent-vm codex' in any project directory." | |
| 500 | 新增: echo "Base VM ready. Run 'agent-vm shell', 'agent-vm claude', 'agent-vm opencode', 'agent-vm codex', or 'agent-vm vibe' in any project directory." | |
| 495 | 501 | echo "Note: Existing VMs were not updated. Use --reset to re-clone them from the new base." |
| 496 | 502 | } |
| 497 | 503 | |
| @@ -593,6 +599,40 @@ _agent_vm_codex() { | ||
| 593 | 599 | return $exit_code |
| 594 | 600 | } |
| 595 | 601 | |
| 602 | 新增:_agent_vm_vibe() { | |
| 603 | 新增: local vm_opts=() | |
| 604 | 新增: local args=() | |
| 605 | 新增: local rm="" | |
| 606 | 新增: while [[ $# -gt 0 ]]; do | |
| 607 | 新增: case "$1" in | |
| 608 | 新增: --disk) vm_opts+=(--disk "$2"); shift 2 ;; | |
| 609 | 新增: --memory|--ram) vm_opts+=(--memory "$2"); shift 2 ;; | |
| 610 | 新增: --cpus) vm_opts+=(--cpus "$2"); shift 2 ;; | |
| 611 | 新增: --reset) vm_opts+=(--reset); shift ;; | |
| 612 | 新增: --offline) vm_opts+=(--offline); shift ;; | |
| 613 | 新增: --readonly) vm_opts+=(--readonly); shift ;; | |
| 614 | 新增: --git-read-only|--git-ro) vm_opts+=(--git-read-only); shift ;; | |
| 615 | 新增: --rm) rm=1; shift ;; | |
| 616 | 新增: *) args+=("$1"); shift ;; | |
| 617 | 新增: esac | |
| 618 | 新增: done | |
| 619 | 新增: local host_dir | |
| 620 | 新增: host_dir="$(pwd)" | |
| 621 | 新增: local vm_name | |
| 622 | 新增: vm_name="$(_agent_vm_name "$host_dir")" | |
| 623 | 新增: | |
| 624 | 新增: _agent_vm_ensure_running "$vm_name" "$host_dir" "${vm_opts[@]}" || return 1 | |
| 625 | 新增: _agent_vm_print_resources "$vm_name" | |
| 626 | 新增: | |
| 627 | 新增: # Vibe is a full-screen TUI, so allocate a tty (like opencode). | |
| 628 | 新增: # --agent auto-approve gives full autonomy (safe inside the sandbox). | |
| 629 | 新增: local exit_code=0 | |
| 630 | 新增: limactl shell --tty --workdir "$host_dir" "$vm_name" vibe --agent auto-approve "${args[@]}" | |
| 631 | 新增: exit_code=$? | |
| 632 | 新增: [[ -n "$rm" ]] && { echo "Removing VM..."; _agent_vm_destroy; } | |
| 633 | 新增: return $exit_code | |
| 634 | 新增:} | |
| 635 | 新增: | |
| 596 | 636 | _agent_vm_shell() { |
| 597 | 637 | local vm_opts=() |
| 598 | 638 | local rm="" |