gum (charmbracelet/gum)

Searching Database…

24.7K ·GitHub
What is this?Gum is a tool for glamorous shell scripts: interactive prompts, spinners, and styled output for bash or any shell, powered by Charm's Bubbles and Lip Gloss — without writing any Go code.
So is it a library I import, or a command I call from my scripts?It's a standalone command-line tool, not a library: you call gum choose, gum input, gum spin and friends from scripts or aliases. Each command prints its result to stdout, so you save it to a variable or file.
Do I need to know Go, or install anything else first?No Go knowledge needed — that's the point. The only route that requires anything extra is go install, which needs a Go toolchain; packages and binaries are ready to run.
How does my script know if the user said yes to a confirmation?gum confirm is script-friendly: it exits with code 0 for an affirmative answer and 1 for a negative one, so your script can branch with a plain if.
Do I need to be a shell scripting expert to use it?If you can write a basic script or alias you're set — every feature is a single command invocation, and the repo's examples directory shows full real-world scripts to copy from.
I mostly work on a Mac and sometimes Windows — will it run there?Yes. Binaries ship for Linux, macOS, Windows, FreeBSD, OpenBSD, and NetBSD, so the same commands follow you across machines.
Is gum free to use, even at work?MIT — free to use, modify, and ship, even commercially. Gum is part of Charm, a family of open source terminal tools.
What commands does gum actually give me?Thirteen: choose, confirm, file, filter, format, input, join, log, pager, spin, style, table, and write — covering list picking, confirmations, text input, file selection, spinners, tables, styled layouts, and leveled logging.
What do people actually build with it?The README's examples include writing commit messages, picking a commit hash from git history, connecting to a tmux session, opening files in $EDITOR, a skate password selector, uninstalling packages, cleaning up git branches, checking out GitHub pull requests with gh, copying a command from shell history, and a sudo replacement.
Can I restyle the prompts to match my setup?Yes — every command is customizable with --flags and environment variables, and gum --help shows each command's options. gum style applies coloring, borders, and spacing, and pairs with gum join for building layouts.
Does the spinner hide my command's output?By default it does, but pass --show-output to view or pipe the command's output. The spinner stops automatically when the command exits, and types range from line and dot to globe, moon, monkey, and hamburger.
What are similar projects?navi, glow, cheat, opencode, fish-shell, bashka, modd, acme.sh
Size
1.1 MB
Stars
24.7K
Age
4y
Commits · 90 Days