Skip to content
voyceyPublic

About

Run, test & validate the code on multiple worktrees concurrently - an ephemeral deployment for each of them!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

vmoat

Claude Code plugin POSIX sh platforms runtime: Colima License: MIT version

A moat around every git worktree.

vmoat gives each git worktree its own short-lived Colima VM. You can build and test several worktrees of one project in parallel, each with its own Linux kernel and Docker daemon. A docker system prune, an out-of-memory crash or a broken stack in one worktree can't affect another worktree or your host.

Inside the VM you run your project's normal commands (./deploy.sh local, make up, docker compose up) on the default ports, so existing tests pass unmodified. vmoat is a POSIX-sh CLI and a Claude Code plugin, so an agent can bring up and test a worktree on its own.

A moat around every worktree

Why vmoat

  • Isolation: a separate kernel and Docker daemon per worktree.
  • Stock commands and ports: your tests run unmodified.
  • Fast new VMs: clone a saved base image in about 15 s instead of a 10-20 min first build (macOS). See Base images.
  • Memory returns to macOS: opt-in and experimental. See Memory.
  • Agent-ready: a Claude Code plugin drives bring-up, tests and browser checks.

Requirements

  • macOS (Apple Silicon recommended), Linux, or Windows with WSL2 (nested virtualization on).
  • colima and a docker CLI.
  • Enough RAM for the stacks you run at once. See Memory.

Install

Homebrew (installs vmoat and Colima; you still need a docker CLI):

brew install voycey/vmoat/vmoat

From source:

git clone https://github.com/voycey/vmoat ~/.vmoat
ln -s ~/.vmoat/bin/vmoat /usr/local/bin/vmoat   # or ~/.local/bin

Linux: install Colima yourself (brew install colima docker works).

WSL2: install Colima inside the distro and keep worktrees on the Linux filesystem (not /mnt/c). Enable nested virtualization in %UserProfile%\.wslconfig:

[wsl2]
nestedVirtualization=true

Claude Code plugin:

/plugin marketplace add voycey/vmoat
/plugin install vmoat@vmoat

More in Claude Code plugin.

Quickstart

From any worktree (a standard project needs no config):

vmoat up            # create the VM and start the stack
vmoat tunnel        # forward the stack's ports to the host (prints each URL)
vmoat test --quick  # run CMD_TEST --quick inside the VM
vmoat status        # VM status, containers, health, tunnels
vmoat down          # stop the VM (keeps disk)
vmoat destroy       # delete the VM

With the plugin installed, you can instead ask Claude to "verify this worktree end-to-end".

Configuration

Config is optional. vmoat detects your start command (compose file, Makefile up: target, or package.json dev script) and the ports to tunnel. To customize, add a vmoat.conf (or run vmoat init):

CMD_UP="docker compose up -d --wait"
CMD_TEST="docker compose exec -T app pytest"
VM_MEMORY=8
HEALTH_URL="http://127.0.0.1:8080/health"
EXPOSE_PORTS=(8080)

See Configuration for every key and per-worktree overrides.

Documentation

License

MIT © Dan Voyce

About

Run, test & validate the code on multiple worktrees concurrently - an ephemeral deployment for each of them!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages