Sulat.com / Writing on AISaturday, December 5, 2026
Enter →
Agent Engineering/5 December 2026

Vercel’s tui builds terminal apps in TypeScript and compiles them to native

Vercel Labs' tui draws terminal apps from TypeScript state and compiles them into a 2.2 MB native file. I ran Vercel's benchmark, compared it with Ink, Bubble Tea and Ratatui, and had seven models build with it.

3D Vercel triangle logo beside a glowing terminal dashboard with coloured bars and a globe, for the tui terminal UI library
Illustration: Sulat, featuring the Vercel logo

At a glance

  • Vercel Labs' tui is a TypeScript library for terminal apps that runs on Node 24 or compiles to one native executable with scriptc.
  • On our VM the native build reached its first screen about 54 times faster than Node and used about 25 times less memory, from a 2.2 MB file.
  • Once an app is running, native isn't faster: frame time was 0.040 ms native and 0.039 ms on Node.
  • Against a one-screen app in other libraries, native tui started in 3.7 ms, behind Ratatui at 2.6 ms and ahead of Bubble Tea at 5.4 ms and Ink at 289 ms.
  • scriptc refuses to build code with type errors that Node runs anyway.
  • Seven models built five tui apps and drove a running one over MCP, and every one passed every task.

Vercel Labs has released tui, a TypeScript library for terminal apps that can also be compiled into a native executable. Chris Tate, who works at Vercel, announced it with the pitch that it starts in about 2 ms, runs the same code on Node, compiles to native with a tool called scriptc, and exposes an app to agents with one line of MCP.

Chris Tate’s launch post for tui, from Vercel.

The post also claims up to 80 times faster, 50 times smaller and 20 times less memory than Node. I installed tui, ran Vercel’s own benchmark on a clean Linux VM, built the same one-screen app in Ink, Bubble Tea and Ratatui for a fair comparison, and had seven models build five apps with it and drive a running one over MCP. The headline numbers hold up, with one caveat about what “native” buys you once an app is running.

Diagram: one app.ts runs with node app.ts or builds with scriptc into a 2.2 MB native file with no Node
The same TypeScript file runs on Node or builds into one native executable. Illustration: Sulat

What tui is

tui is Apache-2.0 licensed and published as the npm package tui at version 0.2.0. Vercel labels it a Labs experiment and says its API will change before 1.0. You write a view function that draws the whole screen from your state on every frame, and tui handles keys, paste, the mouse, Unicode widths and screen diffing. It needs Node 24 or later.

Here’s the example from its README, a list you can pick from:

Code
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)
  },
})

The same file runs two ways. node app.ts runs it directly, since Node 24 strips the types. npx scriptc build app.ts -o app compiles it through LLVM into one executable. The component set covers Listbox, CheckboxGroup, Tabs, Table, Input, Textarea, Dialog and ScrollArea, plus prompts, markdown, charts, images, springs and shaders.

The repository ships animated demos. These two are real native builds of its koi and fireworks examples, rendered from a terminal session.

The koi example, built to a native executable and run in a terminal.
The fireworks example, also native. The frame rate on screen is slower than normal because the recording tool was drawing every frame.

The test machine

Everything ran on one Linux VM: 4 vCPUs (Intel Xeon at 2.30 GHz, under KVM), 15 GiB of RAM, a 252 GB disk, Ubuntu 24.04.5 and kernel 6.18. Node was 24.23.0, tui 0.2.0 and scriptc 0.5.0. Model runs used opencode 1.19.6. The benchmarks ran with the machine otherwise idle.

Vercel’s benchmark, reproduced

The repository includes a benchmark script that compares native builds with Node for three programs, using a pseudo-terminal at 120 by 40 and medians over 30 starts. I ran it unchanged.

ProgramFirst screen, nativeFirst screen, NodePeak memory, nativePeak memory, Node
hello2.26 ms122.29 ms3.7 MB95.5 MB
chat2.33 ms126.12 ms3.8 MB94.9 MB
table-10k3.86 ms134.04 ms5.7 MB96.9 MB
Medians from Vercel’s own benchmark script on our VM.

That’s 54 times faster to the first screen for hello and chat, 35 times for the 10,000-row table, and 17 to 25 times less memory. It didn’t reach the 80 times in the launch post, but the order of magnitude is right. Disk size matches the 50 times claim: a native hello is 2.2 MB, against 127 MB for the Node runtime it replaces, about 58 times smaller.

Infographic: native tui first screen 2 ms versus 122 ms on Node, 4 MB versus 95 MB memory, one 2.2 MB file
Native versus Node for the same tui hello app. Illustration: Sulat

Once an app is running, native stops being faster. Scrolling 10,000 rows takes 0.040 ms per frame at the median in the native build and 0.039 ms on Node. Native does use less CPU while animating, 0.5 percent against 2.5 percent, and while streaming, 0.5 against 2.0. The win is start time, memory and shipping one file, not drawing speed.

Against Ink, Bubble Tea and Ratatui

Vercel’s benchmark only compares tui with itself, so I built the smallest possible app in four libraries: draw the line Count: 0 once and exit. The versions were Ink 8 on Node 24, Bubble Tea 1.3.11 on Go 1.24.7 and Ratatui 0.30.2 on Rust 1.97. Each ran 30 times in a pseudo-terminal for start-to-exit time, and nine times with a launcher that reads the true peak memory.

LibraryStart to exitPeak memoryBinary
Ratatui (Rust)2.6 ms2.5 MB0.8 MB
tui, native3.7 ms3.5 MB2.2 MB
Bubble Tea (Go)5.4 ms4.8 MB3.9 MB
tui on Node 2496.4 ms80.8 MBneeds Node
Ink on Node 24289.1 ms91.3 MBneeds Node
Medians. Ratatui is faster and smaller than native tui; tui beats Bubble Tea.
Bar chart of time to first screen: Ratatui 2.6 ms, tui native 3.7 ms, Bubble Tea 5.4 ms, tui on Node 96.4 ms, Ink 289.1 ms
Native tui lands between Ratatui and Bubble Tea; on Node it’s about 96 ms. Illustration: Sulat

So native tui sits with the compiled-language libraries, behind Ratatui and ahead of Bubble Tea, and it’s three times faster to start than Ink even when it runs on Node. A one-screen app is a thin test, and it says nothing about how the libraries compare on large screens or complex layouts.

What scriptc is strict about

scriptc runs the TypeScript compiler’s checks before it generates anything. Node only strips types, so a type error runs happily. I gave both the same app with one deliberate mistake:

Code
const count: number = "three"

Node 24 ran it and drew Count: three. scriptc stopped:

Code
app.ts:2:7 - error SC0001: Type 'string' is not assignable to type 'number'.

  1 | import { runApp, text, type Frame } from "tui"
  2 | const count: number = "three"
    |       ^~~~~

1 error.
Infographic: Node runs a TypeScript type error anyway, while scriptc stops the build and says why
Node strips types and runs; scriptc refuses to build. Illustration: Sulat

It’s the same code, so a file that builds natively is also a file that Node runs correctly. The costs come at build time. scriptc reports TypeScript features it doesn’t support with error codes rather than guessing, it needs clang and a linker, and it leaves a roughly 10 MB LLVM .ll file next to every executable it writes.

Seven models build five apps

I also wanted to know whether models can use it. I gave seven models the same five prompts in opencode with tui and scriptc already installed in an empty folder: Kimi K3.1 Pro, DeepSeek V4.1 Flash, Claude Haiku 5.5, GPT-6.2 Sol, Gemini 4 Neon, MiniMax M4 and GLM 5.4. Each model had to write app.ts, run it, build the native version and check both. Then a separate script drove every app in a pseudo-terminal and checked the screen, once on Node and once as the native build. These are the prompts, verbatim:

Code
Build a terminal counter app in TypeScript using the tui npm package (already installed in this folder, along with scriptc). Put it in app.ts. The screen shows the line `Count: 0`. Pressing + or the up arrow adds one, pressing - or the down arrow subtracts one, pressing r resets it to zero, and pressing q quits with exit code 0. It must run with `node app.ts`. Then run `npx scriptc build app.ts -o app` and make sure the native build works too. Check your work by running it.
Code
Build a terminal todo app in TypeScript using the tui npm package (already installed in this folder, along with scriptc). Put it in app.ts. A text input sits on the bottom row with the placeholder `Add a task`. Typing text and pressing Enter adds it to a list above the input, one task per line, and clears the input. The first line of the screen is a header reading `Tasks: N`, where N is the number of tasks, starting at `Tasks: 0`. Ctrl+C quits with exit code 0. It must run with `node app.ts`. Then run `npx scriptc build app.ts -o app` and make sure the native build works too. Check your work by running it.
Code
Build a live CPU dashboard in TypeScript using the tui npm package (already installed in this folder, along with scriptc). Put it in app.ts. The title row reads `CPU`. Below it are four rows labelled `core 0` to `core 3`, each with a coloured horizontal bar and a percentage such as `42%`. The values drift smoothly with a random walk and the screen redraws about five times a second. Pressing q quits with exit code 0. It must run with `node app.ts`. Then run `npx scriptc build app.ts -o app` and make sure the native build works too. Check your work by running it.
Code
Build a terminal process monitor in TypeScript using the tui npm package (already installed in this folder, along with scriptc). Put it in app.ts. It shows a table with the header row `Name`, `CPU`, `Mem` and these six rows in this order: nginx 12 340, postgres 48 1200, redis 7 150, node 33 520, cron 1 12, sshd 2 25 (CPU is a percentage, Mem is in MB). The up and down arrows move the selected row, which is highlighted. Pressing s sorts by CPU, highest first; pressing s again sorts by name, A to Z. Pressing Enter on the selected row opens a dialog reading `Details: <name>` for that row, and Escape closes it. Pressing q quits with exit code 0. It must run with `node app.ts`. Then run `npx scriptc build app.ts -o app` and make sure the native build works too. Check your work by running it.
Code
Build a terminal log viewer in TypeScript using the tui npm package (already installed in this folder, along with scriptc). Put it in app.ts. It reads the file named by its first command line argument, such as `node app.ts sample.log`, which is in this folder. The first line of the screen is a header reading `Lines: N`, where N is the number of lines currently shown, and the log lines are listed below it. A text input on the bottom row has the placeholder `Filter`; as you type, only the lines containing the text (case-sensitive) stay in the list and the header count updates. Ctrl+C quits with exit code 0. It must run with `node app.ts sample.log`. Then run `npx scriptc build app.ts -o app` and make sure the native build works too, running it the same way. Check your work by running it.

Every model passed every task, on Node and as a native build: 35 of 35 apps each way. No model needed a second attempt, so the library is easy to pick up from its README and types. The apps look right too.

Terminal screenshot of a CPU dashboard with four coloured bars for core 0 to core 3, built by Kimi K3.1 Pro with tui
The CPU dashboard Kimi K3.1 Pro built, running as a native binary.
Terminal screenshot of a sorted process table with node highlighted and a Details: node dialog, built by Claude Haiku 5.5
Claude Haiku 5.5’s process monitor with the details dialog open.
Terminal screenshot of a log viewer showing Lines: 50 after filtering to ERROR, built by GPT-6.2 Sol with tui
GPT-6.2 Sol’s log viewer after typing ERROR into the filter.

Time was the only thing that separated them. The seven ran at once, so treat these as a rough guide rather than a ranking.

ModelTotal agent time, five tasksSlowest task
GPT-6.2 Sol285 s65 s (process monitor)
DeepSeek V4.1 Flash419 s242 s (process monitor)
Gemini 4 Neon492 s118 s (todo)
Kimi K3.1 Pro638 s175 s (todo)
Claude Haiku 5.51,117 s370 s (log viewer)
MiniMax M41,575 s591 s (process monitor)
GLM 5.42,280 s589 s (process monitor)
Active session time per model, summed over the five tasks. A smoke test, not a benchmark.
Pass matrix: seven models each passed five tui build tasks, five native builds and two agent-drive tasks
Every model passed every task in the end, so the eval didn’t separate them. Illustration: Sulat

An agent driving the app over MCP

The launch post’s last claim is that one line exposes an app to agents. Adding agent: agentServer({ name }) to runApp starts an MCP server with two tools. snapshot returns the app’s components, their state and the screen. act takes steps such as typing into an input or selecting a list item. I built a small file picker with a search box and a list of eight files, compiled it natively, and connected it to opencode as an MCP server. scriptc rejected the native build with error SC0001 until I added an allow function to the server options.

Diagram: a running terminal app exposes snapshot and act tools so an agent can read its state and type or select
Two tools let an agent read a running app and act on it. Illustration: Sulat

Each model got two prompts against a fresh copy of the app, and I read the app’s state afterwards through the same MCP interface. These are the prompts:

Code
A terminal app called files is already running, and a files MCP server is connected to it. Use that MCP server's tools to select the file whose name starts with LIC. Then stop.
Code
A terminal app called files is already running, and a files MCP server is connected to it. Use that MCP server's tools to type docker into the search box, then select the only file that remains in the list. Then stop.

All seven models passed both. Most took under 20 seconds; GLM 5.4 needed 49 seconds and MiniMax M4 118 seconds on the search task. Claude Haiku’s run is below: it reads the app with snapshot, types into the search box and selects the one file left.

Claude Haiku 5.5 typing docker into the search box and selecting Dockerfile through tui’s MCP server.

The first version of the second prompt asked for json, which matches two files, package.json and tsconfig.json. That was my mistake. Claude Haiku, GPT-6.2 Sol, Gemini 4 Neon, MiniMax M4 and GLM 5.4 typed it, saw two matches and stopped to say the premise was wrong. Kimi K3.1 Pro and DeepSeek V4.1 Flash picked package.json and carried on. I changed the prompt to docker and reran everything. Two other runs lost their terminal session mid-run, so I repeated them, and both passed on the repeat.

Who it’s for

tui is a good fit if you build command-line tools in TypeScript and want to ship one small file with no runtime, or if you want a terminal app that an agent can operate through MCP without a screen scraper. The startup and memory claims are real, native does nothing for frame time, and Ratatui still beats it on every number I measured. It’s version 0.2.0 and Vercel says its API will change, so pin the version. Install with npm install tui and npm install -D scriptc, and the repository is vercel-labs/tui.

Disclosure: I’m an OpenAI, Firecrawl and Devin ambassador.