@timmo001/groundwork-tui

中文文档
0.9.33发布于 2026/11/03Apache-2.0ES Module构建来源已验证

Groundwork's terminal components: OpenTUI renderables on the terminal tokens

原始使用文档

@timmo001/groundwork-tui

Groundwork's terminal components: OpenTUI renderables and formatters on the terminal tokens, so every Groundwork TUI has the same look and keys.

import { AppHeader, formatHelpBar, loadTheme } from "@timmo001/groundwork-tui";
  • loadTheme reads GW_THEME and GW_MODE. Without GW_THEME it's the desktop's Omarchy theme where there is one, otherwise Base and dark. themeFor picks a theme and mode directly, and omarchyThemeFor maps an Omarchy colors.toml.
  • AppHeader and PaneHeader are one-row titles. HeaderBlock is the app's name as ASCII art over formatHeaderBar, a breadcrumb with a status dot and details that drop off when the terminal is narrow.
  • formatBreadcrumb, formatFilterBar and formatHelpBar build the title trail, the filter line and the key hints along the bottom.
  • MenuList is a filterable list of two-line rows, with group headings and paging. StatusList is a plain list of labelled values.
  • MenuGrid lays out Tile cards under SectionHeading rows, with arrow keys moving to the nearest tile.
  • ScrollSurface is a themed scroll box, and surfaceBackground its color.
  • Button, Input, RadioGroup and Collapsible are the focusable controls: Enter or Space (or a click) presses, picks or toggles.
  • Dialog is a centered panel, one open at a time, closed by Escape or a click outside. ConfirmDialog asks yes or no (Cancel has focus), and ChoiceDialog picks from a list. Toast is a single self-closing message for results nothing else on screen can show.

templates/tui-menu shows the components, and runs with mise run demo:tui.

版本与发布记录

@timmo001/groundwork-tui 共发布 41 个版本,首次发布于 2026/11/01;过去 12 个月发布了 41 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.9.33latest2026/11/03今天
0.9.322026/11/021 天前
0.9.312026/11/021 天前
0.9.302026/11/021 天前
0.9.292026/11/021 天前
0.9.282026/11/021 天前

关于 @timmo001/groundwork-tui 的常见问题

@timmo001/groundwork-tui 是什么?

底层的终端组件:终端令牌上的OpenTUI可渲染

如何安装 @timmo001/groundwork-tui?

在项目目录运行 npm install @timmo001/groundwork-tui,或使用 pnpm add / yarn add / bun add。

@timmo001/groundwork-tui 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/timmo001__groundwork-tui 是否存在。

@timmo001/groundwork-tui 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@timmo001/groundwork-tui 可以商用吗?

@timmo001/groundwork-tui 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@timmo001/groundwork-tui 还在维护吗?

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