OpenTUI is an open-source TypeScript library for building terminal user interfaces (TUIs).
It provides a modular and high-performance foundation for creating interactive CLI-based UI components and applications.
OpenTUI aims to serve as the foundational framework for both opencode and terminaldotshop.
This monorepo includes multiple bindings and reconcilers for various frameworks:
@opentui/core— The standalone core library providing primitives, an imperative API, and renderer.@opentui/solid— SolidJS reconciler for OpenTUI.@opentui/react— React reconciler for OpenTUI.@opentui/vue— Vue reconciler (currently unmaintained).@opentui/go— Go bindings (currently unmaintained).
Latest update: feat(core): allow configuring cursor style (commit 5e41a03) on 2025‑11‑05 by Adictya.
License: MIT
Contributors include: kommander, msmps, Adictya, fezproof, remorses, bhushan6, KurtGokhan, and others.
Requirement: You must have Zig installed on your system to build the packages.
bun install @opentui/coreYou can scaffold a new TUI app using create-tui:
bun create tuibun install
cd packages/core
bun run src/examples/index.tsUse the link-opentui-dev.sh script to test OpenTUI changes in another project without publishing.
Basic usage:
./scripts/link-opentui-dev.sh /path/to/your/projectOptions:
--react— Link@opentui/react--solid— Link@opentui/solidandsolid-js--dist— Linkdistdirectories instead of source--copy— Copydistoutput instead of creating symlinks (requires--dist)
Examples:
./scripts/link-opentui-dev.sh /project/path # Core only
./scripts/link-opentui-dev.sh /project/path --solid # Link core + solid
./scripts/link-opentui-dev.sh /project/path --react --dist
./scripts/link-opentui-dev.sh /project/path --dist --copyNotes:
- Target project must have
node_modulesinitialized. - Source mode enables hot-reloading.
- Use
--distwhen testing build artifacts. - Use
--copyfor symlink-limited environments (e.g. Docker, Windows).
| Name | File | Description | Inputs | Outputs |
|---|---|---|---|---|
Renderable |
packages/core/src/Renderable.ts |
Base class representing a renderable terminal element. | Props (dimensions, content) | Renderable instance |
CliRenderer |
packages/core/src/renderer.ts |
Main TUI renderer managing the render lifecycle in terminal. | Render tree, target stream | Renders UI in terminal |
Timeline |
packages/core/src/animation/Timeline.ts |
Handles animation sequencing and synchronized transitions. | Keyframes, duration | Animation control object |
TextBuffer |
packages/core/src/text-buffer.ts |
Manages text input and display buffer. | String data | Buffer object |
EditorView |
packages/core/src/editor-view.ts |
Provides a full TUI editor abstraction for text editing. | Input events, buffer | Updated editable content view |
KeyHandler |
packages/core/src/KeyHandler.ts |
Maps and handles keyboard input events. | Key events | Action dispatch |
Yoga |
packages/core/src/index.ts |
Layout engine interface for flexbox-style terminal elements. | Layout nodes | Computed layout |
AppContext |
packages/react/src/components/app.tsx |
Context managing CLI renderer and keyboard handler in React. | React context inputs | Context provider |
useAppContext() |
packages/react/src/components/app.tsx |
React hook exposing the OpenTUI app context. | None | { keyHandler, renderer } |
render() |
packages/vue/src/renderer.ts |
Vue-specific terminal rendering entry point. | Vue component | Renders TUI app in console |
extend() |
packages/vue/src/extend.ts |
Extends the Vue TUI renderer with custom renderables. | Custom components | Updated renderer registry |
opentui.go |
packages/go/opentui.go |
Go bindings entry point for OpenTUI core. | Go struct definitions | Exposed TUI bindings |
Focus on the only task that matters: building your codebase! With every developer push, Set In Stone’s Mirror Documentation Agent updates your README.md via a pull request — ready for you to review, edit, and approve.