opentui

Build terminal user interfaces with OpenTUI Core, React, or Solid APIs.

Updated Sep 5, 2023
One-click install
npx skills add https://github.com/eyenalxai/dotfiles --skill opentui-eyenalxai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opentui
Source: https://github.com/eyenalxai/dotfiles/tree/main/.agents/skills/opentui
Command: npx skills add https://github.com/eyenalxai/dotfiles --skill opentui-eyenalxai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @opentui/core, @opentui/react, @opentui/solid, @opentui/keymap, and includes references (resource) components.

What problem does it solve? Building terminal user interfaces requires navigating OpenTUI's three framework APIs (Core, React, Solid), its Yoga/Flexbox layout system, keyboard and keymap handling, animations, and testing utilities, and this Skill provides decision trees and structured references so you write correct TUI code without guessing component names or APIs. ## Core Features & Use Cases - Framework Selection & Quick Starts: Decision trees route you to Core (imperative), React, or Solid reconcilers, with correct create-tui scaffolding commands and critical rules like avoiding process.exit(). - Component & Layout References: Categorized docs for text display, containers, inputs, code/diff viewers, plus Flexbox layout, keyboard input, layered keymaps, timeline animations, and snapshot testing. - Use Case: You need to build a terminal dashboard with a scrollable log view, a text input, and Ctrl+S save shortcut. The Skill directs you to components/containers.md for scrollbox, components/inputs.md for the input, and keyboard/REFERENCE.md for the shortcut, with working code examples for your chosen framework. ## Quick Start Ask the assistant to scaffold a new OpenTUI app with create-tui and build a boxed layout containing styled text and a keyboard-driven menu.

Frequently Asked Questions about opentui

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new OpenTUI project?

Run `bunx create-tui@latest -t react my-app` (or `-t core` / `-t solid`), then `cd my-app` and run the entry file with Bun. The template flag must come before the directory name, and the target directory must not already exist.

Should I use OpenTUI Core, React, or Solid?

Use Core for maximum control, smallest bundle, or when building a framework on top of OpenTUI. Use React if your team knows React patterns, and Solid for fine-grained signal-based reactivity with optimal re-rendering.

How do I handle keyboard shortcuts in OpenTUI?

Use `renderer.keyInput.on("keypress", ...)` in Core or the `useKeyboard` hook in React and Solid, checking `key.name` and modifier flags like `ctrl` and `shift`. For layered bindings, leader keys, and sequences, use the separate `@opentui/keymap` package.

Does OpenTUI work with Node.js or only Bun?

Bun is the reference runtime, but Node.js 26.4.0 or later is supported for the native renderer when launched with `--experimental-ffi`. The `@opentui/keymap` package is pure JavaScript and imports in Node without FFI.

How do I test an OpenTUI terminal application?

Use `createTestRenderer` from `@opentui/core/testing` for headless rendering, or `testRender` from `@opentui/react/test-utils` or `@opentui/solid`. Call `renderOnce()`, capture frames with `captureCharFrame()`, and use Bun's snapshot testing with `bun test --update-snapshots`.

Why is text styling not applying in my OpenTUI React app?

Text styling in React and Solid requires nested modifier elements like `<strong>`, `<em>`, `<u>`, and `<span fg="red">` inside `<text>`, not style props. In Core, use `TextAttributes` flags or the `t` template literal with helpers like `bold()` and `fg()`.