https://github.com/4thel00z/zig-installer
zig-installer, installs any recent zig version for you, straight from the zig homepage. Written in go.
https://github.com/4thel00z/zig-installer
install version-manager zig ziglang
Last synced: about 2 months ago
JSON representation
zig-installer, installs any recent zig version for you, straight from the zig homepage. Written in go.
- Host: GitHub
- URL: https://github.com/4thel00z/zig-installer
- Owner: 4thel00z
- License: gpl-3.0
- Created: 2025-01-16T10:43:39.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-16T21:09:54.000Z (over 1 year ago)
- Last Synced: 2025-06-24T20:11:36.420Z (12 months ago)
- Topics: install, version-manager, zig, ziglang
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ```zig-installer```

## What this project is about
A cli for installing the Zig compiler.
It automatically downloads, verifies, and installs Zig from official releases with support for custom installation paths and multiple versions.
## Installation
```bash
go install github.com/4thel00z/zig-installer/...@latest
```
## Usage Examples
### Basic Installation
```bash
sudo zig-installer
```
This will grab the latest master version and install it to `/usr/local`.
### Install Specific Version
```bash
sudo zig-installer --version=0.11.0
```
### Custom Installation Path
```bash
sudo zig-installer \
--bin-dir=/opt/zig/bin \
--lib-dir=/opt/zig/lib
```
### Using Environment Variables
```bash
export ZIG_VERSION=0.11.0
export ZIG_BIN_DIR=/opt/zig/bin
export ZIG_LIB_DIR=/opt/zig/lib
sudo zig-installer
```
## Configuration Options
| Flag | Environment Variable | Default | Description |
|------|---------------------|---------|-------------|
| `--version` | `ZIG_VERSION` | master | Version to install |
| `--bin-dir` | `ZIG_BIN_DIR` | /usr/local/bin | Binary installation path |
| `--lib-dir` | `ZIG_LIB_DIR` | /usr/local/lib | Library installation path |
| `--tar-dest` | `ZIG_TAR_DEST` | /tmp/zig.tar.xz | Download location |
| `--dest` | `ZIG_DEST` | /tmp/zig | Temporary extraction path |
| `--index-url` | `ZIG_INDEX_URL` | ziglang.org/... | Download index URL |
## Features
- 🚀 Fast downloads
- 📦 Proper library installation
- 🔧 Highly configurable
- 🖥️ Cross-platform support
- 🔐 Checksum verification
## Sample Output
```
💡 info: found existing file, checking checksum...
✅ success: existing file matches checksum, skipping download
👉 step: extracting...
👉 step: installing...
👉 step: cleaning up...
✅ success: Zig 0.11.0 installed successfully! 🎉
```
## Troubleshooting
### Permission Errors
```bash
# Run with sudo for system directories
sudo zig-installer
```
### Custom Location Without Root
```bash
# Install to user-owned directory
zig-installer --bin-dir=$HOME/.local/bin --lib-dir=$HOME/.local/lib
```
## License
This project is licensed under the GPL-3 license.