Kick ass and chew gum
It’s time to kick ass and chew gum.
Gum by charm_ is a set of utilities for making “glamorous” shell scripts.
Install
Arch Linux
pacman -Sy gum
Other Linux
If you can’t find it in your distributions package manager, then try installing it with Homebrew.
brew install gum
Works on macOS too.
Usage
Gum contains utilities for different tasks. They are mostly centered around interactivity in CLI.
Pager
A pager allows you to scroll around in a large amount of text.
lshw | gum pager
It can be used as an alternative to more or less commands.
Choose
Choose from a menu of options (alternative to select).
echo "What do you want to do?"
gum choose "backup" "update" "install" "reset" "test"
Input
You can prompt for input.
echo "Create admin user"
gum input --placeholder "username"
Confirm
You can also use it to show a confirmation dialog.
gum confirm "Confirm changes?"
File picker
Let user pick a file.
gum file ~
Other
Gum can also server other utility functions. Check out the list here.