The definitive standard for beautiful, modern CLI interfaces in shell projects
A universal framework for creating stunning, interactive command-line interfaces using gum. This framework provides a standardized approach to building modern, user-friendly shell applications with consistent design patterns and robust error handling.
- π― Universal: Works with any shell project (bash, zsh, etc.)
- π¨ Beautiful: Modern, colorful interfaces with emojis and icons
- π§ Robust: Compatible with all versions of
gum - π± Interactive: Menus, confirmations, multi-select, and more
- π‘οΈ Safe: TTY detection and error handling
- π Well-documented: Complete examples and best practices
- π Fast: Lightweight and efficient
# Install gum (required)
brew install gum
# Verify installation
gum --version#!/bin/bash
# Your script with beautiful GUI
# Include the framework
source ./gui_framework.sh
# Use the functions
main() {
local action=$(show_gui_menu \
"My Project" \
"Select the action you want to perform" \
"Choose an option:" \
"π Install" \
"βοΈ Configure" \
"βΆοΈ Run" \
"β Exit")
case "$action" in
"π Install") install_project ;;
"βοΈ Configure") configure_project ;;
"βΆοΈ Run") run_project ;;
"β Exit") exit 0 ;;
esac
}
main "$@"universal-shell-gui-framework/
βββ README.md # This file
βββ gui_framework.sh # Core framework
βββ examples/
β βββ basic_example.sh # Simple example
β βββ advanced_example.sh # Complex example
β βββ project_template.sh # Project template
βββ docs/
β βββ FRAMEWORK_GUIDE.md # Complete framework guide
β βββ BEST_PRACTICES.md # Best practices
β βββ COMPONENTS.md # Available components
β βββ EXAMPLES.md # More examples
βββ templates/
βββ new_project.sh # Template for new projects
# Single selection menu
local choice=$(show_gui_menu \
"Title" \
"Subtitle" \
"Header:" \
"Option 1" \
"Option 2" \
"Option 3")
# Multi-selection menu
local selections=$(show_gui_multi_select \
"Title" \
"Subtitle" \
"Header:" \
3 \
"Feature 1" \
"Feature 2" \
"Feature 3")if show_gui_confirmation "Do you want to continue?"; then
echo "User confirmed"
else
echo "User cancelled"
filocal name=$(show_gui_input "Enter your name:" "John Doe")show_gui_spinner "Installing..." sleep 3- π΄ Red: Errors and critical alerts
- π’ Green: Success and confirmations
- π΅ Blue: Information and titles
- π‘ Yellow: Warnings and prompts
- π£ Purple: Special highlights
- βͺ Gray: Secondary text
- π Section headers
- β Success indicators
- β Error indicators
β οΈ Warnings- π§ Configuration
- π Actions
- π― Targets
- Framework Guide - Complete implementation guide
- Best Practices - Design and coding standards
- Components - All available GUI components
- Examples - Real-world usage examples
# Download the framework
curl -O https://raw.githubusercontent.com/your-username/universal-shell-gui-framework/main/gui_framework.sh
# Make it executable
chmod +x gui_framework.sh
# Include in your script
source ./gui_framework.sh# Clone the repository
git clone https://github.com/your-username/universal-shell-gui-framework.git
# Copy the framework to your project
cp universal-shell-gui-framework/gui_framework.sh ./gui_framework.sh
# Include in your script
source ./gui_framework.sh#!/bin/bash
source ./gui_framework.sh
main() {
local action=$(show_gui_menu \
"My Application" \
"What would you like to do?" \
"Select an action:" \
"π Start" \
"βοΈ Settings" \
"π Status" \
"β Quit")
case "$action" in
"π Start") start_app ;;
"βοΈ Settings") open_settings ;;
"π Status") show_status ;;
"β Quit") exit 0 ;;
esac
}
main "$@"#!/bin/bash
source ./gui_framework.sh
deploy_app() {
# Step 1: Environment selection
local env=$(show_gui_menu \
"Deployment" \
"Select deployment environment" \
"Environment:" \
"π’ Development" \
"π‘ Staging" \
"π΄ Production")
# Step 2: Confirmation
if show_gui_confirmation "Deploy to $env?"; then
# Step 3: Progress
show_gui_spinner "Deploying to $env..." sleep 5
log_success "Deployment completed!"
fi
}- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Charmbracelet for the amazing
gumtool - The shell scripting community for best practices
- All contributors who help improve this framework
Made with β€οΈ for the shell community
"Beautiful interfaces shouldn't be limited to web apps"