# Gum: Glamorous Shell Scripts with Interactive UI Components

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/charmbracelet-gum
Generated for open source discovery and AI-assisted research.

Gum is a command-line tool from Charmbracelet designed to inject glamorous, interactive UI components into your shell scripts. It empowers developers to create engaging command-line experiences, leveraging the power of Bubbles and Lip Gloss without needing to write Go code. Easily add prompts, spinners, tables, and other interactive elements to make your scripts more user-friendly and visually appealing.

GitHub: https://github.com/charmbracelet/gum
OSRepos URL: https://osrepos.com/repo/charmbracelet-gum

## Summary

Gum is a command-line tool from Charmbracelet designed to inject glamorous, interactive UI components into your shell scripts. It empowers developers to create engaging command-line experiences, leveraging the power of Bubbles and Lip Gloss without needing to write Go code. Easily add prompts, spinners, tables, and other interactive elements to make your scripts more user-friendly and visually appealing.

## Topics

- bash
- shell
- Go
- cli-tools
- interactive-ui
- developer-tools

## Repository Information

Last analyzed by OSRepos: Sat Dec 20 2025 20:00:47 GMT+0000 (Western European Standard Time)
Detail views: 3
GitHub clicks: 5

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction

Gum is an open-source command-line tool developed by Charmbracelet, renowned for creating visually stunning and highly functional terminal applications. It enables you to enhance your shell scripts with a variety of interactive UI components, transforming mundane scripts into glamorous and user-friendly experiences. Built on top of Charmbracelet's popular Bubbles and Lip Gloss libraries, Gum provides ready-to-use utilities like input prompts, confirmations, file pickers, spinners, and more, all accessible directly from your Bash or Zsh scripts.

## Installation

Installing Gum is straightforward, with multiple options available depending on your operating system and preferred package manager.

**Using a package manager:**

bash
# macOS or Linux
brew install gum

# Arch Linux
pacman -S gum

# Nix
nix-env -iA nixpkgs.gum

# Flox
flox install gum

# Windows (via WinGet or Scoop)
winget install charmbracelet.gum
scoop install charm-gum


For Debian/Ubuntu, Fedora/RHEL/OpenSuse, and FreeBSD, detailed instructions are available in the official [Gum README](https://github.com/charmbracelet/gum#installation){target="_blank"}.

**Download binaries or packages:**

Pre-compiled [packages and binaries](https://github.com/charmbracelet/gum/releases){target="_blank"} are available for various platforms including Linux, macOS, Windows, and BSDs.

**Install with Go:**

If you have Go installed, you can also install Gum directly:

bash
go install github.com/charmbracelet/gum@latest


## Examples

Gum offers a wide array of commands to make your shell scripts more interactive and powerful. Here are a few examples demonstrating its utility:

**1. Crafting Conventional Commits:**
Combine `gum choose`, `gum input`, and `gum write` to create a guided commit message workflow.

bash
TYPE=$(gum choose "fix" "feat" "docs" "style" "refactor" "test" "chore" "revert")
SCOPE=$(gum input --placeholder "scope")
SUMMARY=$(gum input --value "$TYPE$SCOPE: " --placeholder "Summary of this change")
DESCRIPTION=$(gum write --placeholder "Details of this change")
gum confirm "Commit changes?" && git commit -m "$SUMMARY" -m "$DESCRIPTION"


**2. Interactive File Selection for Editor:**
Open a file selected interactively using `gum file`.

bash
$EDITOR $(gum file $HOME)


**3. Selecting a `tmux` Session:**
Filter and select an active `tmux` session.

bash
SESSION=$(tmux list-sessions -F \#S | gum filter --placeholder "Pick session...")
tmux switch-client -t "$SESSION" || tmux attach -t "$SESSION"


**4. Uninstalling Multiple Packages:**
Interactively choose multiple packages to uninstall using `gum choose`.

bash
brew list | gum choose --no-limit | xargs brew uninstall


For more examples and detailed usage, refer to the [examples directory](https://github.com/charmbracelet/gum/tree/main/examples){target="_blank"} in the repository.

## Why Use Gum?

Gum empowers developers to elevate their shell scripts from basic automation to sophisticated, interactive command-line applications.
*   **Enhanced User Experience:** Replace plain text prompts with visually appealing and interactive elements like spinners, choices, and input fields.
*   **Simplified Scripting:** Leverage pre-built, highly configurable UI components without needing to delve into complex UI programming or Go development.
*   **Increased Productivity:** Streamline workflows by making scripts more intuitive and less error-prone, guiding users through complex operations.
*   **Modern Aesthetics:** Bring the signature Charmbracelet style, known for its elegant and minimalist design, directly to your terminal scripts.

## Links

*   **GitHub Repository:** [https://github.com/charmbracelet/gum](https://github.com/charmbracelet/gum){target="_blank"}
*   **Go Documentation:** [https://pkg.go.dev/github.com/charmbracelet/gum?tab=doc](https://pkg.go.dev/github.com/charmbracelet/gum?tab=doc){target="_blank"}
*   **Releases:** [https://github.com/charmbracelet/gum/releases](https://github.com/charmbracelet/gum/releases){target="_blank"}
*   **Charmbracelet Website:** [https://charm.sh/](https://charm.sh/){target="_blank"}