shui

🧩 Components

Messages, text, layout, badges, pills, boxes, and tables.

πŸ’¬ Messages

shui message is the preferred unified API for inline messages.

shui message <type> <text>
TypeOutput
successIcon + success-coloured text
errorIcon + error-coloured text
warningIcon + warning-coloured text
infoIcon + info-coloured text
mutedItalic 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 days

The 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β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

On this page