Getting started
OpenTUI is a native terminal UI core written in Zig with TypeScript bindings.
It renders a component tree, lays it out with Flexbox, handles terminal input, and updates the cells that changed. OpenTUIās TypeScript packages call the native Zig library through an internal ABI. OpenTUI powers OpenCode in production.
Start with the quickstart#
Build your first app in the quickstart. You will create a project from an empty directory, compose a small interface, handle keyboard input, and run it in your terminal.
The quickstart uses @opentui/core directly to teach the renderer, component tree, input, and layout model once. You
do not need to choose a framework before you complete it.
Check Runtime and platform support before you use Node.js, cross-compile, or deploy to another target.
Choose a framework#
@opentui/coreuses imperative renderables and events directly.@opentui/reactuses React components, hooks, and state.@opentui/soliduses Solid components, signals, and effects.
If you use Core, read Renderables after the quickstart.
Find a topic#
- Components compares component availability across Core, React, and Solid.
- Renderer covers terminal setup, the root, scheduling, and central events.
- Layout covers Yoga-based sizing and positioning.
- Interaction, focus, and selection explains shared pointer and focus behavior.
- Testing renders apps in memory for assertions and snapshots.
- Package entry points lists supported import paths.
- Lifecycle and cleanup owns terminal restoration and resource release.
Explore the examples#
Run the OpenTUI example browser without cloning the repository. Release executables support macOS x64 and arm64, Linux x64, and Windows x64. On those targets, including x64 WSL and Git Bash:
curl -fsSL https://raw.githubusercontent.com/anomalyco/opentui/main/packages/examples/install.sh | shOn Windows, download the latest release from GitHub Releases.
Give an agent the docs#
OpenTUI includes a skill that teaches AI coding assistants its APIs and patterns. Install it with
npx skills:
npx skills add anomalyco/opentui --skill opentuiAdd -g to install the skill globally for every project. OpenCode uses the same install command.