
I turned my small Zig ls-like CLI into a reusable package
A while ago I shared zlist here — a small ls-like CLI I’ve been building while learning Zig.
At the time, a few people mentioned that the file listing/parsing logic might be useful outside of the CLI. That made a lot of sense, so I spent some time splitting the core logic out from the rendering layer.
zlist v0.1.1 is now usable as a standalone Zig package:
zig fetch --save git+https://github.com/here-Leslie-Lau/zlist
Then from another Zig project:
const zlist = @import("zlist");
More usage: https://github.com/here-Leslie-Lau/zlist/blob/main/docs/using-as-a-module.md
The idea is that the core package only gives you the listing data. It does not decide how things should be printed. The zl CLI still handles the terminal output, colors, icons, layout, etc.
It’s still early, and I’m not claiming this is some perfect library. This is mostly a learning project that slowly became a little more fun than I expected. But I’d really appreciate feedback on the package API, ownership rules, and whether the split between core/listing logic and CLI rendering feels reasonable.
Repo: https://github.com/here-Leslie-Lau/zlist
Thanks again for the earlier feedback — it really helped. My earlier post: https://www.reddit.com/r/Zig/comments/1shdvij/i_wrote_a_small_ls_alternative_in_zig/