Run Command
If you want to run a version of Zig without setting it as your default, the
run command is your friend.
zig version
# 0.13.0
zvm run 0.11.0 version
# 0.11.0
zig version
# 0.13.0Shorthand and aliases work too, as long as the matching version is already installed:
zvm run .12 version
zvm run stable versionSee Version Syntax for the full list of accepted forms.
If the first argument is not a known Zig version, zvm run looks for
.minimum_zig_version in the current project's build.zig.zon and treats all
arguments as the Zig command. This lets a repository declare the version while
you run commands without changing your global selection:
zvm run build testThis 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
Make sure you switch your VMU before using run.
zvm vmu zig mach
zvm run 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.