Skip to content
I Live in the Terminal, So I Built TerminalTUI
Developer Tool

I Live in the Terminal, So I Built TerminalTUI

3 min read544 words

Hey everyone!

I just published TerminalTUI to npm and figured I'd write about why it exists and what it does. The short pitch: it's a framework for building terminal apps the way you build React apps. Declarative UI, components, routing, state. But the output is a TUI that runs in any terminal.

Why? Because I already live in the terminal. My editor is there. My shell is there. I've been slowly moving more of my tooling into terminal-native apps over the past year — and I kept hitting the same wall. Every TUI library I tried was either "bring your own render loop" or very opinionated about layout in a way that didn't match how I think about UI. I wanted something that felt like the Next.js / React combo but for the terminal.

What's in the framework:

  • 30+ pre-built UI components — buttons, inputs, tables, modals, tabs, menus, progress bars, sparklines, the usual. All keyboard-navigable by default.
  • A 12-column responsive grid system that reflows when the terminal resizes.
  • Spatial arrow-key navigation — arrow keys move focus in the visual direction, not in DOM order. This is the feature I missed most from other TUI libraries.
  • 10 color themes, theme-switchable at runtime via a single key.
  • An ASCII art engine so you can drop figlet-style banners in declaratively.
  • File-based routing, same mental model as the Next.js app router.
  • Reactive state management built in.
  • Form handling with validation.

How big? The whole runtime plus build step is built on esbuild and Node.js built-ins. No other runtime dependencies. Install size is small.

Tests: there are over 2,185 tests covering the component library, the render loop, the routing, and the input state machines. I made a rule early on that every component gets a test suite before it ships. This mattered way more than I expected — TUIs have so many edge cases around input modes (raw vs cooked, focus handling, terminal resize during input) that regressions creep in silently if you don't have coverage.

The SSH hosting feature is my favorite part. You can take any TerminalTUI app and host it over SSH with one line of config. Users ssh into your app and it runs. No install on their side, no website, no mobile app. Just a TUI behind an SSH endpoint. I use this internally to share tools with collaborators in a way that's fast to iterate on — instead of deploying a web app, I push to the SSH host and everyone gets the new version on their next connection.

Running it: npx terminaltui init <name> scaffolds a new app, npm run dev starts it in a watch mode that reloads on file change, and npx terminaltui host puts it behind SSH.

What's next:

  • A plugin system so people can ship custom components as packages.
  • Better perf on very wide terminals (I've seen frame drops above ~300 columns in one specific component).
  • Multi-pane layouts similar to tmux.

If you've been waiting for someone to make the terminal feel like a modern UI framework, please try it and file issues. I'm trying to build toward something that feels complete — not a toy — and the fastest way to get there is people using it in weird ways I didn't plan for.

More soon!

typescripttuiterminalsshnpm