Ansi.md

The TUI

Most CLI apps run for a moment, write some output, and then exit. Think ls. But there's a category of full-blown apps that hang around so you can interact with them. This kind of app is called a Terminal User Interface, or TUI for short. A broad definition would technically include stalwarts like emacs or tmux, but here we are mainly focused on newer TUIs that strive for beautiful design with advanced layouts.

Disclaimer - I've only written a handful of TUI apps, mostly unreleased. My favorite is probably my silly little RPN calculator vectro, built with bubbletea. Also on web at vectro.app, which nobody asked for. It's not that exciting, please ignore.

Gratuitous Screenshots

Let your imagination run wild, we can do a lot these days:

Ecosystem

If you think about it, each TUI must include the crude equivalent of a web browser - event loop, layout engine, and widgets. TUI libs are powerful and complicated. Some of them are like react, with nested components and props. Some use flexbox. Let's start by checking out some popular TUI apps. I award a highly-coveted chicken emoji to apps I've used and enjoyed. 🐔

applang⭐ starstui libwhat
fx 🐔go21kbubbleteajson viewer
gh-dashgo12kbubbleteagh dashboard
slidesgo12kbubbleteaslides
superfilego23kbubbleteafile manager
memraypy15ktextualpy memory prof
postingpy12ktextuallike postman
bandwhich 🐔rs12kratatuibandwidth monitor
csvlensrs4kratatuicsv viewer
elio 🐔rs1kratatuifile manager
gituirs22kratatuigit
llmfit 🐔rs31kratatuilocal LLM picker
presentermrs9kratatuislides
spotify-playerrs7kratatuispotify
trippy 🐔rs7kratatuiping
yazi 🐔rs41kratatuifile manager
gloomberbts1kopentuifinance
hunk 🐔ts8kopentuidiff viewer
btopc++33kcustomtop
glancespy33kncursestop
goaccessc21kncurseslog file viewer
k9sgo34ktviewkubernetes
lazydockergo52kgocuidocker
lazygit 🐔go81ktcellgit
nnnc22kncursesfile manager
spotify-tuirs19ktui-rsspotify
tig 🐔c13kncursesgit

And let's not forget the ai harnesses:

applang⭐ starstui lib
claude-code 🐔ts140kink
codex 🐔rs91kratatui
copilot-clits11kink
gemini-clits106kink
hermes-agentpy/ts222kink
opencodets191kopentui
pi 🐔ts90kcustom

TUI Frameworks

Again, I haven't used all of these so I can't really provide a lot of guidance. The only one I've shipped with is bubbletea, which I found to be fast and productive. Personally I would avoid writing complicated TUIs in typescript. Use something native like go/rust, and probably bubbletea/ratatui if you have a choice.

liblang⭐ starsdesignlayout
bubbletea 🐔go44kmodel/update/viewlipgloss / manual
inkts40kreactflexbox
opentuits13kreact/solidflexbox
ratatui 🐔rust22kimmediate modeconstraints
textualpython37kreact-likecss-like