# gum

> CLI tool providing interactive components for shell scripts with input prompts, menus, spinners, and styling

Stars: 24.6k · Language: Go · License: MIT · Categories: Shell

- Repository: https://github.com/charmbracelet/gum
- Page: https://www.trmn.sh/tools/gum

## Install

- Homebrew: `brew install gum`
- Go: `go install github.com/charmbracelet/gum@latest`
- Package Manager: `pacman -S gum`

## Overview

Gum is a CLI utility that provides interactive components for shell scripts through pre-built commands like input prompts, selection menus, confirmations, and text formatters. Instead of writing complex terminal UI code, scripts can use commands like `gum choose` for option selection, `gum input` for text prompts, `gum confirm` for yes/no dialogs, and `gum spin` for progress indicators. The tool supports extensive customization through command-line flags and environment variables, allowing control over colors, borders, spacing, and behavior.

Built on the Bubbles and Lip Gloss Go libraries, gum enables shell script authors to create polished terminal interfaces without Go programming knowledge. Commands output their results to stdout, making them composable in shell pipelines and suitable for capturing user input in variables. The tool includes specialized components like `gum filter` for fuzzy searching, `gum file` for file selection, `gum pager` for document viewing, and `gum table` for tabular data selection.

The styling system allows creating complex layouts through commands like `gum style` for text formatting and `gum join` for combining elements vertically or horizontally. Format support includes markdown rendering, syntax highlighting, template processing, and emoji parsing. Gum targets shell script authors, DevOps engineers, and developers who need to add interactive elements to automation scripts and dotfile configurations.

### Installation

```bash
# via Homebrew
brew install gum
```

```bash
# via Go
go install github.com/charmbracelet/gum@latest
```

```bash
# via Package Manager
pacman -S gum
```

![Shell running the ./demo.sh script](https://media.trmn.sh/cached/079f67bd7e873a78ca14f6cf05ef71bee8053eb77fe7003b64f2c9774072ad7b.gif)

![Running the ./examples/commit.sh script to commit to git](https://media.trmn.sh/cached/5bc09b2f3867f4346bcee486c6d1cb63e7f818dd17c32bcee91768ce04b1b7a6.gif)

![Shell running gum filter on different bubble gum flavors](https://media.trmn.sh/cached/96e00001e0db98f11e345306c683b23f698f1c9d5e34742a51e5c07fe8ef124e.gif)

## Alternatives

- [direnv](https://www.trmn.sh/tools/direnv.md): Shell extension that automatically loads and unloads environment variables based on current directory (Go, 15.5k stars)
- [shfmt](https://www.trmn.sh/tools/shfmt.md): Shell script formatter built on a Go parser for POSIX sh, Bash, Zsh and mksh. The same repo ships a syntax package, shell helpers and an interpreter. (Go, 9.2k stars)
- [up](https://www.trmn.sh/tools/up.md): Interactive terminal UI for building Linux pipelines with live preview of command results (Go, 8.9k stars)
- [Spaceship Prompt](https://www.trmn.sh/tools/spaceship-prompt.md): Customizable Zsh prompt that shows Git/Mercurial status, language runtime versions, Docker, Kubernetes, battery and more, with support for custom sections. (Shell, 20.6k stars)
- [atuin](https://www.trmn.sh/tools/atuin.md): Shell history management with SQLite storage, search interface, and encrypted sync across machines (Rust, 32.2k stars)

---

Canonical: https://www.trmn.sh/tools/gum
