opentui
cline/cline
一套用於建構終端使用者介面的全面性 OpenTUI 技能。涵蓋核心命令式 API、React 調和器以及 Solid 調和器。適用於任何 TUI 開發任務,包括元件、佈局、鍵盤處理、動畫及測試。
...展開全部OpenTUI 平台技能
使用 OpenTUI 建置終端使用者介面的綜合技能。請參閱下方的決策樹,找出合適的框架與元件,然後載入詳細參考資料。
關鍵規則
在所有 OpenTUI 程式碼中請遵循以下規則:
- 新專案請使用
create-tui。請參閱框架REFERENCE.md快速入門指南。 create-tui選項必須置於參數之前。bunx create-tui -t react my-app有效,bunx create-tui my-app -t react則「不」行。- 切勿直接呼叫
process.exit()。請使用renderer.destroy()(參見core/gotchas.md). - 在 React/Solid 中,文字樣式設定需要使用嵌套標籤。請使用修飾元素,而非 props(參見
components/text-display.md).
如何運用這項技巧
參考檔案結構
框架參考文件遵循 5 檔案模式。橫向概念則以單一檔案指南呈現。
每個框架在 ./references/ 包含:
位於 ./references/ 中的 REFERENCE.md 作為入口點。
閱讀順序
- 請從
REFERENCE.md您所選擇的框架 - 接著閱讀與您的任務相關的附加檔案:
- 建置元件 ->
api.md+components/.md - 設定專案 ->
configuration.md - 版面配置/定位 →
layout/REFERENCE.md - 鍵盤/輸入處理 ->
keyboard/REFERENCE.md - 動畫 ->
animation/REFERENCE.md - 疑難排解 ->
gotchas.md+testing/REFERENCE.md
- 建置元件 ->
範例路徑
./references/react/REFERENCE.md # Start here for React
./references/react/api.md # React components and hooks
./references/solid/configuration.md # Solid project setup
./references/components/inputs.md # Input, Textarea, Select docs
./references/core/gotchas.md # Core debugging tips
執行時注意事項
OpenTUI 本程式在 Bun 上執行,並使用 Zig 進行原生建置。請參閱 ./references/core/gotchas.md 以了解執行時需求與建置指引。
快速決策樹
「我該使用哪個框架?」
Which framework?
├─ I want full control, maximum performance, no framework overhead
│ └─ core/ (imperative API)
├─ I know React, want familiar component patterns
│ └─ react/ (React reconciler)
├─ I want fine-grained reactivity, optimal re-renders
│ └─ solid/ (Solid reconciler)
└─ I'm building a library/framework on top of OpenTUI
└─ core/ (imperative API)
「我需要顯示內容」
Display content?
├─ Plain or styled text -> components/text-display.md
├─ Container with borders/background -> components/containers.md
├─ Scrollable content area -> components/containers.md (scrollbox)
├─ ASCII art banner/title -> components/text-display.md (ascii-font)
├─ Data table with borders/wrapping -> components/code-diff.md (TextTable)
├─ Code with syntax highlighting -> components/code-diff.md
├─ Diff viewer (unified/split) -> components/code-diff.md
├─ Line numbers with diagnostics -> components/code-diff.md
└─ Markdown content (streaming) -> components/code-diff.md (markdown)
「我需要處理使用者輸入」
User input?
├─ Single-line text field -> components/inputs.md (input)
├─ Multi-line text editor -> components/inputs.md (textarea)
├─ Select from a list (vertical) -> components/inputs.md (select)
├─ Tab-based selection (horizontal) -> components/inputs.md (tab-select)
└─ Custom keyboard shortcuts -> keyboard/REFERENCE.md
「我需要佈局/定位」
Layout?
├─ Flexbox-style layouts (row, column, wrap) -> layout/REFERENCE.md
├─ Absolute positioning -> layout/patterns.md
├─ Responsive to terminal size -> layout/patterns.md
├─ Centering content -> layout/patterns.md
└─ Complex nested layouts -> layout/patterns.md
「我需要動畫效果」
Animations?
├─ Timeline-based animations -> animation/REFERENCE.md
├─ Easing functions -> animation/REFERENCE.md
├─ Property transitions -> animation/REFERENCE.md
└─ Looping animations -> animation/REFERENCE.md
「我需要處理輸入」
Input handling?
├─ Keyboard events (keypress, release) -> keyboard/REFERENCE.md
├─ Focus management -> keyboard/REFERENCE.md
├─ Paste events -> keyboard/REFERENCE.md
├─ Mouse events -> components/containers.md
├─ Text selection & copy-on-select -> keyboard/REFERENCE.md (selection)
└─ Clipboard (OSC 52) -> keyboard/REFERENCE.md (clipboard)
「我需要測試我的 TUI」
Testing?
├─ Snapshot testing -> testing/REFERENCE.md
├─ Interaction testing -> testing/REFERENCE.md
├─ Test renderer setup -> testing/REFERENCE.md
└─ Debugging tests -> testing/REFERENCE.md
「我需要進行除錯/故障排除」
Troubleshooting?
├─ Runtime errors, crashes -> /gotchas.md
├─ Layout issues -> layout/REFERENCE.md + layout/patterns.md
├─ Input/focus issues -> keyboard/REFERENCE.md
└─ Repro + regression tests -> testing/REFERENCE.md
故障排除索引
- 終端機清理、當機 ->
core/gotchas.md - 文字樣式無法套用 ->
components/text-display.md - 輸入焦點/快捷鍵 →
keyboard/REFERENCE.md - 版面配置錯位 ->
layout/REFERENCE.md - 快照不穩定 ->
testing/REFERENCE.md
關於元件命名差異與文字修飾符,請參閱 components/REFERENCE.md.
產品索引
框架
橫切面概念
元件類別
資源
儲存庫 :https://github.com/anomalyco/opentui 核心文件 :https://github.com/anomalyco/ opentui /tree/main/packages/core/docs 範例 : https://github.com/anomalyco/ opentui /tree/main/packages/core/src/examples 精選清單 :https://github.com/msmps/awesome- opentui
此儲存庫的更多內容
用於準備、標記及發佈 Cline Code 桌面應用程式(apps/examples/desktop-app)的發行版本。 本指南涵蓋變更日誌的起草、在 package.json + tauri.conf.json 中提升版本號、建立 desktop-vX.Y.Z 標籤,以及執行「desktop-publish」GitHub 工作流程(該流程負責建置、簽署、公證及更新自動更新饋送)。publish-desktopcline/cline2026-07-2165.用於準備、驗證及發佈獨立的 @cline/ui npm 發行版本。適用於提升 UI 套件版本、透過 ui-publish.yml 發佈最新或下個版本、檢查 UI 發行準備狀態,或完成 npm trusted-publishing 的一次性初始化。1kpublish-uicline/cline2026-07-1865.1kpublish-clicline/cline2026-06-0465用於準備、標記及發佈 apps/cli 的 npm 版本。提供變更日誌草擬、apps/cli/package.json 版本遞增、cli-vX.Y.Z 標籤、本地 npm 發佈,以及 publish-cli GitHub 工作流程的指引。.用於建構 AI 代理人的全面性 Cline SDK 技能。涵蓋代理人的執行環境、ClineCore 會話、自訂工具、外掛程式、事件、大型語言模型 (LLM) 供應商、排程、多代理人團隊以及生產環境部署。適用於任何涉及 @cline/sdk 或其子套件的任務。1kcline-sdkcline/cline2026-05-1465.1kcreate-pull-requestcline/cline2026-02-2465依照專案規範建立 GitHub 拉取請求。適用於使用者要求建立 PR、提交變更以供審查,或開啟拉取請求的情境。涵蓋提交分析、分支管理、PR 範本使用,以及透過 gh CLI 工具建立 PR。.1kOpenTUI Platform Skill
Consolidated skill for building terminal user interfaces with OpenTUI. Use decision trees below to find the right framework and components, then load detailed references.
Critical Rules
Follow these rules in all OpenTUI code:
- Use
create-tuifor new projects. See frameworkREFERENCE.mdquick starts. create-tuioptions must come before arguments.bunx create-tui -t react my-appworks,bunx create-tui my-app -t reactdoes NOT.- Never call
process.exit()directly. Userenderer.destroy()(seecore/gotchas.md). - Text styling requires nested tags in React/Solid. Use modifier elements, not props (see
components/text-display.md).
How to Use This Skill
Reference File Structure
Framework references follow a 5-file pattern. Cross-cutting concepts are single-file guides.
Each framework in ./references/<framework>/ contains:
Cross-cutting concepts in ./references/<concept>/ have REFERENCE.md as the entry point.
Reading Order
- Start with
REFERENCE.mdfor your chosen framework - Then read additional files relevant to your task:
- Building components ->
api.md+components/<category>.md - Setting up project ->
configuration.md - Layout/positioning ->
layout/REFERENCE.md - Keyboard/input handling ->
keyboard/REFERENCE.md - Animations ->
animation/REFERENCE.md - Troubleshooting ->
gotchas.md+testing/REFERENCE.md
- Building components ->
Example Paths
./references/react/REFERENCE.md # Start here for React
./references/react/api.md # React components and hooks
./references/solid/configuration.md # Solid project setup
./references/components/inputs.md # Input, Textarea, Select docs
./references/core/gotchas.md # Core debugging tips
Runtime Notes
OpenTUI runs on Bun and uses Zig for native builds. Read ./references/core/gotchas.md for runtime requirements and build guidance.
Quick Decision Trees
"Which framework should I use?"
Which framework?
├─ I want full control, maximum performance, no framework overhead
│ └─ core/ (imperative API)
├─ I know React, want familiar component patterns
│ └─ react/ (React reconciler)
├─ I want fine-grained reactivity, optimal re-renders
│ └─ solid/ (Solid reconciler)
└─ I'm building a library/framework on top of OpenTUI
└─ core/ (imperative API)
"I need to display content"
Display content?
├─ Plain or styled text -> components/text-display.md
├─ Container with borders/background -> components/containers.md
├─ Scrollable content area -> components/containers.md (scrollbox)
├─ ASCII art banner/title -> components/text-display.md (ascii-font)
├─ Data table with borders/wrapping -> components/code-diff.md (TextTable)
├─ Code with syntax highlighting -> components/code-diff.md
├─ Diff viewer (unified/split) -> components/code-diff.md
├─ Line numbers with diagnostics -> components/code-diff.md
└─ Markdown content (streaming) -> components/code-diff.md (markdown)
"I need user input"
User input?
├─ Single-line text field -> components/inputs.md (input)
├─ Multi-line text editor -> components/inputs.md (textarea)
├─ Select from a list (vertical) -> components/inputs.md (select)
├─ Tab-based selection (horizontal) -> components/inputs.md (tab-select)
└─ Custom keyboard shortcuts -> keyboard/REFERENCE.md
"I need layout/positioning"
Layout?
├─ Flexbox-style layouts (row, column, wrap) -> layout/REFERENCE.md
├─ Absolute positioning -> layout/patterns.md
├─ Responsive to terminal size -> layout/patterns.md
├─ Centering content -> layout/patterns.md
└─ Complex nested layouts -> layout/patterns.md
"I need animations"
Animations?
├─ Timeline-based animations -> animation/REFERENCE.md
├─ Easing functions -> animation/REFERENCE.md
├─ Property transitions -> animation/REFERENCE.md
└─ Looping animations -> animation/REFERENCE.md
"I need to handle input"
Input handling?
├─ Keyboard events (keypress, release) -> keyboard/REFERENCE.md
├─ Focus management -> keyboard/REFERENCE.md
├─ Paste events -> keyboard/REFERENCE.md
├─ Mouse events -> components/containers.md
├─ Text selection & copy-on-select -> keyboard/REFERENCE.md (selection)
└─ Clipboard (OSC 52) -> keyboard/REFERENCE.md (clipboard)
"I need to test my TUI"
Testing?
├─ Snapshot testing -> testing/REFERENCE.md
├─ Interaction testing -> testing/REFERENCE.md
├─ Test renderer setup -> testing/REFERENCE.md
└─ Debugging tests -> testing/REFERENCE.md
"I need to debug/troubleshoot"
Troubleshooting?
├─ Runtime errors, crashes -> <framework>/gotchas.md
├─ Layout issues -> layout/REFERENCE.md + layout/patterns.md
├─ Input/focus issues -> keyboard/REFERENCE.md
└─ Repro + regression tests -> testing/REFERENCE.md
Troubleshooting Index
- Terminal cleanup, crashes ->
core/gotchas.md - Text styling not applying ->
components/text-display.md - Input focus/shortcuts ->
keyboard/REFERENCE.md - Layout misalignment ->
layout/REFERENCE.md - Flaky snapshots ->
testing/REFERENCE.md
For component naming differences and text modifiers, see components/REFERENCE.md.
Product Index
Frameworks
Cross-Cutting Concepts
Component Categories
Resources
Repository: https://github.com/anomalyco/opentui Core Docs: https://github.com/anomalyco/opentui/tree/main/packages/core/docs Examples: https://github.com/anomalyco/opentui/tree/main/packages/core/src/examples Awesome List: https://github.com/msmps/awesome-opentui
More from this repository
publish-desktopcline/clineUse when preparing, tagging, and publishing a Cline Code desktop app (apps/examples/desktop-app) release. Guides changelog drafting, version bumps in package.json + tauri.conf.json, desktop-vX.Y.Z tags, and the desktop-publish GitHub workflow that builds, signs, notarizes, and updates the auto-update feed.
2026-07-2165.1kpublish-uicline/clinePrepare, validate, and publish standalone @cline/ui npm releases. Use when bumping the UI package version, publishing latest or next through ui-publish.yml, checking UI release readiness, or completing the one-time npm trusted-publishing bootstrap.
2026-07-1865.1kpublish-clicline/clineUse when preparing, tagging, and publishing an apps/cli npm release. Guides changelog drafting, apps/cli/package.json version bumps, cli-vX.Y.Z tags, local npm publishing, and the publish-cli GitHub workflow.
2026-06-0465.1kcline-sdkcline/clineComprehensive Cline SDK skill for building AI agents. Covers the Agent runtime, ClineCore sessions, custom tools, plugins, events, LLM providers, scheduling, multi-agent teams, and production deployment. Use for any task involving @cline/sdk or its sub-packages.
2026-05-1465.1kcreate-pull-requestcline/clineCreate a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, PR template usage, and PR creation using the gh CLI tool.
2026-02-2465.1k安裝 opentui
請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。
下載 ZIP複製儲存庫並將技能檔案複製到您的專案中。
git clone https://github.com/cline/cline/tree/main/.agents/skills/opentui # Copy the skill folder to .claude/skills/ or .codex/skills/
複製





首頁
