| @@ -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 |
| @@ -255,6 +256,9 @@ agent-vm() { |
| 255 | 256 | codex) |
| 256 | 257 | _agent_vm_codex "${vm_opts[@]}" "$@" |
| 257 | 258 | ;; |
| 259 | +新增: vibe) |
| 260 | +新增: _agent_vm_vibe "${vm_opts[@]}" "$@" |
| 261 | +新增: ;; |
| 258 | 262 | shell) |
| 259 | 263 | _agent_vm_shell "${vm_opts[@]}" "$@" |
| 260 | 264 | ;; |
| @@ -296,6 +300,7 @@ Commands: |
| 296 | 300 | claude [args] Run Claude Code in the VM for the current directory |
| 297 | 301 | opencode [args] Run OpenCode in the VM for the current directory |
| 298 | 302 | codex [args] Run Codex CLI in the VM for the current directory |
| 303 | +新增: vibe [args] Run Mistral Vibe in the VM for the current directory |
| 299 | 304 | shell Open a shell in the VM for the current directory |
| 300 | 305 | run <cmd> [args] Run a command in the VM for the current directory |
| 301 | 306 | stop Stop the VM for the current directory |
| @@ -305,7 +310,7 @@ Commands: |
| 305 | 310 | status Show status of all VMs (current dir marked with >) |
| 306 | 311 | help Show this help |
| 307 | 312 | |
| 308 | | −删除:VM options (for claude, opencode, codex, shell, run): |
| 313 | +新增:VM options (for claude, opencode, codex, vibe, shell, run): |
| 309 | 314 | --disk GB VM disk size (default: 10) |
| 310 | 315 | --memory GB VM memory (default: 2) |
| 311 | 316 | --cpus N Number of CPUs (default: 1) |
| @@ -320,6 +325,7 @@ Examples: |
| 320 | 325 | agent-vm claude # Run Claude in a VM |
| 321 | 326 | agent-vm opencode # Run OpenCode in a VM |
| 322 | 327 | agent-vm codex # Run Codex in a VM |
| 328 | +新增: agent-vm vibe # Run Mistral Vibe in a VM |
| 323 | 329 | agent-vm --disk 50 --memory 16 --cpus 8 claude # Custom resources |
| 324 | 330 | agent-vm --reset claude # Fresh VM from base template |
| 325 | 331 | agent-vm --rm claude # Destroy VM after Claude exits |
| @@ -441,7 +447,7 @@ _agent_vm_setup() { |
| 441 | 447 | date +%s > "$AGENT_VM_STATE_DIR/.agent-vm-base-version" |
| 442 | 448 | |
| 443 | 449 | echo "" |
| 444 | | −删除: echo "Base VM ready. Run 'agent-vm shell', 'agent-vm claude', 'agent-vm opencode', or 'agent-vm codex' in any project directory." |
| 450 | +新增: 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." |
| 445 | 451 | echo "Note: Existing VMs were not updated. Use --reset to re-clone them from the new base." |
| 446 | 452 | } |
| 447 | 453 | |
| @@ -543,6 +549,40 @@ _agent_vm_codex() { |
| 543 | 549 | return $exit_code |
| 544 | 550 | } |
| 545 | 551 | |
| 552 | +新增:_agent_vm_vibe() { |
| 553 | +新增: local vm_opts=() |
| 554 | +新增: local args=() |
| 555 | +新增: local rm="" |
| 556 | +新增: while [[ $# -gt 0 ]]; do |
| 557 | +新增: case "$1" in |
| 558 | +新增: --disk) vm_opts+=(--disk "$2"); shift 2 ;; |
| 559 | +新增: --memory|--ram) vm_opts+=(--memory "$2"); shift 2 ;; |
| 560 | +新增: --cpus) vm_opts+=(--cpus "$2"); shift 2 ;; |
| 561 | +新增: --reset) vm_opts+=(--reset); shift ;; |
| 562 | +新增: --offline) vm_opts+=(--offline); shift ;; |
| 563 | +新增: --readonly) vm_opts+=(--readonly); shift ;; |
| 564 | +新增: --git-read-only|--git-ro) vm_opts+=(--git-read-only); shift ;; |
| 565 | +新增: --rm) rm=1; shift ;; |
| 566 | +新增: *) args+=("$1"); shift ;; |
| 567 | +新增: esac |
| 568 | +新增: done |
| 569 | +新增: local host_dir |
| 570 | +新增: host_dir="$(pwd)" |
| 571 | +新增: local vm_name |
| 572 | +新增: vm_name="$(_agent_vm_name "$host_dir")" |
| 573 | +新增: |
| 574 | +新增: _agent_vm_ensure_running "$vm_name" "$host_dir" "${vm_opts[@]}" || return 1 |
| 575 | +新增: _agent_vm_print_resources "$vm_name" |
| 576 | +新增: |
| 577 | +新增: # Vibe is a full-screen TUI, so allocate a tty (like opencode). |
| 578 | +新增: # --agent auto-approve gives full autonomy (safe inside the sandbox). |
| 579 | +新增: local exit_code=0 |
| 580 | +新增: limactl shell --tty --workdir "$host_dir" "$vm_name" vibe --agent auto-approve "${args[@]}" |
| 581 | +新增: exit_code=$? |
| 582 | +新增: [[ -n "$rm" ]] && { echo "Removing VM..."; _agent_vm_destroy; } |
| 583 | +新增: return $exit_code |
| 584 | +新增:} |
| 585 | +新增: |
| 546 | 586 | _agent_vm_shell() { |
| 547 | 587 | local vm_opts=() |
| 548 | 588 | local rm="" |