
Opentui
Build terminal user interfaces with React components, keyboard handling, and OpenTUI renderers for CLI tools and agent-facing TUIs.
Overview
OpenTUI is an agent skill for the Build phase that helps you create React-based terminal UIs with OpenTUI core and familiar hooks-driven patterns.
Install
npx skills add https://github.com/anomalyco/opentui --skill opentuiWhat is this skill?
- React bindings on @opentui/react with createRoot and createCliRenderer
- Documented intents: react, jsx, hooks, keyboard, paste, focus, blur, selection, animation, testing
- Quick start via bun create tui --template react or manual @opentui/core install
- TypeScript config guidance with ESNext target and DOM lib for terminal components
- Entry doc skill for the OpenTUI docs collection with ordered nav
- Docs skill entry lists 10 intent topics including react, hooks, keyboard, paste, focus, blur, selection, animation, and
Adoption & trust: 1k installs on skills.sh; 11.7k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need a polished in-terminal interface for your CLI or agent but do not want to maintain low-level TTY drawing code.
Who is it for?
Indie devs building interactive CLIs, local coding agents, or terminal dashboards with React mental models.
Skip if: Web-only React apps, native mobile UI, or projects with no Bun/Node toolchain when you refuse a terminal dependency.
When should I use this skill?
User asks for React terminal UI, OpenTUI setup, TUI keyboard or focus behavior, or create-tui React template wiring.
What do I get? / Deliverables
Your agent produces OpenTUI React setup, renderer wiring, and component examples aligned with the official docs intents.
- OpenTUI renderer and createRoot bootstrap code
- tsconfig.json snippet for terminal React
- Component examples using text and interaction intents
Recommended Skills
Journey fit
OpenTUI is a build-phase skill for implementing interactive terminal UI rather than researching or launching a product. Frontend subphase is the canonical shelf because the skill centers on React JSX, hooks, focus, and rendering patterns in the terminal.
How it compares
Terminal React UI kit guidance, not a generic Create React App or Next.js web frontend skill.
Common Questions / FAQ
Who is opentui for?
Solo builders shipping CLI or agent tools who want React-style components rendered in the terminal via OpenTUI.
When should I use opentui?
During Build when implementing frontend-style terminal screens, keyboard flows, or TUI prototypes for developer-facing products.
Is opentui safe to install?
It documents local package installs and standard dev dependencies; check the Security Audits panel on this Prism page before pulling skills from external repos.
SKILL.md
READMESKILL.md - Opentui
import { defineCollection, z } from "astro:content" const docs = defineCollection({ type: "content", schema: z.object({ title: z.string(), description: z.string().optional(), order: z.number().int().nonnegative().optional(), navTitle: z.string().optional(), skill: z .object({ include: z.boolean().default(true), entry: z.boolean().default(false), intents: z.array(z.string().trim().min(1)).default([]), }) .optional(), }), }) export const collections = { docs, } --- title: React description: Build terminal UIs with React and OpenTUI order: 2 skill: entry: true intents: [react, jsx, hooks, keyboard, paste, focus, blur, selection, animation, testing] --- # React bindings Build terminal user interfaces using React with familiar patterns and components. ## Installation Quick start with [bun](https://bun.sh) and [create-tui](https://github.com/msmps/create-tui): ```bash bun create tui --template react ``` Manual installation: ```bash bun install @opentui/react @opentui/core react ``` ## Quick start ```tsx import { createCliRenderer } from "@opentui/core" import { createRoot } from "@opentui/react" function App() { return <text>Hello, world!</text> } const renderer = await createCliRenderer() createRoot(renderer).render(<App />) ``` ## TypeScript configuration Configure your `tsconfig.json`: ```json { "compilerOptions": { "lib": ["ESNext", "DOM"], "target": "ESNext", "module": "ESNext", "moduleResolution": "bundler", "jsx": "react-jsx", "jsxImportSource": "@opentui/react", "strict": true, "skipLibCheck": true } } ``` ## Runtime-loaded plugin support (if needed) If your app loads external TS/TSX modules at runtime (for example a file-based plugin system), import this once in your app entry before dynamic imports: ```ts import "@opentui/react/runtime-plugin-support" ``` Use this for both normal Bun runs and standalone compiled executables. ## Components OpenTUI React provides JSX intrinsic elements that map to core renderables: ### Layout & display - `<text>` - Text display with styling - `<box>` - Container with borders and layout - `<scrollbox>` - Scrollable container - `<ascii-font>` - ASCII art text QR code support is available from `@opentui/qrcode/react` and must be registered explicitly with `registerQRCode()`. ### Input - `<input>` - Single-line text input - `<textarea>` - Multi-line text input - `<select>` - Selection list - `<tab-select>` - Tab-based selection ### Code & diff - `<code>` - Syntax-highlighted code - `<line-number>` - Line numbers with diff/diagnostic support - `<diff>` - Unified or split diff viewer - `<markdown>` - Markdown rendering ### Text modifiers Use inside `<text>` components: - `<span>` - Inline styled text - `<strong>`, `<b>` - Bold text - `<em>`, `<i>` - Italic text - `<u>` - Underlined text - `<br>` - Line break - `<a>` - Link text ## API reference ### `createRoot(renderer)` Creates a React root for rendering into the terminal. ```tsx import { createCliRenderer } from "@opentui/core" import { createRoot } from "@opentui/react" const renderer = await createCliRenderer() createRoot(renderer).render(<App />) ``` For plugin slots, see [Plugin Slots overview](/docs/plugins/slots) and [React slots](/docs/plugins/react). ## Hooks ### `useRenderer()` Access the OpenTUI renderer instance. ```tsx import { useRenderer } from "@opentui/react" import { useEffect } from "react" function App() { const renderer = useRenderer() useEffect(() => { renderer.console.show() console.log("Hello from console!") }, []) return <box /> } ``` ### `useKeyboard(handler, options?)` Handle keyboard events. ```tsx import { useKeyboard, useRenderer } from "@opentui/react" function App() { const renderer = useRenderer() useKeyboard((key) => { if (key.name === "escape") { renderer.destroy() } }) return <text>Press ESC to close</text> } ``