OpenTUI是一个用于构建终端用户界面的库.
- 以兹克所出.
- 您直接或通过 React and Solid 写入 TypeScript .
- 你用活字箱安排盒子和文字.
- 您添加带有键盘和鼠标控件的选定、输入和滚动框.
- 可以播放声音,显示图像,并渲染出3D图形.
OpenCode在为上百万用户生产时使用OpenTUI.
OpenTUI 核心软件
@opentui/core 提供渲染器和 TypeScript API。 你直接使用必需的可变和事件。 这个
TypeScript包通过一个内部的外用函数接口(FFI)边界来称呼本土Zig.
import { TextRenderable, createCliRenderer } from "@opentui/core"
const renderer = await createCliRenderer({ exitOnCtrlC: true })
renderer.root.add(new TextRenderable(renderer, { content: "Hello, OpenTUI!" }))
exitOnCtrlC: true 电话 renderer.destroy() 当用户按 Ctrl+C 键时。 创建渲染器的代码必须
调用 renderer.destroy() 在其他关闭路径.
安装软件包 :
bun add @opentui/core
然后,你的第一个应用程序与 快速启动。 。 。 .
运行时间和平台支持
@opentui/core 在Bun 1.3.14或以后运行,或在Node.js 26.4.0或以后运行,使用ECMAScript模块(ESM)和
--experimental-ffi。 。 。 .
在本地Windows arm64上使用Bun 1.4.0或后期.
本地的 ABI 和生成的平台软件包, 例如 @opentui/core-linux-x64,是内部分布
表面,而不是应用程序 API.
AI 代理技能
安装 OpenTUI 文档作为您的 AI 编码助理的技能 npx skills数字 :
npx skills add https://opentui.com --skill opentui
添加 -g 在全球安装该技能。 技能与最新发布的相匹配 npx skills update 移动到每个
新发行。 从 https://opentui.com/docs/next 以便跟随主分支. 安装在
npx skills add anomalyco/opentui 遵循主分支;运行上面的命令将其切换为放行.
许可证
OpenTUI 根据 MIT 许可证。 。 。 .