π§© Components
Messages, text, layout, badges, pills, boxes, and tables.
π¬ Messages
shui message is the preferred unified API for inline messages.
shui message <type> <text>| Type | Output |
|---|---|
success | Icon + success-coloured text |
error | Icon + error-coloured text |
warning | Icon + warning-coloured text |
info | Icon + info-coloured text |
muted | Italic dimmed text, no icon |
shui message success "Deployed to production"
shui message error "Connection refused"
shui message warning "API key expires in 3 days"β
Deployed to production
β Connection refused
β οΈ API key expires in 3 daysThe top-level shorthands shui success, shui error, shui warning, and
shui info remain available for quick one-liners.
π Text
Inline text formatting and semantic colour helpers.
shui bold "Bold text"
shui dim "Dimmed text"
shui italic "Italic text"
shui underline "Underlined text"
shui text --color=success "Success colour"
shui text --color=muted "Muted colour"Available colour types: success error warning info primary muted
accent.
π Layout
Structure your script output with sections, headings, and spacing.
shui section "Setup"
shui subtitle "Installing packages"
shui subsection "npm dependencies"
shui divider
shui spacerπ₯οΈ Screen
Renders a section header, runs a command, then prints elapsed time. Returns the command's exit code.
shui screen "Building" -- npm run buildβ±οΈ Timer
Lightweight per-step timing.
shui timer-start
mise plugins update
shui timer-end "Plugin index update"β± Plugin index update Β· 2sπ·οΈ Badge
Solid background inline label. Writes to stdout without a newline β use
inside $(...).
echo "Version: $(shui badge success v2.0)"
echo "Build: $(shui badge error FAIL) $(shui badge success PASS)"Available types: success error warning info primary muted.
π Pill
Rounded-edge inline tag. Also writes without a newline.
echo "Status: $(shui pill warning beta)"
shui pill 135 "custom" # any 256-colour code (0β255)π¦ Box
Bordered content block with an optional title.
shui box "Simple content inside a box"
shui box --title="Summary" "3 installed\n1 skipped\n0 errors"βββββββββββββββββ Summary ββββββββββββββββββββ
β 3 installed β
β 1 skipped β
β 0 errors β
ββββββββββββββββββββββββββββββββββββββββββββββπ Table
Pipe-separated (|) rows by default. First argument is the header. Column
widths adjust automatically.
shui table \
"Package|Version|Status" \
"node|20.11.0|$(shui badge success OK)" \
"python|3.12.0|$(shui badge warning outdated)"βββββββββββ¬βββββββββββ¬βββββββββββ
β Package β Version β Status β
βββββββββββΌβββββββββββΌβββββββββββ€
β node β 20.11.0 β OK β
β python β 3.12.0 β outdatedβ
βββββββββββ΄βββββββββββ΄βββββββββββ