shui

⏳ Progress & Prompts

Progress bars, spinners, loaders, animations, and interactive prompts.

πŸ“Š Progress

Adds a newline by default. Use --inline for loop-based updates.

shui progress 50 100
shui progress 50 100 --width=30 --label="Downloading "

for i in {1..100}; do
  shui progress $i 100 --inline
  sleep 0.05
done
echo
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 50%
Downloading β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 50%

Pass --iterm (or --iterm=<state>) to also update the native macOS progress indicator in iTerm2 β€” normal, success, warning, error, indeterminate, or clear. No-op in other terminals.

πŸ”„ Spinner

Runs a command in the background with a spinner. Exits with the command's exit code, and in iTerm2 emits an indeterminate badge while running.

shui spinner "Installing…" -- brew install ripgrep

shui spinner \
  --success="Installed!" \
  --fail="Installation failed" \
  "Installing…" -- npm install

βŒ› Loader

Indeterminate loading indicator β€” loops for a fixed duration then clears the line. Use when you can't wrap a command in spinner.

shui loader "Installing packages"
shui loader --duration=10 "Building"
shui loader --style=pulse "Connecting"
StyleDescription
dotsCycling dot trail β€” . .. ...
pulseBold/dim alternating text
spinnerBraille spinner character

🎬 Animation

One-shot text effects β€” play once and exit.

shui typewriter "Deploying to production…"
shui typewriter --delay=0.05 --color=success "Done!"

shui fade-in "Welcome"
shui fade-in --steps=10 "Welcome"

πŸ’¬ Interactive

Prompt the user for confirmation, a selection, or free-form input.

# Confirm β€” exits 0 for yes, 1 for no
shui confirm "Deploy to production?"

# Select β€” numbered list, prints the chosen option to stdout
choice=$(shui select "Pick a profile:" work personal staging)

# Radio β€” ↑↓ to move, Enter to confirm
env=$(shui radio "Target environment:" development staging production)

# Multiselect β€” Space to toggle, Enter to confirm
choices=$(shui multiselect "Which packages?" brew npm cargo)

# Input β€” prints the entered value to stdout
name=$(shui input --default="world" "Your name:")

On this page