一键导入
opentui
OpenTUI core development with vanilla TypeScript imperative API — components, layout, input, styling, animations, debugging.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
OpenTUI core development with vanilla TypeScript imperative API — components, layout, input, styling, animations, debugging.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create, verify, and improve AGENTS.md files. Minimal, focused, progressive disclosure. Fixes bloat, contradictions, stale info.
Audit and plan website optimisation for AI agents, AI search, LLM discoverability, llms.txt, structured data, and sitemaps.
Build distinctive, production-grade frontend interfaces (websites, components, dashboards, layouts) with polished UI design that avoids generic AI aesthetics.
Generate and validate Awesome list READMEs following sindresorhus/awesome standards.
Scaffold type-safe TypeScript projects with the Better-T-Stack CLI — new projects, features, or troubleshooting.
Build full-stack TypeScript apps with Convex — server functions, schema, auth, file storage, real-time, frontend integration, testing, deployment.
| name | opentui |
| description | OpenTUI core development with vanilla TypeScript imperative API — components, layout, input, styling, animations, debugging. |
Expert assistance for building terminal user interfaces with OpenTUI's imperative API.
# Install dependencies
bun install @opentui/core
# Zig is required for native modules
# Install from: https://ziglang.org/download/
| Component | Purpose | Import |
|---|---|---|
TextRenderable | Text display with styling | import { TextRenderable } from "@opentui/core" |
BoxRenderable | Container with borders/backgrounds | import { BoxRenderable } from "@opentui/core" |
GroupRenderable | Layout containers | import { GroupRenderable } from "@opentui/core" |
InputRenderable | Single-line text input | import { InputRenderable } from "@opentui/core" |
SelectRenderable | Dropdown selection | import { SelectRenderable } from "@opentui/core" |
ScrollBoxRenderable | Scrollable content areas | import { ScrollBoxRenderable } from "@opentui/core" |
CodeRenderable | Syntax-highlighted code | import { CodeRenderable } from "@opentui/core" |
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()
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.
renderer.on("key", (key: KeyEvent) => {
if (key.name === "escape") process.exit(0)
if (key.name === "c" && key.ctrl) process.exit(0)
})
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.
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.
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.
// Enable console overlay
import { consoleOverlay } from "@opentui/core"
renderer.attach(consoleOverlay())
// Now console.log() appears in terminal overlay
console.log("Debug: initialized")
Use /opentui for:
For React-specific development, use /opentui-react
For SolidJS-specific development, use /opentui-solid
For project scaffolding and examples, use /opentui-projects
/sst/opentui (168 code snippets, High reputation).search-data/research/opentui/