logoalt Hacker News

Building a TUI is easy now

48 pointsby abelangertoday at 5:50 PM33 commentsview on HN

Comments

elevationtoday at 9:54 PM

As LLMs consume all our compute resources and drive up prices for the compute hardware on which we run applications, the silver lining is that LLMs are helpful in implementing tooling without a heavy stack so it will run quickly on a lower-spec computer.

I've achieved 3 and 4 orders of magnitude CPU performance boosts and 50% RAM reductions using C in places I wouldn't normally and by selecting/designing efficient data structures. TUIs are a good example of this trend. For internal engineering, to be able to present the information we need while bypassing the millions of SLoC in the webstack is more efficient in almost every regard.

show 1 reply
zokiertoday at 10:00 PM

Big reason why TUIs were popular in the first place is because they are so much simpler to build. Compare ncurses to GTK/Qt, they are completely different leagues. One of my pet ideas is to build a ncurses compatible/style library that skips terminal layer and instead renders directly to Wayland, kinda getting the simplicity of ncurses without dragging all the legacy junk with it.

show 1 reply
pelcgtoday at 9:53 PM

Some of my personal favourites TUI are all over GitHub and there are lots of them to have a look at can be found here:

https://github.com/rothgar/awesome-tuis

https://terminaltrove.com/explore/

Building for Charm, ratatui and many others is really getting much easier than before thanks to AI.

esclerofilotoday at 9:46 PM

I too enjoy the charm TUI libraries, and have been using them to build a settlers of Catan game[0]. And some features are really cool, like different colors depending on dark/light theme.

They have a bunch of functions that concatenate strings, which may not be very efficient compared to using string.builders, but I haven't yet had performance problems.

However I haven't had such a great experience with AI, IMO they're bad at ASCII art.

[0]: https://sr.ht/~vicho/el_poblador/

nouttoday at 9:52 PM

I think mc (Midnight Commander) is still one of the best TUIs available - it's very close in capability to the GUI versions (like Double Commander) and it has the benefits of tuis - like that you can run it on a remote system. It looks outdated, but I'm actually now working on a new skin that will hopefully be included in the next release of mc.

SoftTalkertoday at 9:38 PM

I don't see any real advantage of TUIs over web forms or GUIs for the same thing.

I do like CLIs though, especially the ones that are properly capable of working in pipelines. Composing a pipeline of simple command-line utilities to achieve exactly what you want is very powerful.

show 5 replies
christophilustoday at 9:46 PM

There are plenty of great tools available these days. Bubbletea would be my tool of choice, I think:

https://github.com/charmbracelet/bubbletea

show 1 reply
esafaktoday at 9:30 PM

If it was so easy Anthropic wouldn't have messed up CC for so long. The author takes for granted the availability of good off-the-shelf TUI libraries for the chosen language.

hnlmorgtoday at 10:00 PM

> Building a TUI is easy now

It has always been easy.

socalgal2today at 9:23 PM

Do we want tuis?

I can’t stand Gemmin-CLI. That tui gets in the way constantly

I’m mixed in jj’s tui. It’s better than no ui tho

Mostly tho I’m curious when I’d want a tui. Most of the time in a terminal I don’t want one

show 3 replies
keyboredtoday at 10:00 PM

Building an article is easy now.

jgauthtoday at 9:16 PM

Charm looks good. What is the TUI library of choice for python these days?

show 1 reply
verdvermtoday at 9:49 PM

Dagger has a really nice TUI built on Charm. It reads OTEL to create an interactive tree for your builds and containers. If you have cloud setup, it will also push that all to a webapp interface where you can share and navigate in perpetuity. This works for both CI and local runs, super cool for sharing links to failed builds during dev, even while the dev's local build is still running

https://www.youtube.com/watch?v=EPEGTfaFnpA

fragmedetoday at 9:48 PM

The problem with TUI's, that we have all Stockholm syndrom'd ourselves, is that I can't use the mouse cursor to click to the position on the screen and edit the command line.

show 3 replies
fragmedetoday at 9:45 PM

They are! I (well, Claude) built nitpick as a TUI HN client, and it was surprisingly easy to do.

https://github.com/fragmede/nitpick

emilfihlmantoday at 8:52 PM

The thing with TUIs is that, using mobile native virtual keyboards, it's apparently quite impossible to make them behave in a sane way in browsers!

I think the only reasonable option seems to be reimplementing one yourself, which is massively stupid.

show 2 replies
its_magictoday at 9:18 PM

[dead]