MCPcopy Index your code
hub / github.com/facebookincubator/superconsole

github.com/facebookincubator/superconsole @v2026.07.06.00

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2026.07.06.00 ↗ · + Follow
349 symbols 964 edges 31 files 107 documented · 31%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

A component-based framework for building Rust Text-based User Interfaces (TUIs)

There are several copies of this repo on GitHub, facebookincubator/superconsole is the canonical one.

The superconsole framework provides a powerful line based abstraction over text based rendering to the terminal. It also provides basic building blocks like line manipulation, and a higher level of composable components. A base set of "batteries" components are included to help developers create Text-based User Interfaces (TUIs) as quickly as possible.

The design choices that underly superconsole are selected to prioritize testability, ease of composition, and flexibility.

Superconsole also offers stylization, including italics, underlining, bolding, and coloring text. Furthermore, relying on crossterm ensures that it is compatible with Windows, Unix, and MacOS.

Finally, superconsole delineates between rendering logic and program state - each render call accepts an immutable reference to state, which components may use to inject state into their otherwise immutable rendering logic.

Demo

Superconsole running some buck2 tests

Examples

use std::convert::Infallible;

use superconsole::components::bordering::{Bordered, BorderedSpec};
use superconsole::{Component, Dimensions, DrawMode, Lines, SuperConsole};

#[derive(Debug)]
struct HelloWorld;

impl Component for HelloWorld {
    type Error = Infallible;

    fn draw_unchecked(&self, _dimensions: Dimensions, _mode: DrawMode) -> Result<Lines, Infallible> {
        Ok(Lines(vec![
            vec!["Hello world!".to_owned()].try_into().unwrap(),
        ]))
    }
}

pub fn main() -> anyhow::Result<()> {
    let bordering = BorderedSpec::default();
    let mut superconsole = SuperConsole::new().ok_or_else(|| anyhow::anyhow!("Not a TTY"))?;
    let component = Bordered::new(HelloWorld, bordering);
    superconsole.render(&component)?;
    superconsole.finalize(&component)?;
    Ok(())
}

See the CONTRIBUTING file for how to help out.

License

Superconsole is both MIT and Apache License, Version 2.0 licensed, as found in the LICENSE-MIT and LICENSE-APACHE files.

Extension points exported contracts — how you extend this code

Component (Interface)
Components are pluggable drawers that output lines of formatted text. They are composable (eventually) and re-render in [23 …
src/components.rs
SuperConsoleOutput (Interface)
(no doc) [3 implementers]
src/output.rs
SuperConsoleTestingExt (Interface)
(no doc) [1 implementers]
src/testing.rs
IsTtyWrite (Interface)
(no doc) [1 implementers]
src/output.rs

Core symbols most depended-on inside this repo

draw
called by 35
src/components/splitting.rs
len
called by 22
src/content/span.rs
render
called by 20
src/superconsole.rs
push
called by 20
src/content/line.rs
iter
called by 16
src/content/span.rs
emit
called by 14
src/superconsole.rs
saturating_sub
called by 13
src/dimensions.rs
is_empty
called by 13
src/content/span.rs

Shape

Method 191
Function 92
Class 51
Enum 11
Interface 4

Languages

Rust100%

Modules by API surface

src/content/lines.rs50 symbols
src/content/span.rs38 symbols
src/superconsole.rs34 symbols
src/content/line.rs31 symbols
src/output.rs24 symbols
src/testing.rs19 symbols
src/components/splitting.rs16 symbols
src/dimensions.rs15 symbols
src/components/alignment.rs14 symbols
src/components/padding.rs11 symbols
src/components/bordering.rs10 symbols
src/components/spinner.rs9 symbols

For agents

$ claude mcp add superconsole \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page