← 返回 Skills 市场
openlark

Pi Tui

作者 OpenLark · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
41
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install pi-tui
功能描述
Pi TUI — Terminal UI framework with differential rendering + synchronized output for flicker-free interactive CLIs.
使用说明 (SKILL.md)

Pi TUI

Component-based architecture (TUI/Container/Box/Text/TruncatedText/Input/Editor/Markdown/Loader/CancellableLoader/SelectList/SettingsList/Spacer/Image), overlay system, IME support, autocomplete, Kitty keyboard protocol. Differential rendering TUI framework. Install: npm install @earendil-works/pi-tui

Use Cases

Use when building terminal UIs, interactive CLI apps, TUI editors, terminal select lists/settings panels, terminal Markdown rendering, or inline terminal images.

Core Concepts

Component Interface — All components implement render(width): string[] (each line ≤ width), handleInput?(data), invalidate?(). Each line auto-appends SGR+OSC reset; styles do not carry across lines.

Focusable Interface — Components needing IME implement a focused: boolean property and insert CURSOR_MARKER before the cursor in render. Containers with Input/Editor children must propagate focus state (otherwise IME candidate window mispositions). Hardware cursor hidden by default; enable with PI_HARDWARE_CURSOR=1.

Differential Rendering — Three strategies: first render outputs all lines, width change clears and redraws, incremental only updates changed lines. CSI 2026 synchronized output prevents flicker.

Quick Start

import { TUI, Text, Editor, ProcessTerminal, matchesKey } from "@earendil-works/pi-tui";

const tui = new TUI(new ProcessTerminal());
tui.addChild(new Text("Welcome!"));
const editor = new Editor(tui, theme);
editor.onSubmit = (text) => tui.addChild(new Text(`> ${text}`));
tui.addChild(editor);
tui.setFocus(editor);
tui.addInputListener((data) => { if (matchesKey(data, 'ctrl+c')) { tui.stop(); process.exit(0); } });
tui.start();

// TUI API: addChild/removeChild/start/stop/requestRender/setFocus/onDebug

Progressive References

Load on demand, only when needed:

  • Overlays/dialogs/menus → references/overlays.md
  • Component API reference → references/components.md
  • Autocomplete/key detection → references/autocomplete.md

Gotchas

  1. render(width) line width: each line ≤ width, otherwise TUI throws
  2. Styles don't span lines: auto-reset at line end, reapply styles per line for multi-line styled text
  3. Container IME propagation: containers with Input/Editor must implement Focusable and propagate focus
  4. Ctrl+C: raw mode doesn't send SIGINT, must handle via matchesKey(data, 'ctrl+c')
  5. Overlay focus: unfocus({ target: component }) releases to specific component, unfocus({ target: null }) clears focus
安全使用建议
Install only if you intend to build terminal UI applications with this npm package. Review the npm package itself through your normal dependency process, and be aware that apps using its file-path autocomplete may expose local file names inside that app's UI.
能力评估
Purpose & Capability
The artifacts consistently describe Pi TUI as a component-based terminal UI framework with rendering, input, overlay, autocomplete, and component-reference guidance.
Instruction Scope
Instructions are limited to usage examples and reference material for building TUIs; there are no role overrides, prompt-injection instructions, unsafe automation, or unrelated agent directives.
Install Mechanism
The skill discloses a standard npm install command for @earendil-works/pi-tui, but the submitted skill artifact itself contains only Markdown files and no executable installer scripts.
Credentials
The referenced library features include terminal input handling, inline images, and file-path autocomplete using the current working directory; these are purpose-aligned for TUI development and are disclosed.
Persistence & Privilege
No persistence, background workers, privilege escalation, credential access, session/profile access, destructive actions, or data exfiltration behavior appears in the artifact.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install pi-tui
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /pi-tui 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
pi-tui 1.0.0 — Initial Release - Introduces component-based terminal UI framework with differential rendering for flicker-free, interactive CLIs - Implements synchronized output (CSI 2026) and overlay support to prevent flicker and support dialogs/menus - Includes built-in components: TUI container, Box, Text, TruncatedText, Input, Editor, Markdown, Loader, SelectList, SettingsList, Spacer, Image - Out-of-the-box support for input method editors (IME), autocomplete, and Kitty keyboard protocol - Provides clear component/focus interfaces, core usage docs, and practical gotchas for smooth integration
元数据
Slug pi-tui
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Pi Tui 是什么?

Pi TUI — Terminal UI framework with differential rendering + synchronized output for flicker-free interactive CLIs. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 41 次。

如何安装 Pi Tui?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install pi-tui」即可一键安装,无需额外配置。

Pi Tui 是免费的吗?

是的,Pi Tui 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Pi Tui 支持哪些平台?

Pi Tui 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Pi Tui?

由 OpenLark(@openlark)开发并维护,当前版本 v1.0.0。

💬 留言讨论