1
1
Fork
You've already forked iguana
1
Zig downloader and version manager in 64 lines of code
  • Python 67.1%
  • Shell 22.7%
  • Makefile 6.7%
  • Dockerfile 3.5%
2026年07月02日 09:09:17 +02:00
tests Make test_list faster to run by avoiding full tar unpacking ( #4 ) 2026年07月02日 09:09:17 +02:00
.containerignore Initial commit 2026年06月22日 20:13:47 +01:00
.gitignore Initial commit 2026年06月22日 20:13:47 +01:00
Containerfile Initial commit 2026年06月22日 20:13:47 +01:00
iguana Add verification of the minisign trusted comment ( #3 ) 2026年07月02日 08:31:21 +02:00
LICENSE Initial commit 2026年06月22日 20:13:47 +01:00
Makefile Add verification of the minisign trusted comment ( #3 ) 2026年07月02日 08:31:21 +02:00
README.md Simplify script size linter ( #1 ) 2026年06月29日 08:30:01 +02:00

iguana

Zig downloader and version manager in 64 lines of code

  • Download and install the requested Zig version from a mirror, verifying the signature.
  • Quickly switch between various Zig versions on the fly.
  • Auditable, the whole self-contained script consists only of 64 lines of POSIX shell script, partitioned into separate functions.

Requirements

This software should work on a sufficiently modern POSIX system (including GNU/Linux and macOS) with the following software:

  • minisign signature verifier, as described on Zig's download website.
  • curl or wget for downloading software over HTTP.

Additionally, GNU Tar or a clone with --strip-components extension is required. It's already present on GNU/Linux, busybox (including Alpine Linux), macOS, and FreeBSD out of the box.

Setup

  1. Install iguana to a directory present in your $PATH variable.
$ cd ~/bin
$ curl -LO https://codeberg.org/mslapek/iguana/raw/iguana
  1. Manually change the platform at the top of the iguana file to the one used by your computer.
$ vi +10 iguana

Choose one of:

PLATFORM=aarch64-macos
PLATFORM=aarch64-linux
PLATFORM=x86_64-linux

Full list is available at Zig's download website.

  1. Audit it! The script has only 64 lines of code. Hopefully, you'll learn a trick or two in shell scripting.
$ wc -l iguana
 64 iguana
  1. Make the script executable.
$ chmod a+x iguana

Now you're ready to go!

Basic usage

Run the following commands from your shell.

Install Zig

$ iguana install 0.16.0
$ iguana install 0.15.2

List installed versions

$ iguana list

Run Zig

$ iguana run 0.16.0 version
$ iguana run 0.16.0 zen

Zig shim

Instead of using iguana run, we can masquerade it as a zig.

First, add the shim.

$ ln -s iguana zig

Now you can just call Zig in your shell. By default, it'll use the latest installed version.

$ zig version # will print 0.16.0

To use older versions, just change the $ZIG_RELEASE environment variable.

$ export ZIG_RELEASE=0.15.2
$ zig version # will print 0.15.2

AI policy

No AI/LLMs were used in this project.

The script is the result of craftsmanship.

Other

Please leave a star on this project.

iguana is an independent implementation of Zig's version manager, NOT affiliated with the Zig Software Foundation.