Zonfig - interactive TUI config based on ZON

Thought it may interest some people here: GitHub repo
While working on another zig project, I was using the Linux kernel’s kconfig tooling and thought it would be nice if I could drop all dependencies on C tooling, so I wrote my own configuration tool! This is targeted at larger, more complex projects with many configuration options, much like kconfig, supporting things like conditional dependencies, submenus, etc. You define a schema in ZON and it generates a Zig module that is imported into the code which can then branch at compile time on it.

demo

I wouldn’t say I’m quite happy with the code quality yet, but hey it works :^)
For Zig 0.16+

15 Likes

I think https://asciinema.org would be a better alternative to the gif, especially because of the small font size and fast switching.

I did use asciinema to generate it, but I’m not sure how asciinema would be better here? GIF is way more portable

I just think having the link to asciinema or one of the embeds (html or markdown) too would be better (than only having the gif), because with those you can full screen it, I guess I also can right click on the gif and open in new tab (but that only occurred to me now and is not so obvious).

Also the non gif versions allow a wider range of screen reading/assistive technologies.

https://asciinema.org/a/0oejNmMFClqS2XRN
Alright, here is an asciinema link that showcases a bit more TUI functionality

6 Likes

Thanks, I also like that that allows me to step through it with ,/. at my own pace.

1 Like

This is so cool, i hate having to set 100 cli flags. I will start using this in my projects.

It is really nice.
Since schemas are also .zon, an idea is to provide a schema for its schema and extend it until it can edit its schemas.

Note on LLM dependencies: I recently changed the TUI frontend from ncurses to zigzag, which apparently has LLM generated code (?). If anyone wants to use this project without relying on LLM dependencies, you are free to revert to the ncurses frontend, which has the same amount of features, albeit being less portable (the goal behind the switch was to make it work on Windows portably as well).

But one needs to keep in mind that asciinema has no support e.g. the Kitty Graphics Protocol (and possibly more) in the online version.

But it can deal with it if you go through the actual file in a terminal which supports it.

1 Like