Skip to content

Run the Zig your project expects

ZVM installs any Zig release or nightly, switches between them per shell, and picks the right one when you enter a project. It's one static binary for Linux, macOS, Windows, BSD, and Plan 9.

curl https://www.zvm.app/install.sh | bash
Read the script before you run it

This command runs on your computer.

zvm i master --zls
zvm use 0.15.2
zig version
0.15.2
# build.zig pins 0.14.1
cd ~/old-game
zig version
0.14.1

Install any Zig

Install a tagged release, the latest nightly with master, or the newest stable release with stable. Shorthand like .15 resolves to the highest 0.15.x, and full development build identifiers work too.

Add --zls and ZVM installs a matching Zig Language Server alongside it. Official archives are checked against Zig's Minisign key, and a failed download moves on to the next community mirror.

Installing Zig
zvm i master --zls
Latest nightly, plus ZLS
zvm i --skip-use 0.15.2
Install without switching to it
zvm vmu zig mach
Pull future installs from Mach's version map

Switch in one command

zvm use changes which installed Zig runs when you type zig. Ask for a version you don't have and it offers to install it first.

Inside a project, zvm use with no version reads .minimum_zig_version from build.zig.zon. To try a version once without switching, use zvm run.

Switching versions
zvm use stable
Highest installed stable release
zvm use local
A Zig you built and linked as local
zvm run 0.14.1 build
One command with 0.14.1

One version per shell

Add one line to your shell's startup file and every terminal keeps its own Zig. New shells start on the global default, and zvm use changes only the shell you're in.

With --use-on-cd, entering a project switches to the version it declares, either a //! zvm-lock: line in build.zig or .minimum_zig_version in build.zig.zon. If that version isn't installed, ZVM tells you how to install it rather than downloading anything.

Setting up per-shell versions
eval "$(zvm env --shell bash --use-on-cd)"
Bash; Zsh, Fish, and PowerShell work too
zvm use --global 0.15.2
Change the default for new shells

Use less disk

Zig releases share much of their standard library. zvm dedupe hard-links identical files into one store, so each is kept once. In this recording, ten installed versions drop from 3.1 GiB to 2.2 GiB.

Files are shared only when their content, permissions, and owner match. It's safe to repeat or interrupt, and removing a version cleans up store files nothing else uses.

Deduplicating versions
zvm dedupe --auto on
Deduplicate every future install
zvm dedupe .15
Only the 0.15.x installs

Zig is still pre-1.0. The standard library is under heavy development and the roadmap is long, so releases regularly break existing builds, change valid syntax, and add features like the package manager. That’s great for the language, but it means you often need several versions installed to build different projects.

Staying on the master branch means downloading Zig often. You could find the right archive for your platform, unpack it, and put it on your $PATH by hand each time. Or you could run zvm i master.

ZVM is a static binary under a permissive license with no system dependencies. It supports more platforms than any other Zig version manager: Windows, macOS, Linux, the BSDs, and Plan 9.

What's new in ZVM 9.4

Explore ZVM 9.4: a settings editor, install deduplication, per-shell Zig versions, automatic switching, a Go ZON parser, and security updates.

v0.8.12 Release

Today I'm publishing v0.8.12 of ZVM. I want to thank Vladimir Petrigo, Jack Parsons, and David James. Vladimir is the latest in a long line of contributors to tackle the…

Changelog v0.7.1

Hello, and welcome to the blog! This is the first Changelog posted to the website. Typically they'll be short, mostly containing text from GitHub Releases, but with some…

Read all posts