gum
Style terminal user interfaces
TLDR
Interactively pick a specific option to print to stdout
Open an interactive prompt for the user to input a string with a specific placeholder
Open an interactive confirmation prompt and exit with either <0> or <1>
Show a spinner while a command is taking place with text alongside
Format text to include emojis
Interactively prompt for multi-line text (
SYNOPSIS
gum [command] [flags]
PARAMETERS
choose
Let a user select an option from a list
Ex: gum choose {option1 option2 option3}
confirm
Ask a user to confirm an action.
Ex: gum confirm "Are you sure?"
file
Select a file from a list.
Ex: gum file
input
Prompt a user for text input.
Ex: gum input --placeholder "Enter your name"
join
Join text vertically or horizontally.
Ex: gum join --align center "Hello" "World"
progress
Display progress bar.
Ex: gum progress --title "Downloading"
spin
Show spinner while command executes
Ex: gum spin --title "Loading" -- gum confirm "Are you sure?"
style
Style text.
Ex: gum style --foreground "#ffffff" "Some Styled Text"
write
Write content to a file.
Ex: gum write --filename "file.txt"
filter
Lets the user filter options from a list
Ex: gum filter {option1 option2 option3}
DESCRIPTION
Gum is a Go library and command-line tool for creating interactive terminal user interfaces (TUIs) with minimal code. It provides various components such as text input, file selection, confirm prompts, lists, spiners, progress bars and more, allowing developers to quickly build visually appealing and user-friendly terminal applications. Gum focuses on simplicity and ease of use, enabling developers to enhance their CLI tools with interactive features without extensive UI coding. The tool also comes with a built in style system, to allow customization of the TUI. It's commonly used to improve the user experience of shell scripts and command-line tools by adding interactive prompts and status displays.
ENVIRONMENT VARIABLES
Gum respects standard environment variables like `NO_COLOR` to disable color output.