Guide · Open source
How to use OpenTUI: build terminal interfaces in TypeScript
Updated · written with AI from the project's own documentation and checked against our catalogue data
OpenTUI is an open-source library for building text-based user interfaces that run in a terminal. You write the interface in TypeScript, either directly or through React or Solid, and arrange boxes and text with flexbox. This guide explains the packages, the development setup described in the README, and what the library is and isn't suited for, so you can decide whether to start a project with it.
Quick start
- 1Check prerequisites. Install Bun 1.4.1 or later and Zig 0.16.0, as the README requires for development.
- 2Get the source. Clone the anomalyco/opentui repository, since the README's commands run from its root.
- 3Install dependencies. From the repository root, run bun install.
- 4Pick a renderer. Choose @opentui/core directly, or @opentui/react or @opentui/solid if you prefer those component models.
- 5Run checks. From the repository root, run bun run test, bun run fmt:check and bun run lint.
- 6Read the docs. Use the documentation at opentui.com/docs for API details, since the README points there.
What OpenTUI is and what it includes
OpenTUI is a library to build terminal user interfaces. The README says the library is written in Zig, and that you write TypeScript directly or through React and Solid.
Layout is done with flexbox, and the library provides selects, inputs, and scroll boxes that respond to keyboard and mouse controls. The README also mentions playing sounds, showing images, and rendering 3D graphics.
- @opentui/core: native terminal UI library with TypeScript bindings
- @opentui/react: React renderer for OpenTUI Core
- @opentui/solid: Solid renderer for OpenTUI Core
- @opentui/keymap: key binding and command routing for terminal and browser applications
- @opentui/qrcode: QR code encoder and renderable with React and Solid surfaces
- @opentui/three: Three.js WebGPU renderer for OpenTUI
- @opentui/ssh: SSH server integration for OpenTUI applications
Prerequisites for the development workflow
The README states that development requires Bun 1.4.1 or later and Zig 0.16.0. If you cannot use these tools, the README's development workflow will not work for you.
Install the repository's dependencies from the repository root with the command below.
- Bun 1.4.1 or later
- Zig 0.16.0
bun installRun tests and checks
Run package scripts from their package directory. Run repository tests and static checks from the repository root using the commands below.
Run bun run build from the repository root after you change native code or cross-package build outputs. The README says ordinary TypeScript changes do not require a root build.
bun run test
bun run fmt:check
bun run lintLink source packages into an existing project
To link the source packages into a Bun-managed project, install that project's dependencies first. Then run the linking script from the OpenTUI repository root, passing the path to your project.
Add --react or --solid to the script when you need those renderers.
./scripts/link-opentui-dev.sh /path/to/projectAdd the OpenTUI documentation as an AI agent skill
The README describes an optional skill that installs the OpenTUI documentation into an AI coding assistant using npx skills. Add -g to install it globally.
The README says the skill matches the latest release, and npx skills update moves it to each new release. Installing from the docs/next address follows the main branch instead.
npx skills add https://opentui.com --skill opentuiWhat people use it for
- Building an interactive terminal application in TypeScript with boxes, text and scroll areas
- Making a command-line tool with selects and inputs that respond to mouse and keyboard
- Using a React component model to build terminal screens
- Using a Solid renderer for terminal interfaces
- Providing a terminal interface over SSH with @opentui/ssh
Frequently asked questions
Is OpenTUI free to use?
The README states OpenTUI is licensed under the MIT License. Check the LICENSE file in the repository for the full terms.
What do I need to install OpenTUI?
The README lists Bun 1.4.1 or later and Zig 0.16.0 as prerequisites for development. Its install command shown is bun install, run from the repository root.
Does OpenTUI work with React?
Yes. The @opentui/react package is described in the README as a React renderer for building terminal user interfaces with OpenTUI Core.
What are alternatives to OpenTUI?
Comparable projects include Ink, Blessed, Bubble Tea and Textual. Pick based on your language and component model, since OpenTUI is TypeScript-based.
Is OpenTUI suitable for a simple script?
Probably not. The library adds a rendering layer to learn, so a one-off command-line script may be simpler without it.
Who uses OpenTUI in production?
The README states that OpenCode uses OpenTUI in production. The README does not give further details about its use.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
OpenTUI suits developers building interactive terminal applications in TypeScript, especially those who want React or Solid component models and mouse and keyboard support. If you only need a simple script, or cannot use Bun and Zig for the development workflow, choose a lighter tool or an alternative such as Ink or Textual.
Install options & downloads