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.mdsource 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
orcli-development-gocli-development-python - debugging other processes in terminal — prefer
terminal-debugging
Procedure
- Choose framework — Python: Textual (async, CSS styling). Rust: Ratatui (immediate-mode). Go: Bubble Tea.
- Event loop — Textual: subclass
, defineApp
and handlers. Ratatui:compose()
.loop { draw(); handle_event(); } - Layout — Textual: CSS grid/dock. Ratatui:
.Layout::default().constraints() - Widgets — use library widgets first (DataTable, ListView). Custom: implement
trait orWidget
.render() - Input — Textual:
class var. Ratatui: matchBINDINGS
.crossterm::event::KeyCode - State — central struct/model. Update in handlers, render from state.
- Styling — Textual: CSS files. Ratatui:
.Style::default().fg(Color::Green) - Test — Textual:
. Ratatui: test state separately.async with app.run_test() as pilot
Framework comparison
| Feature | Textual (Python) | Ratatui (Rust) | Bubble Tea (Go) |
|---|---|---|---|
| Architecture | Async reactive | Immediate mode | Elm (MVU) |
| Styling | CSS-like | Inline Style | Lip Gloss |
| Widgets | Rich built-in | Basic, composable | Bubbles library |
| Best for | Dashboards | Performance-critical | Go 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
— Go-specific TUI patternsbubbletea-go
— non-interactive Python CLIcli-development-python
— non-interactive Go CLIcli-development-go