OpenTUI: A Zig-Powered Terminal UI Library with React and Solid Bindings
Project brief: OpenTUI is a library for building terminal user interfaces (TUIs).
At a glance
- What is it?
- OpenTUI is a terminal user interface library written in Zig with TypeScript bindings, offering React and Solid renderers, flexbox layout, and optional 3D rendering through Three.js WebGPU. It is the TUI library used by OpenCode in production, and its SSH package makes server-side terminal applications a supported first-class use case.
- Who is it for?
- OpenTUI is a strong choice for TypeScript teams building production terminal UIs, particularly if they already use React or Solid and want component-based development to carry over into the terminal. The Zig 0.16.0 requirement is a concrete dependency to verify before adoption, since Zig's toolchain is less ubiquitous than Node or Bun in most CI environments.
- 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 last received commits 2 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What OpenTUI Solves and Who It Is For
Terminal user interfaces have historically been tied to language-specific libraries: ncurses for C, blessed for Node.js, Textual for Python. OpenTUI targets TypeScript developers who want to write terminal UIs using the same component models they use for web work, with React or Solid, without rewriting their component knowledge for a terminal-specific API.
The library is used by OpenCode in production for an unspecified number of users. OpenCode is the only named production deployment in the README, but its use at scale suggests the library is not experimental in character. The design supports sounds, images, and 3D graphics inside the terminal, which covers use cases that go beyond typical CLI dashboards and status displays.
The Zig Core and TypeScript Binding Architecture
OpenTUI is written in Zig. The native implementation lives in a private workspace called @opentui/native, which contains the Zig source, native tests, and benchmarks. Users of the library interact with @opentui/core, which provides the native terminal UI library with TypeScript bindings compiled from the Zig source.
This split means the performance-critical rendering path runs as native code while the public API is standard TypeScript. The TypeScript bindings expose flexbox layout, input components (selects, inputs, scroll boxes), keyboard and mouse control handlers, and the rendering surface that higher-level packages use.
Flexbox as the layout model is a deliberate choice. It means developers who understand CSS flexbox properties can apply that knowledge to terminal layout without learning a terminal-specific coordinate system. Boxes and text are arranged with the same conceptual model used in browser development.
Installing OpenTUI and Running the First Example
The public packages are published to npm under the @opentui scope. Choose the package that matches your rendering approach:
bun install @opentui/coreFor React-based development:
bun install @opentui/reactFor Solid-based development:
bun install @opentui/solidThe package manager used in the repository is Bun at version 1.4.1. The repository-level build requires Bun 1.4.1 or later and Zig 0.16.0 for compiling the native layer. Ordinary TypeScript changes to the bindings do not require a root build; only changes to native code trigger the need to run bun run build from the repository root.
The example applications are in a private workspace (@opentui/examples) and a standalone examples executable. The README does not include a minimal code sample, but the opentui.com documentation site provides component references and getting-started guidance. To link the source packages into an external project during development, run the provided script:
./scripts/link-opentui-dev.sh /path/to/projectAdd --react or --solid to that command when the target project uses those renderers. After linking, install the project's own dependencies normally.
The Package Ecosystem: Core, React, Solid, SSH, and Three.js
OpenTUI ships seven public packages covering distinct use cases.
@opentui/core is the foundation: the native terminal rendering library with TypeScript bindings. It handles raw terminal output and input.
@opentui/react and @opentui/solid are renderer packages. They allow developers to write terminal UI components using JSX and component lifecycle patterns from React and Solid respectively, with those components rendered to the terminal through the OpenTUI core.
@opentui/keymap handles key binding and command routing and is usable in both terminal and browser contexts. This is notable because it is not terminal-only; the same key binding abstraction works in a browser environment.
@opentui/qrcode provides QR code encoding with renderable output on both React and Solid surfaces.
@opentui/three is a Three.js WebGPU renderer for OpenTUI. This package makes it possible to render Three.js 3D scenes inside a terminal, an unusual capability that the README explicitly lists alongside sounds and images as supported output types.
@opentui/ssh provides SSH server integration, which means an OpenTUI application can serve its terminal interface over SSH without the user having to implement the SSH transport layer manually.
AI Documentation Skill and Development Workflow
OpenTUI ships an AI coding assistant skill through the npx skills tool. Install the OpenTUI documentation as a skill with:
npx skills add anomalyco/opentui --skill opentuiAdd -g to install the skill globally across projects. The skill installs the OpenTUI documentation in a form that AI coding assistants can reference when generating or reviewing code that uses the library.
The development workflow at the repository level uses Bun as the package manager and runtime, and Zig as the native compiler. The root build command rebuilds the native layer and all dependent packages in sequence. Repository-level test and formatting commands are:
bun run test
bun run fmt:check
bun run lintThe linter uses oxlint and the formatter uses oxfmt, both Rust-based tools, consistent with the repository's use of non-JavaScript tooling for the development environment.
Limitations and Comparison with Textual
The Zig 0.16.0 requirement is the most significant adoption barrier for teams without an established Zig toolchain. Zig is not available in most default CI runner images, and its toolchain versioning is strict: the .zig-version file pins the exact version. Teams that need to build from source must add Zig installation to their CI pipeline.
OpenTUI does not have a Python binding. Teams working in Python who need a TUI library should look at Textual, which is a Python-native TUI framework with its own layout engine and component library. Textual runs on any platform with Python and does not require a native compilation step. OpenTUI's strength is its React and Solid component model and its 3D and audio capabilities, which Textual does not offer. The trade-off is the Zig build dependency versus Textual's pure-Python installation.
The @opentui/native and @opentui/examples workspaces are private and not published to npm. Developers who want to study or modify the Zig implementation must clone the full repository and set up the complete development environment.
Maintenance and License
The last push to the repository was on 2026-09-27. The most recent release was v0.5.12, published 2026-09-22, with v0.5.11 on 2026-09-07 and v0.5.10 on 2026-09-01. The three-release pattern in September 2026 shows an active development pace. OpenTUI is licensed under the MIT license. The private packages (@opentui/native, @opentui/examples, @opentui/web) are part of the repository but are not published separately; their source is available under the same repository terms.
Editorial conclusion
OpenTUI is a strong choice for TypeScript teams building production terminal UIs, particularly if they already use React or Solid and want component-based development to carry over into the terminal. The Zig 0.16.0 requirement is a concrete dependency to verify before adoption, since Zig's toolchain is less ubiquitous than Node or Bun in most CI environments. Teams who want a Python-based TUI with the widest Linux compatibility should look at Textual instead. The right first step is to install @opentui/react or @opentui/solid through npm and run the package's bundled examples.
Frequently asked questions
What is OpenTUI used for?
OpenTUI is used for building terminal user interfaces with TypeScript, React, or Solid. It supports standard TUI components like inputs, selects, and scroll boxes, and also enables sound playback, image rendering, and Three.js 3D graphics inside the terminal. OpenCode uses OpenTUI in production.
What TUI library does OpenCode use?
OpenCode uses OpenTUI. The README states this directly and describes OpenCode as a production deployment serving millions of users.
How does OpenTUI compare to Textual or Charm?
OpenTUI provides React and Solid renderers and a Zig-native core, while Textual is a Python-native TUI framework and Charm (which includes Bubble Tea) targets Go. OpenTUI's component model maps to web development patterns; Textual follows Python's ecosystem; Charm/Bubble Tea follows Go's conventions. None of the three are direct replacements because they target different language ecosystems.
What is the difference between a TUI and a CLI?
A CLI (command-line interface) typically runs a command, outputs text, and exits. A TUI (terminal user interface) remains running and renders an interactive layout with components such as input fields, menus, and scroll areas that respond to keyboard and mouse input. OpenTUI builds TUIs, not CLIs.
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)
Community notes