- Category
- Developer Tools
- Rank
- No. 2101Tools index
Previous survey · No. 2096 ·
- Pricing
- Open Source
- Type
- TOOL
- Builder
- badlogic
- GitHub
- 9 stars
- Date
About
Minimal TUI library for chat interfaces.
What it does
Babbletui builds interactive terminal conversations from composable text, Markdown, editor, input, menu, and container elements. It renders components into line buffers, compares successive frames, and writes only changed viewport lines when possible. Input goes first through a global handler, then to the focused component.
Why it's ranked here
The focused scope is convincing: native scrollback, incremental terminal updates, reusable inputs, Markdown, and menus cover the core mechanics of a chat shell. The implementation stays small and readable. Confidence is tempered by narrow tests and text handling that largely assumes printable ASCII.
What's good
The renderer appends unchanged streaming output cheaply and groups consecutive changed lines for fewer terminal writes. A terminal abstraction makes input, output, dimensions, and resize behavior replaceable. Components share a tiny line-based contract, while ANSI-aware wrapping preserves styling across lines. Type definitions ship with the package.
Tradeoffs
Buffer shrinkage, changes above the viewport, and terminal resizing trigger a full render that clears screen and scrollback. The supplied tests cover only three wrapping and visible-length cases. Editors accept regular printable ASCII, and pasted text filters other printable characters out. Markdown rendering skips embedded HTML rather than displaying it.
How to use it well
Use it for a Node-based chat shell, assistant prototype, or terminal configuration flow where native scrollback matters. Compose display components with one focused editor, then request rendering as messages stream or state changes. Supply your own model calls, conversation storage, and application logic because the shown interface covers terminal presentation and input, not those adjacent concerns.
Technical notes+
package.json defines an ESM npm package with TypeScript declarations, a binary entry, TypeScript compilation, Vitest, Biome, Chalk, and Marked. src/index.ts exports the public renderer, terminal abstraction, components, option types, and wrapping utilities. src/tui.ts keeps old and new string buffers, schedules rendering on the next process tick, appends pure growth, updates changed viewport groups with ANSI cursor controls, and falls back to full rendering for shrinkage or scrollback changes. src/terminal.ts binds raw stdin, stdout, and resize events. src/cli.ts is a component demo. src/index.test.ts tests three utility behaviors. src/text-editor.ts is truncated in the supplied text, so behavior beyond the visible portion is not assessed.
Observed
- License
- MIT
- Primary language
- TypeScript
- Packaging
- ES module published as @mariozechner/babbletui on npm
- Install surface
- npm install @mariozechner/babbletui
- Interfaces
- Importable library plus a packaged command-line demo
- Runtime dependencies
- Chalk and Marked
- Tests
- Vitest test source covers ANSI visible length, character wrapping, and word wrapping
Read from README.md, package.json, src/cli.ts, src/index.ts, src/tui.ts, src/menu.ts, src/utils.ts, src/terminal.ts, src/component.ts, src/container.ts, src/index.test.ts, src/text-editor.ts, src/text-component.ts, src/single-line-input.ts, src/markdown-component.ts.
What it can do
Create text-based chat user interfaces
Chat application requirements → Terminal-based chat interface
Display chat messages in terminal
Chat message data → Formatted text display in terminal
Handle user text input in chat interface
Keyboard input from user → Processed chat input
Render chat conversation history
Message history data → Scrollable chat log in terminal
Provide minimal chat interface components
Interface layout specifications → Lightweight TUI chat elements
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.
