Find your next open-source project

Search by name, purpose, or keyword, or paste a GitHub URL. Start with / to search agent skills (e.g. /pdf)

vercel-labs/tui

Developer ToolsCLI tools

TypeScript library for building terminal UIs that run on Node.js or compile to a native executable.

383
19
TypeScript
Apache-2.0
1 day old
+277 stars in 23h

What it is

tui is a TypeScript library for building terminal applications with an immediate-mode model: you provide a view function that draws the whole screen from your state, and the library handles key input, paste, mouse events, Unicode widths and screen diffing. The same source file can run directly on Node.js 24+ or be compiled into a single native executable with scriptc. The project is explicitly experimental, and its API is expected to change before 1.0. See the README for the full overview.

Install and run a first app

Requirements: Node.js 24 or later and npm. Building a native binary additionally needs clang and a linker; check the Quick Start for platform prerequisites.

$ npm install tui
$ npm install -D scriptc

Add "type": "module" to package.json, then create app.ts:

import { Listbox, runApp, split, text } from "tui"

const fruits = ["Apple", "Banana", "Cherry", "Grape"].map((value) => ({ value, label: value }))
let picked = "nothing yet"

runApp({
  view: (frame) => {
    const [list, footer] = split(frame.rect, "rows", [-1, 1])
    Listbox.Root(frame, { items: fruits, onValueChange: (value) => (picked = value) }, (root) =>
      Listbox.Content(root, list),
    )
    text(frame, 0, footer.y, `Picked: ${picked}`, frame.theme.muted)
  },
})

Run it directly or build a native binary:

$ node app.ts
$ npx scriptc build app.ts -o app
$ ./app

Arrow keys move the selection, Enter picks a fruit, and Ctrl+C quits.

What you can build with

The package includes state-driven components such as Listbox, CheckboxGroup, Tabs, Table, Input, Textarea, Dialog and ScrollArea, plus definePrimitive for building custom components on the same state, focus and change contract. It also provides cursor prompts, Markdown layout, canvas/shader/chart/image drawing, spring and transition animations, filtering and match highlighting, and Unicode-aware text helpers. See the component docs and API reference.

Agent and test integration

tui/agent is an MCP server that lets an agent inspect and act on a running app through snapshot and act. createTestApp runs an app without a terminal so tests can press keys, type, click and read the screen. See the Agents guide and Testing guide.

Constraints

  • Node.js 24+ is required for direct execution; native builds need clang and a linker.
  • The API is experimental and will change before 1.0.
  • The performance figures (about 2 ms startup, a 2.2 MB stripped binary, about 4 MB memory versus 93 MB on Node.js) come from the project's own benchmark, described on the Performance page; they are measured conditions, not a guarantee for every app.
  • Licensed under Apache-2.0.

HotRepo's take

On the HotRepo new-project snapshot dated 2026-12-05, tui recorded 106 stars and 3 forks in a window starting 01:34 UTC that day, ending 06:45 UTC. No all-language daily rank entry or HN discussion is recorded. The signal worth noting is not the star count but the package's design: an immediate-mode terminal UI that runs under Node.js and also compiles to a small native binary, with an MCP server built in for agent-driven inspection. That makes it interesting to TypeScript developers who want terminal interfaces with a testable, agent-operable surface, while the pre-1.0 API warning is the main reason to treat it as exploratory.

Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.

You might also like

  1. vercel-labs/scriptcCompiles a subset of TypeScript and JavaScript into standalone native executables or WebAssembly, without requiring Node.js at runtime.TypeScript6,474
  2. charmbracelet/bubbleteaA Go framework for building interactive terminal apps with the Elm Architecture, suitable for both simple and complex TUIs.Go46,027
  3. earendil-works/piA minimal, extensible AI coding agent harness with a CLI, unified LLM API, agent runtime, and TUI library.TypeScript123,516
  4. ratatui/ratatuiA Rust library for building interactive terminal user interfaces, dashboard and console apps.Rust23,291
  5. timhartmann7/omnysshA free SSH client for sysadmins and homelabbers who want Termius-style dashboards, SFTP and snippets without an account or telemetry.Rust1,236