OpenTUI
A Zig-based library for building terminal user interfaces with TypeScript, React, and Solid bindings.
At a Glance
About OpenTUI
OpenTUI is an open-source library for building terminal user interfaces, developed by Anomaly under the anomalyco GitHub organization. Its core is written in Zig with TypeScript bindings, and it offers React and Solid renderers. The project states that OpenCode uses it in production.
What It Is
OpenTUI is a native terminal UI core that renders a component tree, lays it out with Flexbox (Yoga-based), handles terminal input, and updates only the cells that changed. Developers write TypeScript directly against @opentui/core using imperative renderables, or use React components and hooks or Solid components and signals. Interface elements include selects, inputs, and scroll boxes with keyboard and mouse controls, and the project says apps can play sounds, show images, play videos, and render 3D graphics.
Packages and Bindings
The monorepo ships several packages: core, React and Solid renderers, a keymap library for key binding and command routing, a QR code encoder and renderable, a Three.js WebGPU renderer, and SSH server integration for OpenTUI applications. The documentation also covers in-memory rendering for assertions and snapshots, lifecycle and terminal restoration, and native C and Zig interfaces.
Setup Path
The quickstart creates a project from an empty directory, composes a small interface, handles keyboard input, and runs it in the terminal. An example browser is available as release executables for macOS (x64 and arm64), Linux x64, and Windows x64. Development of the library itself requires Bun and Zig.
AI Agent Skill
OpenTUI provides a skill that teaches AI coding assistants its APIs and patterns, containing the docs and release notes. It installs with npx skills add https://opentui.com --skill opentui, and can follow either the latest release or the main branch.
Community Discussions
Be the first to start a conversation about OpenTUI
Share your experience with OpenTUI, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
OpenTUI core library and packages are licensed under the MIT License, free to use, modify and distribute.
- MIT License
- Written in Zig with TypeScript bindings
- React and Solid renderers
- Flexbox layout
- Selects, inputs, and scroll boxes with keyboard and mouse controls
Capabilities
Key Features
- Native Zig core with TypeScript bindings
- React and Solid renderers
- Flexbox layout via Yoga
- Select, input, and scroll box components with keyboard and mouse support
- Sound, image, video, and 3D graphics rendering
- Differential cell updates
- In-memory testing with snapshots
- Keymap and command routing package
- QR code renderable
- Three.js WebGPU renderer
- SSH server integration
- AI agent skill for coding assistants
- Example browser executables
