dimitrigilbert/ai-skills/opentui

Claude Code and agent skill by dimitrigilbert/ai-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

OpenTUI core development with vanilla TypeScript imperative API — components, layout, input, styling, animations, debugging.

Install

npx vskill@latest install dimitrigilbert/ai-skills/opentui

SKILL.md

OpenTUI Core Development

Expert assistance for building terminal user interfaces with OpenTUI's imperative API.

Quick Start

bash
# Install dependencies
bun install @opentui/core
# Zig is required for native modules
# Install from: https://ziglang.org/download/

Core Components

ComponentPurposeImport
TextRenderableText display with stylingimport { TextRenderable } from "@opentui/core"
BoxRenderableContainer with borders/backgroundsimport { BoxRenderable } from "@opentui/core"
GroupRenderableLayout containersimport { GroupRenderable } from "@opentui/core"
InputRenderableSingle-line text inputimport { InputRenderable } from "@opentui/core"
SelectRenderableDropdown selectionimport { SelectRenderable } from "@opentui/core"
ScrollBoxRenderableScrollable content areasimport { ScrollBoxRenderable } from "@opentui/core"
CodeRenderableSyntax-highlighted codeimport { CodeRenderable } from "@opentui/core"

Basic Pattern

typescript
import { createCliRenderer } from "@opentui/core"
import { BoxRenderable, TextRenderable } from "@opentui/core"
async function main() {
const renderer = await createCliRenderer()
const box = new BoxRenderable()
const text = new TextRenderable("Hello, OpenTUI!")
box.add(text)
renderer.getRoot().add(box)
renderer.start()
// Handle Ctrl+C to exit
renderer.on("key", (key) => {
if (key.name === "c" && key.ctrl) {
renderer.destroy()
process.exit(0)
}
})
}
main()

Layout with Yoga (CSS Flexbox)

typescript
import { Yoga } from "@opentui/core"
const group = new GroupRenderable()
group.setStyle({
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
width: 80,
height: 24,
})

See LAYOUT.md for all Yoga properties.

Input Handling

Keyboard Events
typescript
renderer.on("key", (key: KeyEvent) => {
if (key.name === "escape") process.exit(0)
if (key.name === "c" && key.ctrl) process.exit(0)
})
Component Input Events
typescript
const input = new InputRenderable()
input.on("submit", (value: string) => {
console.log("Submitted:", value)
})
input.on("change", (value: string) => {
console.log("Changed:", value)
})

See INPUT.md for complete event handling patterns.

Styling & Colors

typescript
import { Color, parseColor } from "@opentui/core"
// Create colors
const red = new Color(255, 0, 0) // RGB integers
const blue = Color.fromInts(0, 0, 255) // Static method
const green = parseColor("#00FF00") // Parse hex
// Apply styles
box.setStyle({
backgroundColor: red,
foregroundColor: blue,
borderStyle: "double",
paddingLeft: 2,
paddingRight: 2,
})

See STYLING.md for color system and style properties.

Animations

typescript
import { Timeline } from "@opentui/core"
const box = new BoxRenderable()
const timeline = new Timeline({
duration: 1000,
easing: (t) => t * (2 - t), // easeOutQuad
})
timeline.to(box, {
backgroundColor: new Color(255, 0, 0),
}, {
onUpdate: () => renderer.render()
})
timeline.play()

See ANIMATION.md for animation patterns.

Debugging

typescript
// Enable console overlay
import { consoleOverlay } from "@opentui/core"
renderer.attach(consoleOverlay())
// Now console.log() appears in terminal overlay
console.log("Debug: initialized")

When to Use This Skill

Use /opentui for:

  • Building TUIs with vanilla TypeScript/JavaScript
  • Creating custom OpenTUI components
  • Understanding core OpenTUI architecture
  • Performance optimization
  • Low-level debugging

For React-specific development, use /opentui-react For SolidJS-specific development, use /opentui-solid For project scaffolding and examples, use /opentui-projects

Common Tasks

  • Create a form: Use BoxRenderable + InputRenderable components with Yoga layout
  • Handle keyboard shortcuts: Listen to renderer "key" events
  • Make scrollable lists: Use ScrollBoxRenderable with dynamic content
  • Display code: Use CodeRenderable for syntax highlighting
  • Add borders: Use BoxRenderable with borderStyle property

Resources

Key Knowledge Sources

  • OpenTUI GitHub: https://github.com/sst/opentui
  • Context7: /sst/opentui (168 code snippets, High reputation)
  • Research: .search-data/research/opentui/

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dimitrigilbert/ai-skills/opentui/badge)](https://verified-skill.com/skills/dimitrigilbert/ai-skills/opentui)

Something wrong with this skill or its page? Tell us.