███████╗██████╗ █████╗ ███╗ ██╗██╗ ██╗███████╗███╗ ██╗████████╗██╗ ██╗██╗
██╔════╝██╔══██╗██╔══██╗████╗ ██║██║ ██╔╝██╔════╝████╗ ██║╚══██╔══╝██║ ██║██║
█████╗ ██████╔╝███████║██╔██╗ ██║█████╔╝ █████╗ ██╔██╗ ██║ ██║ ██║ ██║██║
██╔══╝ ██╔══██╗██╔══██║██║╚██╗██║██╔═██╗ ██╔══╝ ██║╚██╗██║ ██║ ██║ ██║██║
██║ ██║ ██║██║ ██║██║ ╚████║██║ ██╗███████╗██║ ╚████║ ██║ ╚██████╔╝██║
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ ╚═╝

High‑performance terminal UI kernel -- 850K+ lines of Rust across 20 crates, 80+ widget/stateful-widget implementations, 46 interactive demo screens, a Bayesian intelligence layer, resizable pane workspaces, and in-tree web/WASM backends -- focused on correctness, determinism, and clean architecture.
The primary way to see what the system can do is the demo showcase:
cargo run -p ftui-demo-showcase (not the harness).
# Download source with curl (no installer yet)
curl -fsSL https://codeload.github.com/Dicklesworthstone/frankentui/tar.gz/main | tar -xz
cd frankentui-main
# Run the demo showcase (primary way to see what FrankenTUI can do)
cargo run -p ftui-demo-showcase
Or clone with git:
git clone https://github.com/Dicklesworthstone/frankentui.git
cd frankentui
cargo run -p ftui-demo-showcase
The Problem: Most TUI stacks make it easy to draw widgets, but hard to build correct, flicker‑free, inline UIs with strict terminal cleanup and deterministic rendering.
The Solution: FrankenTUI is a kernel‑level TUI foundation with a disciplined runtime, diff‑based renderer, and inline‑mode support that preserves scrollback while keeping UI chrome stable.
| Feature | What It Does | Example |
|---|---|---|
| Inline mode | Stable UI at top/bottom while logs scroll above | ScreenMode::Inline { ui_height: 10 } in the runtime |
| Deterministic rendering | Buffer → Diff → Presenter → ANSI, no hidden I/O | BufferDiff::compute(&prev, &next) |
| One‑writer rule | Serializes output for correctness | TerminalWriter owns all stdout writes |
| RAII cleanup | Terminal state restored even on panic | TerminalSession in ftui-core |
| Composable crates | Layout, text, style, runtime, widgets | Add only what you need |
| 80+ widgets | Block, Paragraph, Table, Input, Tree, Modal, Command Palette, etc. | Direct Widget / StatefulWidget implementations across ftui-widgets |
| Pane workspaces | Drag‑to‑resize, docking, magnetic snap, inertial throw, undo/redo | PaneTree + PaneDragResizeMachine in ftui-layout |
| Web/WASM backend | Same Rust core renders in browser-oriented environments | In-tree ftui-web + ftui-showcase-wasm |
| Bayesian intelligence | Statistical diff strategy, resize coalescing, capability detection | BOCPD, VOI, conformal prediction, e‑processes |
| Shadow‑run validation | Prove rendering determinism across runtime migrations | ShadowRun::compare() in ftui-harness |
| 46 demo screens | Dashboard, visual effects, widget gallery, layout lab, and more | cargo run -p ftui-demo-showcase |
If you want to embed FrankenTUI in your own Rust app (not just run the demo), start here: docs/getting-started.md.
For web embedding into frankentui_website (Next.js + bun), see the
Embedding In frankentui_website section in
docs/getting-started.md. It includes:
ftui-web and ftui-showcase-wasm,FrankenTermWeb is currently adjacent/out-of-tree from this checkout,FrankenTermWeb once that bundle is available,xterm.js guidance.# Demo showcase (primary)
cargo run -p ftui-demo-showcase
# Pick a specific demo view
FTUI_HARNESS_VIEW=dashboard cargo run -p ftui-demo-showcase
FTUI_HARNESS_VIEW=visual_effects cargo run -p ftui-demo-showcase
The demo showcase (cargo run -p ftui-demo-showcase) ships 46 interactive screens, each demonstrating a different subsystem:
| Category | Screens | What They Show |
|---|---|---|
| Overview | dashboard, widget_gallery, advanced_features |
Full-system demos with animated panels, sparklines, markdown streaming |
| Layout | layout_lab, layout_inspector, intrinsic_sizing, responsive_demo |
Flex/Grid solvers, pane workspaces, constraint visualization |
| Text | shakespeare, markdown_rich_text, markdown_live_editor, advanced_text_editor |
Rope editor, syntax highlighting, streaming markdown |
| Data | table_theme_gallery, data_viz, virtualized_search, log_search |
Themed tables, charts, Fenwick-backed virtualization |
| Input | forms_input, form_validation, command_palette_lab, mouse_playground |
Bayesian fuzzy search, gesture recognition, focus management |
| Visual FX | visual_effects, theme_studio, mermaid_showcase, mermaid_mega_showcase |
Gray-Scott reaction-diffusion, metaballs, Clifford attractors, fractal zooms |
| System | terminal_capabilities, performance, performance_hud, determinism_lab |
Capability probing, frame budgets, conformal risk gating |
| Diagnostics | explainability_cockpit, voi_overlay, snapshot_player, accessibility_panel |
Evidence ledgers, VOI sampling visualization, a11y tree |
| Workflow | file_browser, kanban_board, async_tasks, notifications, drag_drop |
File picker, task boards, notification toasts, drag handles |
| Advanced | inline_mode_story, hyperlink_playground, i18n_demo, macro_recorder, quake |
Inline scrollback, OSC 8 links, locale switching, event recording |
| 3D / Code | 3d_data, code_explorer, widget_builder, action_timeline |
3D data views, AST browsing, widget composition, timeline aggregation |
Each screen is also a snapshot test target. BLESS=1 cargo test -p ftui-demo-showcase updates baselines.
use ftui_core::event::Event;
use ftui_core::geometry::Rect;
use ftui_render::frame::Frame;
use ftui_runtime::{App, Cmd, Model, ScreenMode};
use ftui_widgets::paragraph::Paragraph;
struct TickApp {
ticks: u64,
}
#[derive(Debug, Clone)]
enum Msg {
Tick,
Quit,
}
impl From<Event> for Msg {
fn from(e: Event) -> Self {
match e {
Event::Key(k) if k.is_char('q') => Msg::Quit,
_ => Msg::Tick,
}
}
}
impl Model for TickApp {
type Message = Msg;
fn update(&mut self, msg: Msg) -> Cmd<Msg> {
match msg {
Msg::Tick => {
self.ticks += 1;
Cmd::none()
}
Msg::Quit => Cmd::quit(),
}
}
fn view(&self, frame: &mut Frame) {
let text = format!("Ticks: {} (press 'q' to quit)", self.ticks);
let area = Rect::new(0, 0, frame.width(), 1);
Paragraph::new(text).render(area, frame);
}
}
fn main() -> std::io::Result<()> {
App::new(TickApp { ticks: 0 })
.screen_mode(ScreenMode::Inline { ui_height: 1 })
.run()
}
| Crate | Purpose | Status |
|---|---|---|
ftui |
Public facade + prelude | Implemented |
ftui-core |
Terminal lifecycle, events, capabilities, animation, input parsing, gestures | Implemented |
ftui-render |
Buffer, diff, ANSI presenter, frame, grapheme pool, budget system | Implemented |
ftui-style |
Style + theme system with CSS‑like cascading | Implemented |
ftui-text |
Spans, segments, rope editor, cursor, BiDi, shaping, normalization | Implemented |
ftui-layout |
Flex + Grid solvers, pane workspace system (9K+ lines), e‑graph optimizer | Implemented |
ftui-runtime |
Elm/Bubbletea runtime, effect system, subscriptions, rollout policy, telemetry schema (13K+ line program.rs) | Implemented |
ftui-widgets |
80+ direct Widget / StatefulWidget implementations across the library |
Implemented |
ftui-extras |
Feature‑gated add‑ons, VFX rasterizer (opt‑level=3) | Implemented |
| Crate | Purpose | Status |
|---|---|---|
ftui-backend |
Backend abstraction layer | Implemented |
ftui-tty |
TTY terminal backend | Implemented |
ftui-web |
Web/WASM adapter with pointer/touch parity | Implemented |
ftui-showcase-wasm |
WASM build of the demo showcase | Implemented |
| Crate | Purpose | Status |
|---|---|---|
ftui-harness |
Test harness, shadow‑run comparison, benchmark gate, rollout scorecard, determinism fixtures | Implemented |
ftui-pty |
PTY‑based test utilities | Implemented |
ftui-demo-showcase |
46 interactive demo screens + snapshot tests | Implemented |
doctor_frankentui |
Integrated TUI capture, seeding, suite reporting, diagnostics, and coverage gating | Implemented |
| Crate | Purpose | Status |
|---|---|---|
ftui-a11y |
Accessibility tree and node structures | Implemented |
ftui-i18n |
Internationalization support | Implemented |
ftui-simd |
SIMD acceleration | Reserved |
| Feature | FrankenTUI | Ratatui | tui-rs (legacy) | Raw crossterm |
|---|---|---|---|---|
| Inline mode w/ scrollback | ✅ First‑class | ⚠️ App‑specific | ⚠️ App‑specific | ❌ Manual |
| Deterministic buffer diff | ✅ Kernel‑level | ✅ | ✅ | ❌ |
| One‑writer rule | ✅ Enforced | ⚠️ App‑specific | ⚠️ App‑specific | ❌ |
| RAII teardown | ✅ TerminalSession | ⚠️ App‑specific | ⚠️ App‑specific | ❌ |
| Pane workspaces (drag/resize/dock) | ✅ Built‑in | ❌ | ❌ | ❌ |
| Web/WASM backend | ✅ Shared Rust core | ❌ | ❌ | ❌ |
| Bayesian diff strategy | ✅ Adaptive | ❌ Fixed | ❌ Fixed | ❌ N/A |
| Shadow‑run validation harness | ✅ Built‑in | ❌ | ❌ | ❌ |
| Snapshot/time‑travel harness | ✅ Built‑in | ❌ | ❌ | ❌ |
| Widget count | 80+ direct impls | ~20 | ~12 | 0 |
| Demo screens | 46 | ~5 | ~5 | 0 |
When to use FrankenTUI: - You want inline + scrollback without flicker. - You care about deterministic rendering and teardown guarantees. - You need resizable pane workspaces with drag, dock, and undo. - You want a single Rust codebase targeting both terminal and web. - You prefer a kernel you can build your own UI framework on top of.
When FrankenTUI might not be ideal: - You need a stable public API today (FrankenTUI is evolving fast). - You want a fully opinionated application framework rather than a kernel.
curl -fsSL https://codeload.github.com/Dicklesworthstone/frankentui/tar.gz/main | tar -xz
cd frankentui-main
cargo build --release
git clone https://github.com/Dicklesworthstone/frankentui.git
cd frankentui
cargo build --release
# Cargo.toml
[dependencies]
ftui = { path = "../frankentui/crates/ftui" }
Currently available on crates.io:
- ftui-core
- ftui-layout
- ftui-i18n
The remaining crates are in the publish queue (render/runtime/widgets/etc.). Until those land, prefer workspace path dependencies for the full stack.
rust-toolchain.toml).bash
git clone https://github.com/Dicklesworthstone/frankentui.git
cd frankentui
cargo buildbash
cargo run -p ftui-demo-showcaseTelemetry is opt‑in. Enable the telemetry feature on ftui-runtime and set
OTEL env vars (for example, OTEL_EXPORTER_OTLP_ENDPOINT) to export spans.
When the feature is off, telemetry code and dependencies are excluded. When the feature is on but env vars are unset, overhead is a single startup check.
See docs/telemetry.md for integration patterns and trace‑parent attachment.
| Crate | Feature | What It Enables |
|---|---|---|
ftui-core |
tracing |
Structured spans for terminal lifecycle |
ftui-core |
tracing-json |
JSON output via tracing-subscriber |
| `ft |
$ claude mcp add frankentui \
-- python -m otcore.mcp_server <graph>