提交记录修改README.md+1 −1看文件
修改agent-vm.sh+18 −12看文件
| @@ -87,7 +87,7 @@ agent-vm run docker compose up -d # Start services | ||
| 87 | 87 | Each directory gets its own persistent VM. You can manage it with: |
| 88 | 88 | |
| 89 | 89 | ```bash |
| 90 | 删除:agent-vm status # Show VM status for the current directory | |
| 90 | 新增:agent-vm status # Show status of all VMs (current dir marked with >) | |
| 91 | 91 | agent-vm stop # Stop the VM (can be restarted later) |
| 92 | 92 | agent-vm destroy # Stop and permanently delete the VM |
| 93 | 93 | agent-vm destroy-all # Stop and delete all agent-vm VMs |
| @@ -15,7 +15,7 @@ | ||
| 15 | 15 | # agent-vm stop - Stop the VM for cwd |
| 16 | 16 | # agent-vm destroy - Stop and delete the VM for cwd |
| 17 | 17 | # agent-vm list - List all agent-vm VMs |
| 18 | 删除:# agent-vm status - Show VM status for cwd | |
| 18 | 新增:# agent-vm status - Show status of all VMs (current dir marked with >) | |
| 19 | 19 | # agent-vm help - Show help |
| 20 | 20 | # |
| 21 | 21 | |
| @@ -250,7 +250,7 @@ Commands: | ||
| 250 | 250 | destroy Stop and delete the VM for the current directory |
| 251 | 251 | destroy-all Stop and delete all agent-vm VMs |
| 252 | 252 | list List all agent-vm VMs |
| 253 | 删除: status Show VM status for the current directory | |
| 253 | 新增: status Show status of all VMs (current dir marked with >) | |
| 254 | 254 | help Show this help |
| 255 | 255 | |
| 256 | 256 | VM options (for claude, opencode, codex, shell, run): |
| @@ -580,16 +580,22 @@ _agent_vm_list() { | ||
| 580 | 580 | _agent_vm_status() { |
| 581 | 581 | local host_dir |
| 582 | 582 | host_dir="$(pwd)" |
| 583 | 删除: local vm_name | |
| 584 | 删除: vm_name="$(_agent_vm_name "$host_dir")" | |
| 583 | 新增: local current_vm_name | |
| 584 | 新增: current_vm_name="$(_agent_vm_name "$host_dir")" | |
| 585 | 585 | |
| 586 | 删除: if ! _agent_vm_exists "$vm_name"; then | |
| 587 | 删除: echo "No VM for this directory." | |
| 588 | 删除: echo "VM name: $vm_name" | |
| 589 | 删除: return 0 | |
| 590 | 删除: fi | |
| 586 | 新增: local header | |
| 587 | 新增: header=$(limactl list | head -1) | |
| 591 | 588 | |
| 592 | 删除: echo "VM name: $vm_name" | |
| 593 | 删除: limactl list | head -1 | |
| 594 | 删除: limactl list | grep "$vm_name" | |
| 589 | 新增: echo "VMs (current directory: $host_dir):" | |
| 590 | 新增: echo "" | |
| 591 | 新增: echo "$header" | sed 's/^/ /' | |
| 592 | 新增: limactl list | grep "^agent-vm-" | while read -r line; do | |
| 593 | 新增: local vm_name | |
| 594 | 新增: vm_name=$(echo "$line" | awk '{print $1}') | |
| 595 | 新增: if [[ "$vm_name" == "$current_vm_name" ]]; then | |
| 596 | 新增: echo "$line" | sed 's/^/> /' | |
| 597 | 新增: else | |
| 598 | 新增: echo "$line" | sed 's/^/ /' | |
| 599 | 新增: fi | |
| 600 | 新增: done || echo " (no VMs)" | |
| 595 | 601 | } |

