How to Use ZVM
Install
Section titled “Install”zvm install <version># Orzvm i <version>Use install or i to download a specific version of Zig. To install the
latest version, use “master”.
# Examplezvm i masterForce Install
Section titled “Force Install”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 masterYou can also enable the old behavior by setting the new alwaysForceInstall
field to true in ~/.zvm/settings.json.
Install ZLS with ZVM
Section titled “Install ZLS with ZVM”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 masterSelect ZLS compatibility mode
Section titled “Select ZLS compatibility mode”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
Switch between installed Zig versions
Section titled “Switch between installed Zig versions”zvm use <version>Use use to switch between versions of Zig.
# Examplezvm use masterList installed Zig versions
Section titled “List installed Zig versions”# Examplezvm lsUse ls to list all installed version of Zig.
List all versions of Zig available
Section titled “List all versions of Zig available”zvm ls --allThe --all flag will list the available verisons of Zig for download. Not the
versions locally installed.
List set version maps
Section titled “List set version maps”zvm ls --vmuThe --vmu flag will list set version maps for Zig and ZLS downloads.
Uninstall a Zig version
Section titled “Uninstall a Zig version”# Examplezvm rm 0.10.0Use uninstall or rm to remove an uninstalled version from your system.
Upgrade your ZVM installation
Section titled “Upgrade your ZVM installation”As of zvm v0.2.3 you can now upgrade your ZVM installation from, well, zvm.
Just run:
zvm upgradeThe latest version of ZVM should install on your machine, regardless of where
your binary lives (though if you have your binary in a privaledged folder, you
may have to run this command with sudo).
Clean up build artifacts
Section titled “Clean up build artifacts”# Examplezvm cleanUse clean to remove build artifacts (Good if you’re on Windows).
Run installed version of Zig without switching your default
Section titled “Run installed version of Zig without switching your default”If you want to run a version of Zig without setting it as your default, the new
run command is your friend.
zig version# 0.13.0
zvm run 0.11.0 version# 0.11.0
zig version# 0.13.0This can be helpful if you want to test your project on a newer version of Zig without having to switch between bins, or on alternative flavor of Zig.
How to use with alternative VMUs
Section titled “How to use with alternative VMUs”Make sure you switch your VMU before using run.
zvm vmu zig machrun mach-latest version# 0.14.0-dev.1911+3bf89f55cIf you would like to run the currently set Zig, please keep using the standard
zig command.
Set Version Map Source
Section titled “Set Version Map Source”ZVM lets choose your vendor for Zig and ZLS. This is great if your company hosts it’s own internal fork of Zig, you prefer a different flavor of the language, like Mach.
zvm vmu zig "https://machengine.org/zig/index.json" # Change the source ZVM pulls Zig release information from.
zvm vmu zls https://validurl.local/vmu.json                                       # ZVM only supports schemas that match the offical version map schema.                                       # Run `vmu default` to reset your version map.
zvm vmu zig default # Resets back to default Zig releases.zvm vmu zig mach # Sets ZVM to pull from Mach nominated Zig.
zvm vmu zls default # Resets back to default ZLS releases.Use a Custom Mirror Distribution Server
Section titled “Use a Custom Mirror Distribution Server”ZVM now lets you set your own Mirror Distribution Server. If you cannot or choose not to use the official Zig mirror list, you can host your own, or use another grouping of mirrors.
zvm mirrorlist <url># Reset to the official mirrorzvm mirrorlist defaultPrint program help
Section titled “Print program help”Print global help information by running:
zvm --helpPrint help information about a specific command or subcommand.
zvm list --helpNAME:   zvm list - list installed Zig versions. Flag `--all` to see remote options
USAGE:   zvm list [command options] [arguments...]
OPTIONS:   --all, -a   list remote Zig versions available for download, based on your version map (default: false)   --vmu       list set version maps (default: false)   --help, -h  show helpPrint program version
Section titled “Print program version”zvm --versionPrints the version of ZVM you have installed.
Option flags
Section titled “Option flags”Color Toggle
Section titled “Color Toggle”Enable or disable colored ZVM output. No value toggles colors.
Enable
Section titled “Enable”- on
 - yes/y
 - enabled
 - true
 
Disabled
Section titled “Disabled”- off
 - no/n
 - disabled
 - false
 
--color # Toggle ANSI color printing on or off for ZVM's output, i.e. --color=trueEnvironment Variables
Section titled “Environment Variables”ZVM_DEBUGenables DEBUG logging for your executable. This is meant for contributors and developers.ZVM_SET_CUToggle the automatic upgrade checker. If you want to reenable the checker, justuset ZVM_SET_CU.ZVM_PATHreplaces the default install location for ZVM Set the environment variable to the parent directory of where you’ve placed the.zvmdirectory.ZVM_SKIP_TLS_VERIFYDo you have problems using TLS in your evironment? Toggle off verifying TLS by setting this environment variable.- By default when this is enabled ZVM will print a warning. Set this variable
to 
no-warnto silence this warning. 
- By default when this is enabled ZVM will print a warning. Set this variable
to 
 
Settings
Section titled “Settings”ZVM has additional setting stored in ~/.zvm/settings.json. You can manually
update version maps, toggle color support, and disable the automatic upgrade
checker here. All settings are also exposed as flags or environment variables.
This file is stateful, and ZVM will create it if it does not exist and utilizes
it for its operation.