Skilllibrary tui-development

install
source · Clone the upstream repo
git clone https://github.com/merceralex397-collab/skilllibrary
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/merceralex397-collab/skilllibrary "$T" && mkdir -p ~/.claude/skills && cp -r "$T/10-cli-systems-and-ops/tui-development" ~/.claude/skills/merceralex397-collab-skilllibrary-tui-development && rm -rf "$T"
manifest: 10-cli-systems-and-ops/tui-development/SKILL.md
source content

Purpose

Build terminal UIs using Textual (Python), Ratatui (Rust), or other TUI frameworks with proper event loops and rendering.

When to use this skill

  • building a TUI app in Python with Textual or Rich
  • building a TUI app in Rust with Ratatui or Crossterm
  • choosing between TUI frameworks for a new project
  • implementing common TUI patterns (lists, tables, forms, split panes)

Do not use this skill when

  • building a Go TUI — prefer
    bubbletea-go
  • building a non-interactive CLI — prefer
    cli-development-go
    or
    cli-development-python
  • debugging other processes in terminal — prefer
    terminal-debugging

Procedure

  1. Choose framework — Python: Textual (async, CSS styling). Rust: Ratatui (immediate-mode). Go: Bubble Tea.
  2. Event loop — Textual: subclass
    App
    , define
    compose()
    and handlers. Ratatui:
    loop { draw(); handle_event(); }
    .
  3. Layout — Textual: CSS grid/dock. Ratatui:
    Layout::default().constraints()
    .
  4. Widgets — use library widgets first (DataTable, ListView). Custom: implement
    Widget
    trait or
    render()
    .
  5. Input — Textual:
    BINDINGS
    class var. Ratatui: match
    crossterm::event::KeyCode
    .
  6. State — central struct/model. Update in handlers, render from state.
  7. Styling — Textual: CSS files. Ratatui:
    Style::default().fg(Color::Green)
    .
  8. Test — Textual:
    async with app.run_test() as pilot
    . Ratatui: test state separately.

Framework comparison

FeatureTextual (Python)Ratatui (Rust)Bubble Tea (Go)
ArchitectureAsync reactiveImmediate modeElm (MVU)
StylingCSS-likeInline StyleLip Gloss
WidgetsRich built-inBasic, composableBubbles library
Best forDashboardsPerformance-criticalGo CLI tools

Textual quick start

from textual.app import App, ComposeResult
from textual.widgets import Header, Footer, DataTable

class MyApp(App):
    BINDINGS = [("q", "quit", "Quit")]

    def compose(self) -> ComposeResult:
        yield Header()
        yield DataTable()
        yield Footer()

    def on_mount(self) -> None:
        table = self.query_one(DataTable)
        table.add_columns("Name", "Status", "Count")
        table.add_rows([("alpha", "ok", "42")])

Decision rules

  • Textual for Python dashboards — best widget library and CSS styling.
  • Ratatui for Rust apps needing max performance or minimal binary.
  • Bubble Tea for Go CLI tools with interactive selection.
  • Always implement quit keybinding (q or Ctrl+C).
  • Separate state from rendering — test transitions without a terminal.

References

Related skills

  • bubbletea-go
    — Go-specific TUI patterns
  • cli-development-python
    — non-interactive Python CLI
  • cli-development-go
    — non-interactive Go CLI