Hysen Labs
Open-source project
Dicklesworthstone/frankentui avatar
Dicklesworthstone

frankentui

Minimal, high-performance terminal UI kernel with diff-based rendering, inline mode, and RAII terminal cleanup

260 stars29 forksRustNOASSERTION
DEEP OPEN-SOURCE ANALYSIS

FrankenTUI is a terminal UI kernel written in Rust

A high performance TUI foundation with a diff based renderer, pane workspaces, and in tree web backends, built for correctness and deterministic rendering.

What the kernel provides

FrankenTUI, also called ftui, is a high performance terminal UI kernel written in Rust. The README describes it as a kernel level TUI foundation with a disciplined runtime, a diff based renderer, and inline mode support that preserves scrollback while keeping interface chrome stable. The project reports more than 850,000 lines of Rust across 20 crates, over 80 direct widget and stateful widget implementations, and 46 interactive demo screens. A Bayesian intelligence layer and resizable pane workspaces are part of the design, along with in tree web and WASM backends. The focus is on correctness, determinism, and clean architecture rather than convenience. The README lists capabilities such as inline mode with stable UI while logs scroll, deterministic rendering through a buffer, diff, and presenter pipeline, a one writer rule that serializes stdout, RAII cleanup that restores terminal state even on panic, and composable crates so you add only what you need. The widget set includes Block, Paragraph, Table, Input, Tree, Modal, and a command palette. Pane workspaces support drag to resize, docking, magnetic snap, inertial throw, and undo or redo. Web and WASM backends let the same Rust core render in browser oriented environments. The project is marked work in progress and built on Rust nightly, with a license that combines MIT and the OpenAI and Anthropic Rider terms.

How the runtime and rendering work

The runtime follows a clear pipeline. Input arrives through a TerminalSession that reads raw terminal events and turns them into an Event. The Model's update method returns a command for side effects, and subscriptions feed an event stream for ticks, IO, and resize. The view method renders the model into a Frame, which writes cells into a two dimensional Buffer. A BufferDiff computes the minimal changes, the Presenter emits ANSI with state tracking, and a TerminalWriter enforces the one writer rule before flushing output. This design is what gives FrankenTUI deterministic, flicker free output. The README's design philosophy states five points: correctness over cleverness, deterministic output, inline first, layered architecture with no cyclic dependencies, and zero surprise teardown through RAII cleanup. Inline mode keeps a stable UI at the top or bottom while logs scroll above, which is useful for CLI tools. The pane workspace system, more than 9,000 lines in ftui-layout, adds drag to resize with cell level hit testing, magnetic docking, inertial throw, multi pane selection, and a persistent interaction timeline with undo, redo, and replay. The Bayesian intelligence layer uses statistical diff strategy, resize coalescing, and capability detection, with techniques such as BOCPD, VOI, and conformal prediction to choose rendering strategies adaptively.

Building and running the demos

The quickest way to see FrankenTUI is to build and run its demo runner. The README gives two paths. You can download the source with curl from the codeload tarball, extract it, move into the frankentui-main directory, and run the demo crate through cargo. Or you can clone the Git repository, move into the frankentui directory, and run the same command. That demo runner is the primary way to view what the system can do, since it ships 46 interactive screens. Those screens are grouped by category: overview, layout, text, data, input, visual effects, system, diagnostics, workflow, advanced, and 3D or code. You can pick one with an environment variable such as FTUI_HARNESS_VIEW equal to dashboard or visual_effects. A specific view runs after setting that variable and invoking the demo crate through cargo. Each screen is also a snapshot test target, and BLESS equal 1 cargo test on the demo crate updates baselines. For library consumers, the getting started doc explains embedding FrankenTUI in a Rust app. Builds use cargo build minus release, and 17 library crates are published on crates.io, so a dependent project can add ftui equal to 0.5 to its Cargo.toml instead of using the workspace. Rust nightly is required by the rust-toolchain file.

Editorial conclusion

FrankenTUI is written in Rust and spans 20 crates with 80 plus widget implementations and 46 interactive demo screens, and it is licensed under MIT plus the OpenAI and Anthropic Rider terms. The primary way to see it work is to run the demo crate through cargo, and 17 library crates are published on crates.io at version 0.5.

DEEP OPEN-SOURCE ANALYSIS

Official sources

Community notes

Community notes