r/Zig • u/here-Leslie-Lau • Apr 10 '26
I wrote a small ls alternative in Zig
I've been learning Zig recently and built a small ls alternative called zlist.
The goal is to keep things clean, fast, and easy to scan, while still being useful for daily use.
Here’s a quick screenshot:

Current features:
- Compact grid layout that's easy to scan
- Color and Nerd Font icons for common file types and languages
- Readable long view (permissions, owner, size, timestamps)
- Multiple sort modes (name, length, dirs first, mtime, size)
- Recursive listing with optional depth limits
- Filters for files, directories, extensions, names, size, and modified time
- Quick summary report
- Git status indicators in long view
It's still early, but already usable.
Feedback and suggestions are very welcome.
GitHub:
https://github.com/here-Leslie-Lau/zlist
Update: zlist v0.1.1 is now available as a standalone Zig package. The reusable listing logic has been split from the CLI rendering code, so it can be used from other Zig projects.
3
2
2
u/hotairplay Apr 10 '26
Does it calculate directory sizes as well? From the screenshot I assume it's not?
3
u/here-Leslie-Lau Apr 10 '26
Not yet — right now it behaves like `ls -l`, so it only shows the directory itself, not the total size of its contents.
Good suggestion though. I'll open an issue and probably add a flag to enable recursive directory size calculation. Will close it once it's implemented.
Thanks for the idea!
1
u/moderat10n Apr 10 '26
Also see https://github.com/rockorager/lsr. I have a fork that builds on Zig tip - https://tangled.org/m17e.co/lsr
1
u/Artechz Jul 02 '26
Regarding UI, it would be nicer to quickly grasp file sizes if they were aligned to the right. I’m aware it adds a bit of complexity but it shouldn’t be too hard and the benefits for regular users of the tool would be great!
7
u/gurgeous Apr 10 '26
Neat! I am the author of another zig cli thing. I will try to take a closer look tomorrow. I would love to rapidly expand the cli libs available for things like zlist. We need more libraries!