@ftrdotdev/pi-tui
House TUI components and the pi interface extension: themed boxes, a pure box-frame model, and the header/footer/editor/settings/preview chrome
Package details
Install @ftrdotdev/pi-tui from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@ftrdotdev/pi-tui- Package
@ftrdotdev/pi-tui- Version
0.5.1- Published
- Sep 19, 2026
- Downloads
- 519/mo · 20/wk
- Author
- felixnorden
- License
- MIT
- Types
- extension
- Size
- 387.7 KB
- Dependencies
- 3 dependencies · 4 peers
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-tui
House TUI components and the pi interface extension, built on the pi coding agent and Effect.
Package: @ftrdotdev/pi-tui · MIT
What it is
pi-tui has two sides:
Components — composable, theme-aware UI pieces that other
@ftrdotdevpackages and pi extensions import as code:makeBorderedBoxfor themed boxes,defineComponentfor closure-based components, and a pure box-frame model that does string/geometry arithmetic without pi or effect imports (available at@ftrdotdev/pi-tui/box-frame).The interface extension — a pi extension that installs the session chrome: header, footer (git status, runtime info, thinking level, usage, cost), editor autocomplete, the
/settingscommand, preview, and turn telemetry. It registers through thepifield inpackage.jsonand loadssrc/index.ts; it is deliberately not re-exported from the component barrel, so importing a component never drags in the extension's side effects.
Installation
Install the extension from npm:
pi install npm:@ftrdotdev/pi-tui
To use only the components without the extension, depend on it from your own package:
bun add @ftrdotdev/pi-tui
npm i @ftrdotdev/pi-tui
import { makeBorderedBox, type BorderedBoxOptions } from "@ftrdotdev/pi-tui";
import { buildBoxFrame, type BoxFrameOptions } from "@ftrdotdev/pi-tui/box-frame";
Component model
Components handed to pi (setWidget, ui.custom, setFooter,
setHeader, setEditorComponent, entry renderers) must be plain objects
built from closures: pi-tui invokes render/invalidate as methods of the
wrapper object it was given, so an unbound class method would lose this.
makeBorderedBox and defineComponent build closure components that carry
no this and survive any hand-off.
Development
| Command | Purpose |
|---|---|
bun test |
Run the test suite (vitest + @effect/vitest) |
bun test:watch |
Run the test suite in watch mode |
bunx tsc --noEmit |
Type check |
bun lint |
Lint with oxlint |