r3bl-org/r3bl-open-core
Fully async Rust TUI engine 🦀. For powering AI/LLM coding agents, Cloud/SSH workflows & interactive CLIs: non-blocking readline, inline dialogs, React/Elm-style full-screen TUI, Markdown editor, PTY multiplexing & rust-analyzer MCP server.
r3bl‑open‑core (ROC)
What it is – A Rust‑based, asynchronous terminal‑user‑interface (TUI) framework that brings modern, reactive UI patterns (think React/Elm) to the command line. It ships as a monorepo of five crates, the core being r3bl_tui, and includes ready‑made productivity apps and build tools.
Why it matters for AI/LLM workflows – ROC is explicitly designed to host fast, interactive front‑ends for AI coding agents and execution harnesses. Unlike the typical Node‑/ink‑based terminals, it runs pure Rust, offers zero‑latency PTY handling, non‑blocking input, and deterministic process lifecycles—crucial when orchestrating long‑running sandboxed tools (containers, micro‑VMs, etc.).
Key capabilities
- Async, non‑blocking I/O –
readline_asynclets REPLs keep spinning background tasks while the user types. - Inline dialogs –
chooseprovides single‑shot multi‑select menus that render inline without taking over the screen. - Full‑screen apps – Reactive, panic‑safe raw‑mode UI with declarative CSS‑like styling, flexbox layouts, and a built‑in Markdown editor.
- Terminal multiplexing & PTY – In‑memory virtual terminals, virtual tabs, 2‑D horizontal panning, and a PTY‑mux that decouples subprocess output from the visible viewport.
- Unicode‑aware rendering –
GCStringcorrectly handles grapheme clusters, complex emojis, and wide characters, preventing slice panics and visual tearing. - Performance‑first design – Newtype‑based coordinate safety, SIMD‑backed
Flat2DArraybuffers, double‑buffered diff rendering, and a custom Linux‑onlydirect_to_ansidriver that bypassescrosstermfor minimal latency. - Cross‑platform – Works on Linux (native driver), macOS, Windows, and BSDs via
crosstermfallback. - Testing & benchmarking – Headless PTY test macros, visual snapshot testing, and built‑in flame‑graph profiling.
Primary use‑cases
- AI/LLM coding agents – Build terminal front‑ends for code‑generation bots that need reliable PTY orchestration and fast UI feedback.
- DevOps & cloud tooling – Rich, responsive SSH‑friendly workspaces with virtual tabs and high‑latency‑tolerant rendering.
- Interactive Markdown – Live editing with syntax highlighting and inline code execution.
- General developer productivity – Apps like
giti,edi, andenv-sourceshowcase how to compose reusable terminal components.
Ecosystem
| Crate | Role |
|---|---|
r3bl_tui |
Core async TUI engine, PTY primitives |
r3bl-cmdr |
Ready‑made productivity apps (git UI, editor, env loader) |
r3bl-build-infra |
Build‑time tools (cargo‑rustdoc‑fmt, spawny) |
r3bl-rust-analyzer-mcp-server |
High‑performance rust‑analyzer server for IDE/agent integration |
r3bl_analytics_schema |
Privacy‑first analytics & upgrade schema |
Maturity – Over 2.7 M downloads on crates.io, with automated cross‑platform testing and benchmarking baked into the repo. The project emphasizes supply‑chain integrity by limiting external dependencies to well‑maintained foundations like tokio, mio, and mimalloc.
Getting started – Add the desired crates to a Rust project via Cargo, then use the provided primitives (readline_async, choose, full‑screen widgets) to compose an app. The README includes example binaries (e.g., pty_mux_example) that demonstrate PTY multiplexing and horizontal panning.
All details are taken directly from the repository’s README; no external information has been added.
Related
- Project
- Project
- Project
- Project
- Project