A native terminal UI core in Zig with TypeScript bindings, powering OpenCode in ...
GitHub RepoImpressions645
View on GitHub
@githubprojectsPost Author

OpenTUI: A Native Terminal UI Core in Zig, with TypeScript Bindings

Ever wanted to build a terminal UI that feels fast and responsive, but didn't want to drop into raw C or Rust? Or maybe you've tried the usual Node.js terminal frameworks and hit performance walls when rendering complex layouts or handling high-frequency updates.

OpenTUI is a fresh approach. It's a native terminal UI core written in Zig, with first-class TypeScript bindings. It's already powering OpenCode in production, so this isn't just a demo. It's real.

What It Does

OpenTUI is a library that lets you build terminal user interfaces using Zig or TypeScript. The core rendering and input handling is written in Zig, which gives you native performance and small binaries. But the TypeScript bindings mean you can use it from Node.js or Bun without writing a single line of Zig yourself.

Under the hood, it handles:

  • Buffered rendering to avoid flicker
  • Event-driven input handling (keyboard, mouse, resize)
  • A simple component model
  • Cross-platform terminal support (Linux, macOS, Windows)

You can think of it as a low-level toolkit for building terminal apps, similar to how React is a UI toolkit for the browser, but focused on the terminal.

Why It's Cool

Zig core, TypeScript surface. This is the standout feature. Zig gives you predictable performance and no hidden runtime overhead. But TypeScript lets most web devs jump in without learning a new systems language. You get the speed where it matters (rendering, event loops) and the convenience where you want it (logic, state, bundling).

Production proven. OpenCode, an open source AI coding assistant, uses OpenTUI for its terminal UI. That means it's been battle tested with real users, real resize events, and real latency constraints. It's not a weekend project.

No heavy dependencies. OpenTUI is minimal. No Electron, no browser runtime, no huge dependency tree. If you want a terminal UI that ships fast and stays small, this is a good candidate.

Binding generation is built in. The TypeScript bindings aren't hand-maintained. They're generated from the Zig API, so they stay in sync and cover the full surface. Less friction when you update.

How to Try It

You can use OpenTUI from Node.js or Bun via npm:

npm install opentui

Or if you want to work with Zig directly:

git clone https://github.com/anomalyco/opentui.git
cd opentui
zig build

There's a TypeScript example in the repo too. Quick peek:

import { Terminal, Box, Text } from 'opentui';

const terminal = new Terminal();
terminal.render(
  <Box width={40} height={10} border>
    <Text>Hello from OpenTUI</Text>
  </Box>
);

Check the README for the full API and more examples.

Final Thoughts

OpenTUI is a solid choice if you want a terminal UI that's fast, tiny, and works with the languages you already use. The TypeScript bindings make it accessible, and the Zig core means it won't slow down under load.

It's still early days, but it's already powering a real product. If you're building a CLI tool, a TUI dashboard, or anything that needs a terminal interface without the bloat, this is worth a look.


Follow @githubprojects for more developer tools, open source projects, and terminal wizardry.

Back to Projects
Last updated: June 17, 2026 at 05:08 AM