OpenTUI: A Zig-Powered Terminal UI Library That Renders 3D and Images
Project brief: OpenTUI is a library for building terminal user interfaces (TUIs).
At a glance
- What is it?
- OpenTUI is a TypeScript-friendly terminal UI library with a native Zig core, offering flexbox layout, React and Solid renderers, plus sound, image, and WebGPU 3D support. It is production-ready per its use in OpenCode, but its development setup demands Bun and Zig.
- Who is it for?
- Adopt OpenTUI if you build terminal tools in TypeScript and need more than text: flexbox layouts, images, sound, or even 3D via WebGPU, and you are comfortable with a native dependency. Skip it if your project must stay pure JavaScript or you cannot install Zig 0.17.0 and Bun 1.4.1 for development.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository received new commits within the last day.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 13, 2026, and from our analysis. They are not legal advice.
Star history
- anomalyco/opentui13,813 ★ · +922
| Repository | 2026-08-04 | 2026-11-13 |
|---|---|---|
| anomalyco/opentui | 12.9k | 13.8k |
922 Stars in the last 101 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
What OpenTUI Solves and Who It Targets
OpenTUI addresses the gap between simple line-based terminal tools and full graphical interfaces. Most TUI libraries like blessed or ink render text and boxes, but they stop at that. OpenTUI goes further: it lets you arrange elements with flexbox, add interactive selects and inputs, and even display images, play sounds, or render 3D graphics in the terminal. This makes it a fit for developers building sophisticated CLI applications, dashboards, or even terminal-based games. The README claims OpenCode uses OpenTUI in production for millions of users, which signals real-world reliability, though you should treat that as a vendor statement, not an independent benchmark. The target user is a TypeScript developer who wants a native-performance UI layer without dropping to Rust or C. If your needs are simple lists and prompts, OpenTUI is overkill; if you want a terminal app that feels like a desktop app, it is designed for you.
The Zig Core and TypeScript Bindings Architecture
The architecture is a split between a native core and language bindings. The core is written in Zig and exposed through TypeScript bindings in the @opentui/core package. This is a deliberate design: Zig gives low-level control over terminal rendering and performance, while TypeScript gives developers a familiar surface. The README lists @opentui/native as a private workspace containing the Zig implementation, native tests, and benchmarks. That means the actual engine is not published as a separate public package; it is bundled or linked into the core. For a user, this means you depend on a compiled native module, which can raise installation complexity compared to pure-JS libraries. The bindings likely use a foreign function interface, but the README does not specify details. The separation also means that when you upgrade @opentui/core, you may get a new native binary, so you should test on your target systems after each upgrade.
Flexbox Layout and Interactive Components
A key differentiator is the use of flexbox for layout. Instead of manually positioning every element with absolute coordinates, you arrange boxes and text using flexbox rules, which is familiar to web developers. The README states you can add selects, inputs, and scroll boxes with keyboard and mouse controls. This suggests a component model where each widget handles its own input events. The interactive layer is not just about text input; it includes mouse support, which many terminal libraries handle poorly. The practical effect is that you can build a form or a file browser with less layout code than with a library like blessed. However, the README does not document the exact flexbox properties or the component API, so you would need to consult the documentation at opentui.com/docs. The learning curve is moderate: if you know CSS flexbox, you can transfer that knowledge, but you still need to learn the OpenTUI-specific component lifecycle.
Getting Started: Commands and Configuration
To use OpenTUI, you install packages via npm. The README gives no direct npm install command, but the packages are listed as @opentui/core, @opentui/react, @opentui/solid, and so on. A typical start would be `npm install @opentui/core` or `bun add @opentui/core`, but you should check the documentation for exact usage. For development from source, the README specifies requirements: Bun 1.4.1 or later and Zig 0.17.0. You run `bun install` at the repository root, then run package scripts from their package directory. After changing native code, you run `bun run build` from the root. For testing and static checks, you run `bun run test`, `bun run fmt:check`, and `bun run lint` from the root. To link the source packages into your own Bun-managed project, you run `./scripts/link-opentui-dev.sh /path/to/project` and optionally add `--react` or `--solid`. These commands assume you have Bun and Zig installed, which is a higher bar than many JS-only projects.
The React and Solid Renderers
OpenTUI offers renderers for React and Solid, meaning you can write your UI using components and hooks, then render them to the terminal. This is similar to how React Native works for mobile. The @opentui/react package is a React renderer that sits on top of the core. This is a major advantage for teams already using React: they can reuse patterns like state management and component composition. The Solid renderer provides an alternative for those who prefer Solid's fine-grained reactivity. The README does not detail how these renderers handle reconciliation or events, but the existence of separate packages suggests they are first-class citizens. Also, the renderer adds an abstraction layer, which can make debugging harder if something goes wrong at the native level.
Advanced Features: Images, Sound, 3D, and SSH
OpenTUI pushes beyond typical TUI boundaries. It can play sounds, show images, and render 3D graphics. The 3D support comes from the @opentui/three package, which is a Three.js WebGPU renderer. This is unusual for a terminal library. It suggests that the terminal emulator you use must support features like inline images or ANSI escape sequences for graphics, which not all terminals do. The @opentui/qrcode package lets you generate QR codes and render them with React or Solid surfaces, which is practical for authentication flows. The @opentui/ssh package provides SSH server integration, so you can expose your TUI app over SSH, like how some tools offer a web UI. These features are impressive, but they also increase the risk of platform-specific behavior. You cannot assume these features work everywhere, so you should test on your target terminals.
Limitations and When It Is the Wrong Tool
OpenTUI is not the right choice for every terminal project. The most obvious limitation is the native dependency: because the core is written in Zig, the package includes a compiled binary. This can cause installation issues on platforms without prebuilt binaries, and the README does not list supported operating systems or architectures. Another limitation is the development setup: you need Bun 1.4.1 or later and Zig 0.17.0 to build from source. If you are contributing or debugging the core, you must master both ecosystems. Also, the private packages like @opentui/native are not on npm, so you cannot inspect the native source directly unless you clone the repository. For simple CLIs that only need text output, a lighter library like Ink or Blessed is simpler and has no native compilation.
Alternatives and How They Differ
The main alternative in the TypeScript ecosystem is Ink, which renders React components to the terminal. Ink is pure JavaScript and uses Yoga for layout, which is also flexbox-based. The difference is that Ink does not have a native core; it runs entirely on Node.js, so installation is trivial and works on any platform that supports Node. Ink also lacks the advanced features of OpenTUI: no built-in image rendering, no sound, no 3D. Another alternative is Blessed, which is older and uses a widget-based API with absolute positioning; it is not flexbox and has a steeper learning curve for layout. Blessed is also pure JavaScript, so it has the same portability advantage. The trade-off is clear: OpenTUI offers features such as images, sound and 3D, but it sacrifices simplicity and portability. If your app must run in constrained environments or on many platforms without native compilation, you should stick with Ink.
Maintenance and Upgrade Cost
The repository shows active development, with releases v0.7.0, v0.8.0, and v0.8.1 pushed within days of each other in October 2026. That suggests a fast release cadence, which can be both good and bad. Good because bugs get fixed quickly; bad because you may need to update frequently to stay current. The README mentions that after changing native code, you must run `bun run build` from the root, and that ordinary TypeScript changes do not require a root build. This indicates that the build process separates native and JS changes, which helps. However, upgrading the @opentui/core package likely brings a new native binary, so you should re-run your test suite on all target platforms. The license is MIT, which is permissive and allows commercial use, but you should review the license file for any caveats. The README also mentions an AI agent skill, which is a novel way to get documentation, but it is not a maintenance factor per se.
Editorial conclusion
Adopt OpenTUI if you build terminal tools in TypeScript and need more than text: flexbox layouts, images, sound, or even 3D via WebGPU, and you are comfortable with a native dependency. Skip it if your project must stay pure JavaScript or you cannot install Zig 0.17.0 and Bun 1.4.1 for development. Before adopting, verify the native binary works on your target platforms and check the @opentui/native package for platform coverage, since the README does not list supported operating systems. Also confirm the MIT license fits your distribution model, and test the SSH package separately if you plan remote access. The core trade-off is that you get performance and advanced features, but you inherit a Zig build chain and a private native package, which may complicate debugging and upgrades.
Frequently asked questions
What is OpenTUI?
A library for building terminal user interfaces, written in Zig, with TypeScript bindings. You write TypeScript directly or through the React and Solid renderers, arrange boxes and text with flexbox, and add selects, inputs and scroll boxes with keyboard and mouse controls.
What TUI library does OpenCode use?
OpenTUI. The README states that OpenCode uses OpenTUI in production for millions of users, which is the one production adoption claim the project makes for itself.
What is opentui used for?
Building terminal user interfaces. The public packages cover the core native library, React and Solid renderers, key binding and command routing, QR codes, a Three.js WebGPU renderer, and SSH server integration, and the same surface can play sounds and show images.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/anomalyco-opentui)Star history chart for your README
[](https://hysenlabs.com/projects/anomalyco-opentui)Was this useful?