Show HN: Zli β A Batteries-Included CLI Framework for Zig
Published on: 2025-06-23 00:52:14
π zli
A blazing-fast, zero-cost CLI framework for Zig. The last one you will ever use.
Build modular, ergonomic, and high-performance CLIs with ease. All batteries included.
π§± Each command is modular and self-contained. inspired by Cobra (Go) and clap (Rust).
π Documentation
See docs.md for full usage, examples, and internals.
π Highlights
Modular commands & subcommands
Fast flag parsing ( --flag , --flag=value , shorthand -abc )
, , shorthand ) Type-safe support for bool , int , string
, , Named positional arguments with required , optional , variadic
, , Auto help/version/deprecation handling
Pretty help output with aligned flags & args
Cobra-like usage hints, context-aware
π¦ Installation
zig fetch --save=zli https://github.com/xcaeser/zli/archive/v3.5.2.tar.gz
Add to your build.zig :
const zli_dep = b . dependency ( "zli" , .{ . target = target }); exe . root_module . addImport ( "zli" , zli_dep . module ( "zli" ));
π Suggested Structure
your-app/ βββ build.zig ββ
... Read full article.