Zig Version Manager

Manage Zig and ZLS versions with project detection, safe cleanup, and automation-friendly output.

# Install via curl

$curl -fsSL https://raw.githubusercontent.com/hendriknielaender/zvm/main/install.sh | bash

Installation

Install via Homebrew:

$ brew tap hendriknielaender/zvm && brew install zvm

Shell Setup

After installation, configure your shell environment:

# Get shell-specific configuration
$ zvm env

# Example output:
# Add this to your ~/.bashrc, ~/.profile, or ~/.zshrc:
export PATH="/home/user/.local/share/zvm/bin:$PATH"

Usage Guide

CommandDescriptionExample
install, iInstall a Zig or ZLS versionzvm install 0.16.0
use, uSwitch to a Zig or ZLS versionzvm use 0.16.0
list, lsList installed versionszvm list --all
list-remoteList available Zig or ZLS versionszvm list-remote --zls
remove, rmRemove an installed versionzvm --yes remove 0.15.2
cleanClean cache and unused versionszvm clean --all
upgradeUpgrade zvm itselfzvm upgrade

Examples

# Install a stable Zig release
zvm install 0.16.0

# Install master/development build
zvm install master

# Install ZLS (Language Server)
zvm install --zls 0.16.0

Management

# Switch to specific version
zvm use 0.16.0

# List installed Zig and ZLS versions
zvm list --all

# Remove old version without prompting
zvm --yes remove 0.15.2

Auto-version Detection

zvm automatically detects the required Zig version from your project's build.zig.zon file.

build.zig.zon
.{
    .name = "my-project",
    .version = "0.1.0",
    .minimum_zig_version = "0.16.0",
    .dependencies = .{},
}
1. Detect

Reads minimum_zig_version from your zon file.

2. Install

Fetches the version if it is not present.

3. Apply

Runs your Zig command with the matching binary.

Configuration

Global Options

FlagDescription
--jsonOutput machine-readable JSON
--plainTabular pipeline output without headers or color
--quietSuppress non-error output
--verboseShow debug output on stderr
--traceShow HTTP details and file paths while debugging
--yesSkip confirmation prompts for destructive operations
--no-inputRefuse to prompt; fail fast in automation
--no-colorDisable colored output
--colorForce colored output
--help, -hShow help
--versionShow version

Environment Variables

VariableDescriptionDefault
ZVM_HOMEOverride zvm install/data directoryplatform data dir
XDG_DATA_HOMEBase data directory on Unix when ZVM_HOME is unset~/.local/share
ZVM_DEBUGLegacy verbose logging aliasfalse
NO_COLORDisable colored output when setunset
ZVM_DOWNLOAD_TIMEOUT_SECONDSPer-mirror download timeout with fallback1800