@arcturn/tui
v0.2.0
Published
Terminal UI library with differential rendering Internal to the arcturn CLI; API may change in any release.
Downloads
122
Readme
@arcturn/tui
Internal to the arcturn CLI. Published so
arcturnresolves; its API may change in any release without a major version bump. Embedders should depend on@arcturn/coreand@arcturn/ai, whose surfaces are the ones the SDK documents.
A from-scratch terminal UI library with differential rendering, built for the
Arcturn CLI but standalone and independently usable. It depends
only on marked and get-east-asian-width, and every terminal interaction goes through
a Terminal interface, so the whole library can be driven headlessly (see
TestTerminal) — useful for snapshot-testing a TUI without a real tty.
What's in it
src/index.ts groups exports by area:
- ANSI + styling —
fg,bg,bold,dim,italic,underline,hyperlink,combine,makeStyle,stripAnsi,detectColorLevel, cursor/erase control sequences. - Components (
./components/index.js) — the widget set (editor, text, layout, etc.) built on the renderer below. - Images —
renderImage,encodeKittyImage,encodeItermImage,detectImageSupportfor terminals that support inline image protocols. - Key decoding —
KeyDecoder,createKey,matchesKey,keyToString. - Terminal —
Terminal(the interface),ProcessTerminal(a real tty), andTestTerminal(an in-memory terminal for tests). - Theming —
createTheme,getTheme/setTheme,darkTheme,lightTheme,style. - Renderer —
TUI, the root component tree and differential-rendering engine, plusComponent,KeyHandler, and overlay-positioning types. - Width, wrapping, truncation — East-Asian-width-aware string measurement.
Install
Arcturn is not yet published to npm. Until it is, use it from a clone of the monorepo as a pnpm workspace package:
git clone https://github.com/sitharaj88/arcturn.git && cd arcturn
pnpm install && pnpm -r buildThen depend on it from another workspace package: "@arcturn/tui": "workspace:*".
Usage
import { Editor, ProcessTerminal, Text, TUI } from "@arcturn/tui";
const tui = new TUI(new ProcessTerminal());
const editor = new Editor({ onSubmit: (text) => console.log(text) });
tui.add(new Text("Ask me anything", { style: "accent" }));
tui.add(editor);
tui.focus(editor);
tui.start();Docs
@arcturn/tui powers the arcturn CLI's terminal interface; there is no dedicated SDK
page for it yet. See Embedding with the SDK for how the
CLI, this library, and the agent runtime relate, and the
Arcturn documentation index for what's covered so far.
License
Apache-2.0 — see LICENSE.
👤 Author
Sitharaj Seenivasan
- 🌐 Website: sitharaj.in
- 💼 LinkedIn: sitharaj08
- 💻 GitHub: sitharaj88
☕ Support
If this project helps you, consider buying me a coffee — it keeps the work going.
📄 License
Licensed under the Apache License 2.0. © 2026 Sitharaj Seenivasan.
