A few months ago I started building (React for the terminal), terminaltui is in the same neighborhood but a step further — it ships routing, layout, and themes as defaults instead of "bring your own React patterns."
The file-based router
A terminaltui project is just two things: config.ts and pages/.
// pages/about.ts
import { card, markdown } from "terminaltui";
export const metadata = {
label: "About",
icon: "◆",
order: 2,
};
export default function About() {
return [
card({ title: "About me", body: "Developer." }),
markdown("Some markdown here."),
];
}
File paths map to routes the same way Next.js does:
pages/
index.ts → /
about.ts → /about
projects/
index.ts → /projects
[slug].ts → /projects/:slug
Dynamic routes use bracket syntax. The page function gets { params: { slug: string } }.
Under the hood, the framework walks the pages/ directory at boot, compiles each TS file via esbuild (or imports directly under tsx in dev mode), and builds a route table. Spatial navigation is automatic — arrow keys move to the nearest focusable item by screen position. You never write a tabIndex.
You can read the if you want to see how the multi-session isolation works (it uses Node's AsyncLocalStorage so each session sees its own runtime context).
Why TypeScript instead of Go or Rust?
I get this question a lot. Honest answer: most existing TUI frameworks are written in Go (), or Python ( + the bundled demos (npx terminaltui demo restaurant, etc.) are the manual.
No Windows ConPTY fast path. Works on Windows via a fallback, but native ConPTY support would speed it up.
No hot-reload for
api/ routes in dev. Pages hot-reload fine; API endpoints currently require a restart.If any of those bother you, the . v1.8.1 is .
If you build something with it, I'd love to see it.
SOCIAL SHARE CARD GENERATOR