A tiny zstd CLI built in Zig with a static libzstd.
Requires Zig 0.17.0. Run npm run setup to download the pinned compiler and
initialize the zstd submodule, then npm run build (requires Bun), or use an
installed Zig 0.17.0 compiler directly:
zig buildWindows releases support x64 and ARM64 and are built and tested on native runners.
To cross-compile ARM64, use zig build -Dtarget=aarch64-windows-gnu -Doptimize=ReleaseFast -Dcpu=baseline.
zig build test-build -Dtarget=aarch64-windows-gnu produces zig-out/bin/test.exe
for execution on an ARM64 machine. Releases require these tests and a packaged
CLI roundtrip to pass on a Windows ARM64 runner before publication.
./zig-out/bin/zig-zstd compress -i input.tar -o input.tar.zst -l 19 --progress --threads 4 --checksum
./zig-out/bin/zig-zstd decompress -i input.tar.zst -o input.tarOptions:
-i,--input: input file path (required)-o,--output: output file path (required)-l,--level: compression level (default: 19)--progress: print periodic progress updates--chunk-size: override streaming chunk size (bytes)--threads: number of worker threads for compression (--threads=maxuses CPU count)--window-log: set compression window log (affects memory usage)--checksum: include a checksum in the zstd frame--rsyncable: generate rsync-friendly output (lower ratio, higher CPU)--long-distance: enable long distance matching for better ratios on large files--no-timing: disable timing output
Notes:
--threadsrequires zstd built with multithread support; a warning is printed if the option isn't applied.
zig build testbun dev
bun dev 200The optional numeric argument is the size (in MB) for the tar payload.