Yet another Zig version manager (but it is context aware)

zvm: a Zig version manager written in Zig

zvm is a single native binary with no runtime dependencies that makes zig (and zls) resolve to the right version for whatever directory you’re in.

zvm demo

It picks a version in this order:

  1. ZIG_VERSION env var
  2. .zig-version in the current or any parent directory (exact version, master, or a semver range like ^0.17.0)
  3. minimum_zig_version from build.zig.zon
  4. your global default (zvm use)

The parent search stops at the nearest .git, so a pin in an outer repo doesn’t leak into a nested checkout.

Other things it does:

  • Installs stable releases and master, verifying the SHA-256 checksum and the Minisign signature
  • Optional auto-install of a project’s required version the first time you run zig
  • Installs a matching ZLS (zvm install 0.17.0 --with-zls)
  • Linux, macOS and Windows, with completions for bash, zsh, fish and PowerShell

Quick start:

curl -fsSL https://raw.githubusercontent.com/Judeadeniji/zvm/main/install.sh | sh
zvm setup
zvm doctor

Built with Zig 0.17.0. I used an AI coding assistant for part of this (edge-case audits, unifying exit codes, the install lock), and everything was reviewed and tested by me.

I’d especially like feedback from people on macOS, Windows, or with multi-repo setups. Run zvm doctor and tell me what works or breaks. Issues and PRs are welcome on GitHub.

FYI zvm.

1 Like

Thanks for the heads up, I’m aware of the other zvm and it’s a great project. Mine is a separate take that I built around my own workflow, so it’s quite different and currently lacks some of its features. I didn’t look at its source or at other version managers while building this, so nothing was copied.

Thanks for the interest!

I think the point of the link to the other zvm was, the name had already been used. FWIW.