logoalt Hacker News

Building a TUI is easy now

57 pointsby abelangertoday at 5:50 PM44 commentsview on HN

Comments

qingcharlestoday at 10:20 PM

Gemini built a nice TUI for me for a DHT scraper project I was coding:

https://imgur.com/a/u3KHbDT

It was like two-shot, cos the first version had some issues with CJK chars.

I was impressed as it would have taken me a bunch of screwing around on lining up all the data etc when I wanted to concentrate on the scraping algorithm, not the pretty bits.

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
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
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.

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
tantalortoday at 10:14 PM

> most importantly, they live inline to your code, preventing constant tab switching

No idea what this means.

show 2 replies
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.

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.

empath75today at 10:18 PM

I was working on a fairly niche thing, a library of crossplane compositions written in KCL and thought it would be nice to have a TUI so i could browse through them and see the rendered yaml as claude was working on it. I asked claude code to write it with python and textual and it one shotted it in about two minutes including a test suite.

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
jgauthtoday at 9:16 PM

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

show 1 reply
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.

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: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
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
its_magictoday at 9:18 PM

[dead]

hnlmorgtoday at 10:00 PM

> Building a TUI is easy now

It has always been easy.