Install

CLI Programs

Quick Install (recommended)

1
curl -fsSL https://zigcli.liujiacai.net/install.sh | sh

This installs all binaries packaged in the latest release to ~/.local/bin by default.

Options:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Custom install directory
curl -fsSL ... | sh -s -- --install-dir /usr/local/bin

# Install all packaged binaries explicitly
curl -fsSL ... | sh -s -- --bins all

# Choose which binaries to install
curl -fsSL ... | sh -s -- --bins "loc zfetch tree cowsay"

# Pin a specific version
curl -fsSL ... | sh -s -- --version v0.4.0

# Use mirror for users in China
curl -fsSL ... | sh -s -- --china

Release binary CPU targets

The prebuilt release binaries use conservative CPU targets so the same archive can run on older machines:

  • x86_64 release binaries are built with haswell
  • aarch64-macos release binaries are built with apple_m1
  • aarch64-windows release binaries are built with cortex_a76
  • other aarch64 targets currently use generic

If those defaults do not match your deployment needs, build from source and choose your own -Dcpu target.

Build from source

1
git clone https://github.com/jiacai2050/zigcli.git

Then build with zig 0.15.2

1
make build

Packages

1
2
3
4
# Latest version
zig fetch --save git+https://github.com/jiacai2050/zigcli.git
# Tagged version
zig fetch --save git+https://github.com/jiacai2050/zigcli.git#v0.4.0

The latest tag can be found on release page.

Then in your build.zig, import the module like this:

1
2
3
4
const zigcli = b.dependency("zigcli", .{});

// zigcli exposes one root module with five submodules.
exe.root_module.addImport("zigcli", zigcli.module("zigcli"));

Generated API documentation for the exported packages is available at apidocs.

Last modified March 22, 2026: chore: bump to 0.5.0 (8c7d27e)