Skip to content
Development
Skill

/zig-versions

Use when managing Zig and ZLS toolchains with zvm, resolving a Zig version mismatch, or configuring ZVM and its disk usage.

From plugin
zvm
1.1k1 skill

Claude Code

$ npx -y skills add tristanisham/zvm --skill zig-versions --agent claude-code

SKILL.md

zig-versions.SKILL.md
name: zig-versions
description: Use when managing Zig and ZLS toolchains with zvm, resolving a Zig version mismatch, or configuring ZVM and its disk usage.

Managing Zig toolchains with zvm

`zvm` installs and switches Zig compilers. Installs and settings live under `~/.zvm` (override with `ZVM_PATH`), and `~/.zvm/bin` points at the global default. `zvm env` can give a shell its own version link outside that directory.

Prefer `zvm` over `apt`, `brew`, `pacman`, or hand-unpacking a tarball from ziglang.org. Distro packages lag Zig releases badly and cannot hold two versions side by side, which is the entire problem this repository's users have.

The full command and flag list is in [reference/commands.md](reference/commands.md). Read it before using a flag you are not certain exists; check the installed binary's help when its version differs from this checkout.

Is zvm installed?

Probe first:

command -v zvm

If it is missing, **show the user the install command and ask** — do not run it yourself. The installer appends to shell profiles and modifies `PATH`, which is not a change to make on someone's behalf unprompted.

curl https://www.zvm.app/install.sh | bash   # Linux, macOS, BSD
irm "https://www.zvm.app/install.ps1" | iex  # Windows PowerShell

If the user declines, fall back to whatever the project already uses. Do not install Zig through a second package manager alongside an existing `zvm`.

Running a specific version: prefer `run` over `use`

zvm run 0.14.0 build test

`zvm run` is scoped to the single command. In a shell initialized with `zvm env`, `zvm use 0.14.0` changes only that shell's link. Otherwise it changes the global `~/.zvm/bin` link. `zvm use --global 0.14.0` changes the default even in a per-shell session; existing per-shell links keep their own versions.

**Use `zvm run` by default. Only run `zvm use` when the user asked to switch their active version.**

`zvm run` does not parse flags after the version, so pass the Zig arguments directly. Do not insert a `--` separator — it is forwarded to Zig as a literal argument and Zig will reject it.

zvm run 0.14.0 build test      # correct
zvm run 0.14.0 -- build test   # wrong, "--" reaches zig

If the version given to `zvm run` is not a known Zig version, zvm falls back to `.minimum_zig_version` from `build.zig.zon` in the current directory.

Per-shell versions

`zvm env --shell bash` prints shell code; it does not change the calling shell by itself. Use the shell the user is actually running. Add `--use-on-cd` when they want automatic switching from the nearest `build.zig` pin or `build.zig.zon` minimum version. The hook only switches to installed versions and never installs a missing one.

`ZVM_MULTISHELL_PATH` identifies the current shell's link. An override in `ZVM_MULTISHELL_DIR` must be absolute and outside the ZVM base directory. Do not edit shell startup files unless setting up shell integration is part of the request.

Picking the right version for a repository

Check these, in order, before choosing a version:

1. **`//! zvm-lock: <version>` in `build.zig`** — zvm's own pin. Apply it with `zvm use --sync`, which reads that comment and switches to it. Note this is `build.zig`, *not* `build.zig.zon`. 2. **`.minimum_zig_version` in `build.zig.zon`** — a floor, not a pin. It says what the project needs at minimum, not what it was tested against. 3. **CI configuration** — usually the most honest signal of the version the project actually builds with.

Only fall back to `master` or `stable` when none of these exist.

How zvm resolves version strings

  • `0.15` resolves to the highest installed or available `0.15.x` patch.
  • `.12` normalizes to `0.12`, then resolves as above.
  • `stable` resolves to the highest non-dev, non-master release.
  • `master` is the current development build and passes through unresolved.
  • Aliases created with `zvm alias <name> <version>` also resolve.

Partial versions are safe to pass; you do not need to expand them yourself.

Reading zvm output

`zvm ls-remote --json` is the machine-readable path. Use it whenever you need to select a version programmatically.

`zvm ls` prints a decorated table intended for humans. Read it, but do not build parsing logic on it. Color is stripped automatically when stdout is not a TTY, so piped output is already clean — do **not** pass `--color=false` to achieve that, because it prints an extra `Terminal color output: OFF` line that breaks naive matching.

Non-interactive contexts

`zvm install` prompts for confirmation when a release has no published SHA-256 checksum, and `zvm use`/`zvm run` prompt before installing a version that is missing locally. With no stdin attached these prompts read EOF and are treated as "no", so the command declines safely rather than hanging.

If you need a version present without a prompt, install it explicitly first:

zvm install 0.14.0

Configuration

Use non-interactive settings commands in agent workflows:

zvm settings .                       # all effective settings as JSON
zvm settings .useColor               # one JSON value
zvm settings -r .mirrorListUrl        # a raw string
zvm settings .alwaysInstallZLS true   # validate and persist one value
zvm settings --check                 # exit 1 for invalid file entries

The command accepts flat jq-style keys, including quoted forms; it does not implement arbitrary jq expressions or nested paths. No arguments opens an editor in a terminal and prints JSON otherwise; Plan 9 always uses JSON output.

Existing commands such as `zvm mirrorlist`, `zvm vmu`, and the global `--color` flag still work. Keep using them when they fit the task. `--color` persists the same `useColor` setting and prints a status line; it is not a flag for cleaning up machine-readable output.

Invalid entries use defaults without rewriting the user's file. Saving settings replaces invalid entries with effective valu

Read more
@tristanisham
Ships withzvm

ZVM lives entirely in $HOME/.zvm on all platforms it supports. Inside of the directory, ZVM will download new Zig versions and symlink whichever version you specify with zvm use to $HOME/.zvm/bin. You should add this folder to your path.

Stars on GitHub

Momentum

stars in total
1.1k
Star history of tristanisham/zvm on GitHub, a chart by star-history.com

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills3w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc3w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react12d252k
@facebook@facebookInstall Skill

Questions about zig-versions.

Which coding agents can use zig-versions?
zig-versions installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.