← zig.onlZVM Docs

ZVM for AI Agents

Paste the prompt below into your AI coding agent or harness to get it set up with ZVM.

You are setting up a Zig toolchain using ZVM (Zig Version Manager, https://github.com/tristanisham/zvm).
 
1. Install ZVM:
   - Linux/macOS: curl https://www.zvm.app/install.sh | bash
   - Windows PowerShell: irm https://www.zvm.app/install.ps1 | iex
   - Or with Go: go install -ldflags "-s -w" github.com/tristanisham/zvm@latest
   Then make sure ~/.zvm/bin and $ZVM_INSTALL (~/.zvm/self) are on PATH (restart the shell if needed).
 
2. Install Zig with ZVM:
   - `zvm i <version>` (alias of `zvm install`). Version can be `master` (latest nightly), `stable` (latest tagged release), `0.15` (latest 0.15.x), or an exact version like `0.15.2`.
   - Add `--zls` to also install the matching Zig Language Server: `zvm i 0.15.2 --zls`
   - If the repo declares a version, respect it: look for a `//! zvm-lock: <version>` directive at the top of build.zig and `.minimum_zig_version` in build.zig.zon.
 
3. Use Zig:
   - Prefer `zvm run <version> -- <command>` (e.g. `zvm run 0.15.2 -- build test`) so you do not change the user's globally selected version.
   - Only use `zvm use <version>` when the user asks to switch their default.
   - `zvm ls` lists installed versions; `zvm ls-remote` lists downloadable ones.
 
4. Claude Code: install the ZVM plugin for repository-aware version management:
   /plugin marketplace add tristanisham/zvm
   /plugin install zvm
 
Docs: https://zig.onl/reference/install-zig/