Ziglets is a collection of simple Zig CLI applications, designed as educational examples for learning the Zig programming language.
The goal of this project is to provide minimal, easy-to-read code samples for common CLI patterns in Zig. Each command is implemented in its own file and demonstrates basic Zig features such as argument parsing, modularity, and interaction with the standard library.
To build the project, make sure you have Zig installed (tested with Zig 0.14.0):
zig buildThe resulting binary will be located in zig-out/bin/ziglets.
Pre-built binaries are available for multiple platforms and architectures. Visit the Releases page to download:
- Linux: x86_64 and ARM64 (both glibc and musl)
- Windows: x86_64 and ARM64 (GNU and MSVC toolchains)
- macOS: x86_64 (Intel) and ARM64 (Apple Silicon)
- Automated releases are created when tags following semantic versioning (
v*.*.*) are pushed to the main branch - All binaries include SHA256 checksums for verification
- Cross-platform builds are tested on every release
Run the CLI with:
zig-out/bin/ziglets <command> [args...]zig-out/bin/ziglets helphello— Prints "Hello, World!"goodbye— Prints "Goodbye, World!"echo ...— Runs the systemechocommand with the provided argumentsguess— Play a "Guess the number" gamewriter ...— Save a string tofile.txtand display its contentbase64 ...— Encode text to Base64pgen ...— Generate a random passwordcalculator— Interactive calculator (press keys, Q to exit)touch ...— Create empty file(s)factorial <number> [num_threads]— Calculate the factorial of a number using multiple threadshelp— Shows the help page
zig-out/bin/ziglets hello
zig-out/bin/ziglets echo Zig is fun!
zig-out/bin/ziglets guess
zig-out/bin/ziglets writer Hello from Zig!
zig-out/bin/ziglets base64 "Hello, Base64!"
zig-out/bin/ziglets pgen -l 16 -aA1&
zig-out/bin/ziglets calculator
zig-out/bin/ziglets touch file.txt
zig-out/bin/ziglets factorial 20 4Each command is implemented in its own Zig file and imported in main.zig.
You can explore the source code in the src/ directory to see how each feature is implemented.
- The file
file.txtused by thewritercommand is ignored by git (see.gitignore).
