61

Building a TUI is easy now

Alex,

It's somewhat ironic that a web page about performant terminal user interfaces uses gratuitously complex CSS mask compositing and cubic gradients which reduce smooth scrolling on my 1 year-old, high-end Dell XPS laptop (>$3k) to Commodore 64 level (on default 'Balanced' battery mode). While it's pretty, it's also just a very subtle, non-critical background animation effect. Not being a CSS guru myself, here's what Gemini says:

> "Specifically, this is a Scrim or Easing Gradient. Instead of a simple transition between two colors, it uses 16 color stops to mimic a "cubic-bezier" mathematical curve. This creates a smoother, more natural fade than a standard linear gradient, but it forces the browser to calculate high-precision color math across the entire surface during every scroll repaint."

My Firefox smooth scrolls like butter on thousands of pages, so you might want ask your web designer to test on non-Mac, iGPU laptops with hiDPI and consider the performance cost of web pages with always-running subtle background animations in a world of diverse hardware platforms. In case it helps, here's what the animation with the gradient layers disabled which is recalculating every scroll line (https://i.imgur.com/He3RkEu.jpeg).

13 minutes agomrandish

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.

an hour agoelevation

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.

an hour agomseepgood

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

an hour agogrogenaut

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.

an hour agoelevation

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.

an hour agoembedding-shape

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.

an hour agomulmen

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.

an hour agodwb

Yes, but this kind of dashboard was never going to be accessible anyway. It's a dense visual representation of vast system state with constant real-time fluctuation. Even in a browser, it would be hell to navigate the constantly changing state with a screen reader. And visually increasing the scale and contrast defeats the purpose of the density of the original display.

If you need to support screen readers, your UI would have to be totally different: You should allow the user to snapshot the system state and navigate it. Generate succinct summary text to impart the same sense that a dashboard would to a visual user. "Normal: All systems OK" "Critical: Boeing RPA servers down since 2:17PM PDT and 54 others". Once you've done this work, a CLI tool could expose this just as screen-readable:

    $ cli status
      all systems OK, last outage resolved 2:27 PDT

    $ cli topjob cpu
      117 Boeing RPA, 78% CPU
      434 SAIC PDM, 43% CPU

    $ cli downtime today 117
      Boeing RPA down 10 minutes today, resolved now
17 minutes agoelevation

I disagree, I think TUIs are a great fit in some problem domains.

Think for instance the Debian package configuration dialogs -- they're far more comfortable than the same questions without a TUI, and still work over a serial console if you have to use one.

For tools like various kinds of "top", there's many potential tools you can use to the same end and intentionally using one that draws CPU graphs over one that just displays a number. Graphs are much easier to interpret than a column of numbers.

In many cases they're the optimal choice given some constraint -- like the desire to have minimal dependencies, working over SSH, and being usable without breaking the flow. Yeah, you could make a tunnel to a tool that runs a local webserver and delivers graphs by HTTP, but the ergonomics of that are terrible.

17 minutes agodale_glass

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.

2 hours agoSoftTalker

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

an hour ago1123581321

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.

an hour agoPeterWhittaker

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)

an hour agoqingcharles

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.

an hour agobaq

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.

2 hours agochristophilus

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

an hour agosophacles

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)

an hour agoverdverm

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.

an hour agoqingcharles

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.

an hour agonout

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.

2 hours agoesafak

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

an hour agod4rkp4ttern

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/

2 hours agoesclerofilo

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.

an hour agozokier

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.

an hour agoCuriouslyC

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

an hour agoweebull

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

2 hours agosocalgal2

I do.

I want my interfacing with computers to be mouseless and TUIs offer that. I don’t think I’ve run into a GUI, no matter how many hotkeys it has and I know, where I didn’t have to reach for the mouse.

CLI only also requires remembering commands, some of which I use very infrequently, thus need to look up every time I use them.

I think TUIs hold a very nice spot between GUIs and CLI.

2 hours ago2muchtime

VS Code with the Vim extension is largely mouseless

I use the TUI from a terminal tab in VS Code, my agent works with that and the custom extension with a webapp based interface, seamlessly and concurrently

GUIs, TUIs, and PR/kanban all make sense in different situations. We'll all use at least two of them on regular basis for coding agents.

TUIs make way less sense for your average user

2 hours agoverdverm

> VS Code with the Vim extension is largely mouseless

It's also easily mouseless without any Vim or like extension. I never mouse in it, having given intuitive-to-me keychords to all the various moves I need to make beyond the standard stuff.

32 minutes agodualogy

true, I would never have moved over if I had to give up my vim bindings and modes

28 minutes agoverdverm

I just want a stream, not a TUI. If you can't | it it's not real

an hour agoliveoneggs

There’s no reason why you can’t have both.

Well behaved CLI tools have for years already been changing their UX depending on whether STDOUT is a TTY or a pipe.

43 minutes agohnlmorg

Have you tried jjui? It’s pretty nice

an hour agorirze

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

https://github.com/charmbracelet/bubbletea

2 hours agochristophilus

Charm is what the post submission is using

2 hours agoverdverm

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

No idea what this means.

an hour agotantalor

I think the implicit assumption here is that you are using a terminal-based code editor like neovim... which is not necessarily true.

an hour agoprydt

I think the reference is to all the TUI based coding tools now like opencode.

an hour agooj-hn-dot-com

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

2 hours agojgauth

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.

an hour agoempath75

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.

2 hours agoemilfihlman

Mobile is not for TUI

2 hours agoNetOpWibby

More specifically it's an interface designed for a physical keyboard. Or even more specifically it's designed for precise and easy human text input.

2 hours agobahmboo

especially where you typically type with all fingers instead of just your thumbs

an hour agoverdverm

Sure it is. I, and millions of others, use it all the time with for example Termux.

an hour agoemilfihlman

If you have a TUI the correct way to support mobile browsers is to 1-shot a React page equivalent. Trying to make the mobile keyboard work for this would be silly.

2 hours agoavaer

Building an article is easy now.

an hour agokeybored

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

2 hours agoverdverm

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.

2 hours agofragmede

I’ve built textual tuis (as in the Python library) and it responds to clicks just fine.

an hour agobaq

It is possible. Terminals have supported mouse interactions for a long time.

an hour agowillm

You can use the mouse with TUIs build on the Charm stack

https://github.com/lrstanley/bubblezone

There are a lot of components that resemble things you find in web component libraries

an hour agoverdverm

"Creating garbage is easy now."

It runs poorly, loses keystrokes, and easily gets bogged down with too much terminal input.

I don't want candy coated monospace ASCII graphics. I want something fast and functional. The graphics are _entirely_ secondary. You've missed the point of what a TUI is.

an hour agothemafia

[dead]

2 hours agoits_magic
[deleted]