@androidtui/core

中文文档
0.8.0发布于 2026/10/30MITTypeScriptESM + CJS近 30 天下载 2372

OpenTUI core for native Android and Termux terminal user interfaces

原始使用文档
文档目录4 节
  1. OpenTUI Core
  2. Runtime and platform support
  3. AI agent skill
  4. License

OpenTUI logo

npm version Core build status

OpenTUI is a library to build terminal user interfaces.

  • It is written in Zig.
  • You write TypeScript directly or through React and Solid.
  • You arrange boxes and text with flexbox.
  • You add selects, inputs, and scroll boxes with keyboard and mouse controls.
  • You can play sounds, show images, and render 3D graphics.

OpenCode uses OpenTUI in production for millions of users.

Website | Documentation | Packages

OpenTUI Core

@opentui/core supplies the renderer and TypeScript API. You use imperative renderables and events directly. The TypeScript packages call native Zig through an internal foreign function interface (FFI) boundary.

import { TextRenderable, createCliRenderer } from "@opentui/core"

const renderer = await createCliRenderer({ exitOnCtrlC: true })

renderer.root.add(new TextRenderable(renderer, { content: "Hello, OpenTUI!" }))

exitOnCtrlC: true calls renderer.destroy() when the user presses Ctrl+C. The code that creates the renderer must call renderer.destroy() on every other shutdown path.

Install the package:

bun add @opentui/core

Then build your first app with the quickstart.

Runtime and platform support

@opentui/core runs on Bun 1.3.14 or later, or on Node.js 26.4.0 or later with ECMAScript modules (ESM) and --experimental-ffi.

Use Bun 1.4.0 or later on native Windows arm64.

The native ABI and the generated platform packages, such as @opentui/core-linux-x64, are internal distribution surfaces, not application APIs.

AI agent skill

Install the OpenTUI documentation as a skill for your AI coding assistant with npx skills:

npx skills add https://opentui.com --skill opentui

Add -g to install the skill globally. The skill matches the latest release, and npx skills update moves it to each new release. Install from https://opentui.com/docs/next to follow the main branch. A skill installed with npx skills add anomalyco/opentui follows the main branch; run the command above to switch it to releases.

License

OpenTUI is licensed under the MIT License.

版本与发布记录

@androidtui/core 共发布 29 个版本,首次发布于 2026/08/09;过去 12 个月发布了 29 个版本。

版本发布日期距今
0.8.0latest2026/10/308 天前
0.7.02026/10/308 天前
0.6.82026/10/2414 天前
0.6.62026/10/1523 天前
0.6.52026/10/1424 天前
0.6.42026/10/1424 天前

其他发布通道:future → 0.5.12-android.1。

关于 @androidtui/core 的常见问题

@androidtui/core 是什么?

OpenTUI core for native Android and Termux terminal user interfaces

如何安装 @androidtui/core?

在项目目录运行 npm install @androidtui/core,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:web-tree-sitter(0.25.10)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@androidtui/core 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@androidtui/core 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@androidtui/core 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=26.4.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@androidtui/core 可以商用吗?

@androidtui/core 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@androidtui/core 的下载量有多少?

根据 npm 官方下载统计,@androidtui/core 在 2026/10/06 – 2026/11/04 这 30 天内被下载 2,372 次,日均约 79 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@androidtui/core 还在维护吗?

最新版本 0.8.0 发布于 2026/10/30(8 天前);至今共发布 29 个版本,其中过去 12 个月发布了 29 个;首次发布于 2026/08/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。