
badlogic TUI
https://github.com/badlogic/tui- Category
- Developer Tools
- Rank
- No. 1860Tools index
Previous survey · No. 1817 ·
- Pricing
- Open Source
- Type
- TOOL
- Builder
- badlogic
- GitHub
- 13 stars
- Date
About
Terminal UI framework with differential rendering for building interactive CLI applications in TypeScript.
What it does
It supplies building blocks for terminal programs: nested containers, formatted text, Markdown, selection menus, multiline editing, and autocomplete. Components report their rendered lines and whether content changed, letting the manager preserve unchanged output while routing keyboard input to the focused component.
Why it's ranked here
A focused choice for chat-like terminal tools and file-aware prompts. The included editor, Markdown display, selection list, and command autocomplete cover unusually practical interaction needs. Confidence is tempered by verification that consists of a demo rather than an automated test suite.
What's good
Rendering work is explicit and economical: containers track the unchanged prefix, then redraw only the affected tail. The editor handles cursor movement, multiline paste, deletion shortcuts, submission, and completion. File suggestions support relative, absolute, and home-based paths, while attachment suggestions filter by file type.
Tradeoffs
The editor configuration type currently exposes no options, and printable input handling is limited to ASCII characters. Markdown wrapping acknowledges that styling may break at wrap points. Selection filtering only matches value prefixes. The repository provides a runnable demo, but no assertion-based tests or documented compatibility matrix.
How to use it well
Use it for Node-based terminal tools centered on prompts, chat history, command menus, file references, or lightweight Markdown output. Compose the supplied components, keep application behavior in your own callbacks, and request rendering after state changes. It does not supply business logic, data persistence, networking, or a standalone command-line application.
Technical notes+
package.json defines an ESM npm library named @mariozechner/tui, requires Node 18 or newer, publishes compiled output plus README.md, and runs TypeScript through Biome during checks. src/index.ts exposes the component and autocomplete surface. src/tui.ts batches render requests with process.nextTick, computes keepLines, emits ANSI cursor movement and clearing sequences, writes changed lines synchronously, and uses sentinel components so removals trigger cascading redraws. src/text-editor.ts always reports changed output and parses raw key sequences directly. src/markdown-component.ts tokenizes with marked and styles through chalk. test/demo.ts is an interactive demonstration rather than an assertion-based test. tsconfig.json enables strict checking, declarations, declaration maps, and source maps.
Observed
- License
- MIT
- Primary language
- TypeScript
- Packaging
- ESM npm package named @mariozechner/tui
- Runtime
- Node.js 18 or newer
- Interface
- Importable library; no packaged CLI executable is declared
- Dependencies
- Uses chalk, marked, mime-types, and Node built-ins
- Verification structure
- The test directory contains one interactive demo script, with no assertion-based test files shown
Read from README.md, package.json, src/index.ts, src/tui.ts, src/logger.ts, src/select-list.ts, src/text-editor.ts, src/autocomplete.ts, src/text-component.ts, src/markdown-component.ts, src/whitespace-component.ts, test/demo.ts, biome.json, tsconfig.json, .husky/pre-commit.
What it can do
Create interactive terminal user interfaces
TypeScript code using the framework → Interactive CLI application
Render UI components with differential updates
UI state changes → Optimized terminal display updates
Handle user input events in terminal
Keyboard and mouse interactions → Event callbacks and state updates
Build complex terminal layouts
Component definitions and layout specifications → Structured terminal interface
Manage terminal application state
Application data and user interactions → Updated application state
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.