Skip to content

Commit 72dc9a2

Browse files
feat: add Claude Code plugin with vz skill
Plugin structure for /plugin marketplace add gpu-cli/vz: - .claude-plugin/plugin.json — plugin manifest (v0.3.0) - .claude-plugin/marketplace.json — marketplace catalog - skills/vz/SKILL.md — skill that routes Linux commands through vz run The skill auto-triggers when a project has vz.json or the user needs Linux-specific execution. Covers vz run, vz init, vz status, vz logs, interactive mode, setup vs runtime commands, and common error patterns. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8c9ebb0 commit 72dc9a2

3 files changed

Lines changed: 123 additions & 0 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "gpu-cli",
3+
"owner": {
4+
"name": "gpu-cli"
5+
},
6+
"plugins": [
7+
{
8+
"name": "vz",
9+
"source": {
10+
"source": "github",
11+
"repo": "gpu-cli/vz"
12+
}
13+
}
14+
]
15+
}

.claude-plugin/plugin.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "vz",
3+
"description": "Run commands in instant Linux VMs on macOS via vz",
4+
"version": "0.3.0",
5+
"author": {
6+
"name": "gpu-cli"
7+
},
8+
"repository": "https://github.com/gpu-cli/vz",
9+
"license": "MIT"
10+
}

skills/vz/SKILL.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
name: vz
3+
description: >
4+
Run commands in instant Linux VMs on macOS via vz. Use when the user needs
5+
to: (1) compile or test code for Linux (cross-compile, Linux-only deps),
6+
(2) run Linux-specific tools (apt-get, systemd, docker-in-VM),
7+
(3) execute commands in an isolated Linux environment,
8+
(4) work on a project that has a vz.json file.
9+
TRIGGER when: project contains vz.json, user says "run in Linux",
10+
"test on Linux", "compile for Linux", "vz run", or needs Linux-only behavior.
11+
DO NOT TRIGGER when: commands work fine on macOS natively.
12+
---
13+
14+
# vz — Linux VM execution
15+
16+
Run commands inside a lightweight Linux VM on macOS via Apple's Virtualization.framework.
17+
The VM boots in ~3s, mounts the project directory via VirtioFS, and persists across runs.
18+
19+
## Detection
20+
21+
Check if the project has a `vz.json` in the working directory or parents. If it does,
22+
Linux commands should go through `vz run` instead of running locally.
23+
24+
## Commands
25+
26+
### Run a command
27+
28+
```bash
29+
vz run <command...>
30+
```
31+
32+
Output streams in real-time. Exit code propagates. Environment variables from
33+
`vz.json` are injected automatically (PATH, HOME, CARGO_TARGET_DIR, etc.).
34+
35+
Examples:
36+
```bash
37+
vz run cargo build
38+
vz run cargo test
39+
vz run make -j4
40+
vz run apt-get install -y libssl-dev # only works during setup, not ad-hoc
41+
vz run python3 script.py
42+
```
43+
44+
### Interactive shell
45+
46+
```bash
47+
vz run -i bash
48+
```
49+
50+
Opens a PTY-backed interactive session. Use for debugging, exploring the
51+
VM filesystem, or running interactive tools.
52+
53+
### Project setup
54+
55+
```bash
56+
vz init # generate vz.json (auto-detects Rust/Node/Python/Go)
57+
vz init --template rust # force a specific template
58+
vz init --image debian:12 # override base image
59+
```
60+
61+
### Lifecycle
62+
63+
```bash
64+
vz status # show daemon/VM state, project, mounts
65+
vz stop # stop the VM (persists disk, next run reboots)
66+
vz run --fresh # destroy VM + re-run setup from scratch
67+
vz logs # show daemon logs
68+
vz logs -f # follow daemon logs
69+
```
70+
71+
## When to use vz run vs local execution
72+
73+
Use `vz run` when:
74+
- The command needs Linux (cargo build for linux targets, apt-get, Linux syscalls)
75+
- The project has a `vz.json`
76+
- The user explicitly asks to run in Linux or in a VM
77+
78+
Use local execution when:
79+
- The command works on macOS natively (git, formatting, linting)
80+
- No `vz.json` exists and user hasn't asked for Linux
81+
82+
## Setup commands vs runtime commands
83+
84+
`vz.json` has a `setup` array — these run once on first boot and are cached by hash.
85+
Do NOT put one-off commands in setup. Instead:
86+
- **Setup**: package installs, toolchain setup (apt-get, rustup, npm install -g)
87+
- **Runtime**: build, test, run commands (cargo build, npm test)
88+
89+
If the user needs a new package installed, suggest adding it to the `setup` array
90+
in `vz.json` and running `vz run --fresh` to re-provision.
91+
92+
## Error patterns
93+
94+
- **"no vz.json found"** — suggest `vz init`
95+
- **"getcwd() failed"** — harmless kernel warning, ignore it
96+
- **Setup reruns every time** — setup command may be failing silently; check with `vz run --fresh` and watch output
97+
- **"daemon startup timed out"** — stale lock file; `vz stop` then retry
98+
- **Command not found in VM** — tool not in setup commands; add to `vz.json` setup array

0 commit comments

Comments
 (0)