Skip to content

dwgx/SmartCLI / skills/tui-ui

tui-ui

Verified

Design web-like user interfaces in the terminal and inside tmux with a cell-grid Canvas, CSS-like box model, flexbox/grid layout, and 17 reusable widgets such as Panel, Table, Card, ProgressBar, Meter, Tabs, Tree, Badge, Banner, and a braille line chart. Use when an agent needs a dashboard, panel, table, status page, TUI layout, tmux dashboard, screenshot-driven CLI/TUI replica, ANSI frame, truecolor render, pyte PNG screenshot smoke test, wide-character alignment, or a new terminal widget.

ui/__init__.py

View on GitHub
"""tui-ui — an HTML/CSS-like terminal layout engine + web-style widgets.

Design web-like UIs in the terminal (and inside tmux): a cell-grid Canvas, a CSS
box model (margin/border/padding/content), flexbox/grid layout with ``fr`` units,
and composable widgets (Panel, Table, Card, ProgressBar, Tabs, Tree, ...). Output
is a tmux-safe ANSI string — printable, composable, and renderable to PNG by the
pyte harness.

Quick start::

    from ui import Page, VStack, HStack, Panel, Table, get_theme
    theme = get_theme("dashboard")
    page = Page(VStack([Panel("hello", title="Hi", theme=theme)]), width=80, height=24)
    print(page.to_ansi())
"""
from __future__ import annotations

from .core import (BOX_STYLES, Canvas, Cell, Theme, THEMES, draw_border,
                   get_theme, gradient, parse_color, rgb, theme_names, width)
from .box import Box, Fr
from .layout import Grid, HStack, Page, Stack, VStack, grid, resolve_tracks
from .sixel import encode_sixel, print_sixel, raster_to_sixel, supports_sixel
from . import registry

__all__ = [
    "Canvas", "Cell", "Theme", "THEMES", "BOX_STYLES", "draw_border",
    "get_theme", "theme_names", "gradient", "parse_color", "rgb", "width",
    "Box", "Fr", "VStack", "HStack", "Stack", "Grid", "grid", "Page",
    "resolve_tracks", "registry",
    # sixel graphics output
    "encode_sixel", "raster_to_sixel", "print_sixel", "supports_sixel",
]
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 197kUpdated Claude CodeCodexVerifiedInstall