subagentic.ai RSS X YouTube GitHub
AI-generated illustration

News

Vercel Labs ships tui 0.2.0, a TypeScript terminal kit agents can drive

Vercel Labs released experimental tui 0.2.0, an Apache-2.0 TypeScript terminal library that compiles to native and lets an agent drive a running app over MCP.

vercelterminalmcpopen-source

Chris Tate (@ctatedev) introduced tui on December 5, 2026, as fast terminal apps in TypeScript, and included the install command npm i tui. The npm registry lists the package as tui 0.2.0 and public. Badges on that page mark it a Vercel Labs experiment under the Apache-2.0 license, and the license badge points at the vercel-labs/tui repository.

The readme calls tui a TypeScript library for terminal apps. runApp runs an app from a view function that draws the whole screen from state, and the library handles keys, paste, the mouse, Unicode widths, and screen diffing. The same file runs on Node.js 24 or later and compiles to one native executable with scriptc. The project says it is experimental and the API will change before 1.0.

On the package page, install is npm install tui, with scriptc as a dev dependency for a native build. Add "type": "module" to package.json so the file runs as an ES module. A native executable needs clang and a linker. node runs the file without compiling it; npx scriptc build writes the executable.

The agents guide is the substance behind Tate's line that one line exposes MCP. Pass agent: agentServer(...) from tui/agent into runApp, and an AI agent can use the app while it runs in the terminal. The sample names the server files and sets allow so a step is allowed only when its component is not dialog. That app's files mcp command is then an MCP server. The docs show adding it with fx mcp add files -- files mcp, or to any agent that takes MCP servers.

Two tools drive the app that is running. snapshot lists every drawn component, with its state, its items, and the actions it takes, along with the screen as text. act runs steps through those actions or through keys. The guide's example types read into a ref named Search, then returns the changes and a new snapshot. If the app is not running, a call says to start it. The app only listens on a socket in a directory only the user can open.

allow decides each step before it runs. A component drawn with agent: "secret" reads its values as [redacted], and one with agent: "hidden" is not listed. Agent changes report the source agent to the component's change callback. For code of your own, createAgent takes what runApp or createTestApp returns and exposes the same snapshot and act; agentTools describes the two as tools for a model. Only an app that imports tui/agent carries that code. createTestApp can also run an app with no terminal so a test presses keys, types, clicks, and reads the screen back.

Startup, speed, size, and memory figures in the post and the readme are the project's own benchmark, run with pnpm bench:node-vs-native, not an independent measurement. The readme says native executables start in about 2 ms and are up to 80 times faster to the first frame than Node.js. It says the binary is about 50 times smaller than the Node.js runtime, about 2.2 MB stripped, and uses about 20 times less memory, about 4 MB versus 93 MB. Tate's post states the same ratios and a startup of about 2 ms.

The registry page lists zero dependencies and three versions.

Read the agents guide, then install tui on Node.js 24 or later and try agentServer on a small app. Treat 0.2.0 as experimental: the project says the API will change before 1.0.

Sources