Top
Best
New

Posted by abelanger 4 hours ago

Building a TUI is easy now(hatchet.run)
60 points | 53 comments
dwb 27 minutes ago|
I think TUIs-that-want-to-be-GUIs (as opposed to terminal commands just outputting plain text) are sad. Mainly because they’re largely inaccessible. They flatten the structure of a UI under a character stream. You’re forced to use it exactly the way it was designed and no different. Modern GUIs, even web pages too, expose enough structure to the OS to let you use it more freely. I get why people build TUIs, but it’s a sorry state of affairs.
elevation 55 minutes ago||
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.

mseepgood 51 minutes ago|
The question is how many decades each user of your software would have to use it in order to offset, through the optimisation it provides, the energy consumption you burned through with LLMs.
grogenaut 31 minutes ago|||
In the past week I made 4 different tasks that were going to make my m4brun at full tilt for a week optimized down to 20 minutes with just a few prompts. So more like an hour to pay off not decades. average claude invocation is .3 wh. m4 usez 40-60 watts, so 24x7x40 >> .3 * 10
elevation 26 minutes ago||||
When global supply chains are disrupted again, energy and/or compute costs will skyrocket, meaning your org may be forced to defer hardware upgrades and LLMs may no longer be cost effective (as over-leveraged AI companies attempt to recover their investment with less hardware than they'd planned.) Once this happens, it may be too late to draw on LLMs to quickly refactor your code.

If your business requirements are stable and you have a good test suite, you're living in a golden age for leveraging your current access to LLMs to reduce your future operational costs.

embedding-shape 37 minutes ago||||
Especially considering that suddenly everyone and their mother create their own software with LLMs instead of using almost-perfect-but-slighty-non-ideal software others written before.
mulmen 35 minutes ago|||
I’m not really worried about energy consumption. We have more energy falling out of the sky than we could ever need. I’m much more interested in saving human time so we can focus on bigger problems, like using that free energy instead of killing ourselves extracting and burning limited resources.
SoftTalker 1 hour ago||
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.

PeterWhittaker 15 minutes ago||
There are some applications/systems for which certifying bodies forbid the use of web management because of vulnerabilities in both the protocols and the clients and servers. For example, in my daily, several national cyber organizations (NSA, CSE, GCHQ, etc.) have such direction. That's why our main product line is managed using a TUI accessed at the local console or over SSH (with very, very carefully curated SELinux MAC, among other things).

Having said that....

If one is willing to build one's own HTTP server with integrated MAC, etc., and is able to demonstrate mitigations against known vulnerabilities, one may be able to get the certifying bodies on board. Time will tell.

Yes, this is very niche, but TUIs are in general niche.

1123581321 41 minutes ago|||
I like a TUI when I always want an app to run side by side with a CLI. It’s easier to do split windows in a terminal or tmux/zellij panes than to script two separate app windows to stay locked together as a pair. Although, I’d welcome advice as to how to do it better.

I also find TUIs are easier to program for the same reason they’re limited. Fewer human interface aspects in play and it’s not offensive to use the same UI across OSes. (There are still under-the-hood differences across OSes, e.g. efficient file event watching.)

qingcharles 26 minutes ago|||
Gemini made a lovely TUI for my C# project, but afterwards it said it could just spin up a Kestrel web server inside the app instead which would be a much better solution for managing it, which was fair. (I have a line in my Agents to warn me when I specify a way of building something and it's not the ideal solution)
baq 41 minutes ago|||
TUIs work well over ssh. Pretty much everything else is a pain in the ass in some capacity, especially when the ssh client is a smartphone.
christophilus 1 hour ago|||
TUIs are much easier to run in a container, for one thing. Though, I guess a terminal-based web browser would work for some web apps.
sophacles 55 minutes ago|||
Having a tui file picker in the pipeline can be a powerful technique. Sometimes it just makes sense to have an interface that is slightly more interactive than pre-selecting all the files makes the flow smoother. Being able to put that into a script/alias/whatever is nice.

Other CLI things benefit from this "have a minimal ui interface in the workflow for the one step where it makes sense".

verdverm 54 minutes ago||
I just added a TUI built on Charm for my custom agent. I primarily use it for two things.

1. Navigating all my chat sessions and doing admin work. It's super fast to push a single key to go in and see what it was about before deleting it.

2. Testing out features and code changes without the web UI / vs code extension complexity.

3. Places where I cannot connect VS Code. I still want to chat and see diffs, a TUI is much easier than a CLI for this.

It also has a CLI, basically three interfaces (CLI, TUI, GUI (vscode/webapp)) to the core features of my personal swiss army knife (https://github.com/hofstadter-io/hof)

pelcg 56 minutes ago||
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.

qingcharles 30 minutes ago||
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.

d4rkp4ttern 22 minutes ago||
Indeed. Over a few days of iterations I had this TUI built for fast full-text search of Claude Code or Codex sessions using Ratatui (and Tantivy for the full-text search index). I would never have dreamed of this pre coding agents.

https://pchalasani.github.io/claude-code-tools/tools/aichat/...

nout 57 minutes ago||
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.
esafak 1 hour ago||
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 his chosen language.
zokier 49 minutes ago||
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.
CuriouslyC 39 minutes ago|
Yet ironically getting Claude Code to run at 60fps is way way harder in a TUI? Kinda funny that they optimized for "simple" then footgunned themselves into a client that probably took thousands of man hours to get to a reasonable place for power users.
weebull 36 minutes ago||
> Yet ironically getting Claude Code to run at 60fps is way way harder in a TUI?

That's what happens when you vibe code your app.

esclerofilo 1 hour ago|
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/

More comments...