Download and manage Zig compilers.
zigo
is a dependency free binary program.
- Download from releases.
unzip ./zigo-linux-amd64.zip
chmod +x ./zigo
./zigo
- From source:
go install github.com/nopdan/zigo@latest
Add ~/.zig/current
to the environment variable.
Download the specified version of zig compiler and set it as default.
examples: zigo 0.11.0
, zigo master
❯ ./zigo master
downloading https://ziglang.org/builds/zig-linux-x86_64-0.12.0-dev.374+742030a8f.tar.xz...
progress: 42.96 MiB / 42.96 MiB ( 100.0 % ) 13.96 MiB/s
done. save cache to /home/cx/.cache/zigo/zig-linux-x86_64-0.12.0-dev.374+742030a8f.tar.xz
installing master => 0.12.0-dev.374+742030a8f...
successfully installed!
❯ zig version
0.12.0-dev.374+742030a8f
Set the specific installed version as the default.
List installed compiler versions.
❯ ./zigo ls
* master => 0.12.0-dev.312+cb6201715
0.11.0
0.12.0-dev.307+7827265ea
0.12.0-dev.312+cb6201715
Remove the specified compiler.
Append -f
or --force
to force deletion.
Use zigo rm --all
or zigo rm -a
to remove all installed compilers.
❯ ./zigo rm 0.10.1
removed 0.10.1
❯ ./zigo rm 0.11.0
cannot remove the version you are using.
❯ ./zigo rm 0.11.0 -f
removing 0.11.0... done.
Clean up unused dev version compilers.
❯ ./zigo ls
* master => 0.12.0-dev.353+4a44b7993
0.11.0
0.12.0-dev.312+cb6201715
0.12.0-dev.352+4d29b3967
0.12.0-dev.353+4a44b7993
❯ ./zigo clean
removed 0.12.0-dev.312+cb6201715
removed 0.12.0-dev.352+4d29b3967
❯ ./zigo ls
* master => 0.12.0-dev.353+4a44b7993
0.11.0
0.12.0-dev.353+4a44b7993
Move the zig installation directory.
Default installation directory is ~/.zig
.
Print help message.
Install Go 1.21.0+
git clone https://github.com/nopdan/zigo.git
cd zigo
go mod tidy
go build