bash-cli-spinners offers a collection of over 80 visually appealing spinners for terminal applications, inspired by cli-spinners. With features like color support, clean output management, and an interactive web gallery, this library enhances the user experience in Bash and Zsh scripts, making command-line interfaces more dynamic and engaging.
The bash-cli-spinners project is a comprehensive library offering over 80 vibrant spinners designed specifically for terminal applications using Bash or Zsh. This library draws inspiration from the well-known cli-spinners and provides a straightforward way to enhance scripts with engaging loading indicators.
Key Features
- Extensive Collection: Access to more than 80 spinners available from the
cli-spinners
package. - JSON-based Structure: Facilitates ease of extension and maintenance, making it user-friendly for developers.
- Colorful Presentation: Select from 14 different colors for spinner display.
- Dual Modes of Operation: Options to show spinners for a set duration or while executing commands.
- Clean Output Handling: Ensures proper cursor management and output cleanup for a polished user experience.
- Interactive Web Gallery: Explore all spinners in a visually engaging interface at the Live Demo.
Quick Usage Examples
Effortlessly incorporate spinners into your scripts with simple commands:
# List all available spinners
./spinner.sh list
# Display a spinner for 5 seconds
./spinner.sh show dots 5 "Loading data" blue
# Run a command with an accompanying spinner
./spinner.sh run pong "Installing packages" bright_green sleep 10
Basic Command Structure
The library supports a straightforward command structure:
./spinner.sh show <spinner_name> <duration> [message] [color]
./spinner.sh run <spinner_name> [message] [color] <command>
Examples of Use
- Simple Spinner:
./spinner.sh show dots 3
- Interactive Command:
./spinner.sh run weather "Downloading files" cyan curl -O https://example.com/file.zip
Available Colors
Utilize a diverse palette for your spinners:
Basic Colors
Bright Colors
Architecture Overview
Each spinner configuration is structured in the spinners.json
file, following this format:
{
"spinner_name": {
"interval": 80,
"frames": ["frame1", "frame2", "frame3"]
}
}
- Interval: Defines the time between frames in milliseconds.
- Frames: Contains an array of strings or characters used for display.
Related Resources
For further enhancements and integrations, refer to the cli-spinners project.
No comments yet.
Sign in to be the first to comment.