zvm (Zig Version Manager) lets you easily install/upgrade between different versions of Zig.
zvm (Zig Version Manager) lets you easily install/upgrade between different versions of Zig.
Zig Version Manager (zvm) is a tool for managing your Zig installs. With std under heavy development and a large feature roadmap, Zig is bound to continue changing. Breaking existing builds, updating valid syntax, and introducing new features like a package manager. While this is great for developers, it also can lead to headaches when you need multiple versions of a language installed to compile your projects, or a language gets updated frequently.
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. After ZVM 0.2.3, ZVM's installer will now add ZVM to $HOME/.zvm/self.
You should also add this directory as the environment variable ZVM_INSTALL.
The installer scripts should handle this for you automatically on *nix and
Windows systems.
If you don't want to use ZVM_INSTALL (like you already have ZVM in a place you
like), then ZVM will update the exact executable you've called upgrade from.
All installation scripts hosted on www.zvm.app are identical to, and are
automatically synced with their respective copies on GitHub.
www.zvm.app/install.sh === ./install.sh
curl https://www.zvm.app/install.sh | bash
irm "https://www.zvm.app/install.ps1" | iex
powershell -c "irm https://www.zvm.app/install.ps1 | iex"
go install -ldflags "-s -w" github.com/tristanisham/zvm@latest
Please grab the latest release.
Alternatively, you can build the app by cloning the repository and running
go build .
./zvm
If you want to disable that ZVM can automatically update itself, you can run
go build -tags noAutoUpgrades .
instead for building the app.
ZVM requires a few directories to be on your $PATH.
The installer script handles this for you automatically. If you need to set it
up manually, append the following to your shell's startup file (~/.bashrc,
~/.zshrc, or ~/.profile):
export ZVM_INSTALL="$HOME/.zvm/self"
export PATH="$HOME/.zvm/bin:$ZVM_INSTALL:$PATH"
Then restart your shell or source the file for the changes to take effect.
If you don't know how to update your environment variables permanently on Windows, you can follow this guide. Once you're in the appropriate menu, add or append to the following environment variables:
Add
%USERPROFILE%\.zvm\selfAppend
%USERPROFILE%\.zvm\bin%ZVM_INSTALL%It is possible to overwrite the default behavior of ZVM to adhere to XDG
specification on Linux. There's an environment variable ZVM_PATH. Setting it
to $XDG_DATA_HOME/zvm will do the trick.
zvm on the Arch AUR is a
community-maintained package, and may be out of date.
While Zig is still pre-1.0 if you're going to stay up-to-date with the master
branch, you're going to be downloading Zig quite often. You could do it
manually, having to scroll around to find your appropriate version, decompress
it, and install it on your $PATH. Or, you could install ZVM and run
zvm i master every time you want to update. zvm is a static binary under a
permissive license. It supports more platforms than any other Zig version
manager. ZVM has no system dependencies. Whether you're on
Windows, MacOS, Linux, a flavor of BSD, or Plan 9 zvm will let you install,
switch between, and run multiple versions of Zig.
ZVM ships one portable agent skill with plugin manifests for Claude Code and
Codex. It teaches coding agents to reach for zvm instead of a distro package
or a hand-unpacked tarball, and to drive it correctly when they do.
/plugin marketplace add tristanisham/zvm
/plugin install zvm
The same commands are also available from a shell:
claude plugin marketplace add tristanisham/zvm
claude plugin install zvm@zvm
The repository includes a Codex plugin manifest at .codex-plugin/plugin.json.
The underlying skills/zig-versions/ directory uses the portable Agent Skills
layout, so other skill-compatible agents can load that directory directly.
The shared skill covers ZVM's real command surface, how to find the version a
repository actually wants (//! zvm-lock: in build.zig,
.minimum_zig_version in build.zig.zon), and why agents should prefer
zvm run over zvm use so they never repoint your global Zig without being
asked. The command reference is generated from ZVM's own CLI definition, so it
cannot drift from the binary.
zvm is stable software. Pre-v1.0.0 any breaking changes will be clearly
labeled, and any commands potentially on the chopping block will print notice.
The program is under constant development, and the author is very willing to
work with contributors. If you have any issues, ideas, or contributions you'd
like to suggest
create a GitHub issue.
zvm install
# Or
zvm i
Use install or i to download a specific version of Zig. You can pass an
exact version, a shorthand, or an
alias.
zvm i 0.13.0 # Install an exact version
zvm i master # Install the current master nightly
zvm i stable # Install the latest stable release
zvm i .14 # Shorthand — installs 0.14.x (latest patch)
You can use abbreviated version numbers and ZVM will resolve them to the latest matching release:
zvm i 0.13 # Installs 0.13.0
zvm i .13 # Same as above — a leading dot implies "0."
zvm i 0.15 # Installs 0.15.2 (latest 0.15.x patch)
zvm i .15 # Same — resolves to 0.15.2
Whenever ZVM expands a shorthand, it prints the result so you know exactly what's being fetched:
$ zvm i .14
Resolved ".14" to 0.14.1
...
Shorthand works across every command that takes a version:
zvm i 0.14 # install
zvm use .13 # switch active version
zvm run 0.12 version
zvm rm .11 # uninstall
For use and rm, shorthand is resolved against your locally installed
versions. For install and run, it resolves against the remote version
map.
ZVM understands a few named aliases in addition to concrete versions:
| Alias | Resolves to |
|---|---|
master |
The current master nightly build (passes through as-is) |
stable |
The highest non-dev, non-master release (e.g. 0.16.0) |
zvm i stable # Install the latest stable release
zvm use stable # Switch to the latest installed stable release
zvm i master # Install the current master nightly
stable is especially useful in automation — you don't have to know the exact
version number to grab the newest release.
You can also create your own named aliases with the alias command.
As of v0.7.6 ZVM will now skip downloading a version if it is already
installed. You can always force an install with the --force or -f flag.
zvm i --force master
You can also enable the old behavior by setting the new alwaysForceInstall
field to true in ~/.zvm/settings.json.
By default, installing Zig also makes that version active. Pass --skip-use
or -k to install it without changing the active Zig version:
zvm i --skip-use 0.15.2
This also applies when installing ZLS with --zls.
Zig development builds can be installed by their full build identifier, such as
0.16.0-dev.1334+06d08daba. ZVM downloads these builds directly from
ziglang.org/builds because they are not listed in the release version map.
Development builds do not have a version-map SHA-256 checksum. ZVM warns about this and asks for confirmation before continuing:
zvm i 0.16.0-dev.1334+06d08daba
For an explicit non-interactive install, pass --skip-shasum (or -s). This
also skips SHA-256 verification for regular Zig and ZLS installations, so use
it only when you accept that risk:
zvm i --skip-shasum 0.16.0-dev.1334+06d08daba
You can pass a custom HTTP timeout (in seconds) for zvm i using the --http.timeout flag or by setting the ZVM_HTTP_TIMEOUT environment variable.
zvm i --http.timeout 30
You can now install ZLS with your Zig download! To install ZLS with ZVM, simply
pass the --zls flag with zvm i. For example:
zvm i --zls master
By default, ZVM stops if the Zig installation fails and does not attempt the
requested ZLS installation. To attempt ZLS even after a Zig installation error,
set alwaysInstallZLS to true in ~/.zvm/settings.json:
{
"alwaysInstallZLS": true
}
The command still returns the Zig installation error. If ZLS also fails, ZVM returns both errors.
If you're on a platform where pre-built Zig binaries aren't available for a specific version (e.g., FreeBSD for Zig 0.14.x), you can override the target OS and/or architecture to download a compatible build.
Use the --target-os and --target-arch flags:
zvm i --target-os linux --target-arch x86_64 0.14.0
Or set the ZVM_TARGET_OS and ZVM_TARGET_ARCH environment variables:
export ZVM_TARGET_OS=linux
export ZVM_TARGET_ARCH=x86_64
zvm i 0.14.0
Both Go-style names (e.g., darwin, amd64) and Zig-style names (e.g.,
macos, x86_64) are accepted.
By default, ZVM will install a ZLS build, which can be used with the given Zig
version, but may not be able to build ZLS from source. If you want to use a ZLS
build, which can be built using the selected Zig version, pass the --full flag
with zvm i --zls. For example:
zvm i --zls --full master
[!IMPORTANT] This does not apply to tagged releases, e.g.:
0.13.0
zvm use
Use use to switch between versions of Zig. The version argument accepts
shorthand and aliases.
zvm use master # Switch to master
zvm use stable # Switch to the latest installed stable release
zvm use 0.13 # Resolves to 0.13.x (latest installed patch)
zvm use .14 # Same — leading dot implies "0."
Use alias (or kv) to give an installed Zig version a custom name. The version must already be installed, and shorthand is supported.
zvm alias work 0.13.0 # Point "work" at 0.13.0
zvm alias play .14 # Resolve to the latest installed 0.14.x
zvm use work # Switch versions by alias
zvm run play version # Run a command with the aliased version
Aliases work with install, use, run, and rm. Setting an existing name updates it.
zvm alias # List all aliases
zvm alias work # Print one alias
zvm alias -d work # Delete one alias
zvm alias --clear # Delete al
No open issues yet, or sync has not completed.