github.com/charmbracelet/gum
This package has a good security score with no known vulnerabilities.
Community Reviews
Polished CLI component builder with excellent shell scripting integration
The day-to-day experience is surprisingly pleasant for shell scripting. Each component (input, choose, filter, confirm, etc.) is a separate subcommand with intuitive flags. Error handling is straightforward since you're just parsing stdout/stderr. The styling options are comprehensive without being overwhelming, and the default themes look professional out of the box.
For Go projects specifically, the DX is less ideal since you lose type safety and have to manage subprocess execution. Documentation is clear with good examples, but there's no API reference since it's CLI-focused. The getting-started guide works well, though migration notes between versions could be more explicit about breaking changes in flag naming.
Best for: Shell scripts and automation tools that need polished interactive prompts and formatted output without writing full TUI applications.
Avoid if: You need tight Go integration with type safety or are building complex stateful terminal applications that would benefit from a full TUI framework.
Simple CLI UI tool with minimal security surface but limited validation
The library doesn't provide input validation primitives beyond basic type constraints (numbers, date formats). You're responsible for all sanitization and validation logic. Error handling is primitive - most failures return generic exit codes without structured errors, making debugging difficult. There's no built-in protection against terminal escape sequence injection, so accepting raw user input requires external validation.
From a security perspective, gum is minimal - it has few dependencies and a small attack surface. However, it's not designed with security-by-default principles. Authentication/authorization concepts don't apply here. For production applications handling sensitive data, consider native Go libraries like survey or promptui that give you more control over validation pipelines and don't require shelling out.
Best for: Internal developer tools and build scripts where inputs are trusted and security requirements are minimal.
Avoid if: You need production-grade input validation, handle sensitive data, or require structured error handling for security auditing.
Elegant CLI prompts via shell commands, not a Go library
The DX is surprisingly good for shell-based tooling. Each command has clear, consistent flags and helpful usage text. Error messages are straightforward, and the visual output is polished with great color and styling options. However, there's no autocomplete, type safety, or compile-time validation since you're essentially building shell commands as strings. Debugging requires running commands manually to understand behavior.
For quick CLI prototypes or shell scripts wrapped in Go, it's fantastic - you get production-quality prompts without writing UI code. For complex applications requiring tight integration, error handling, or programmatic control flow, consider bubbletea (Charm's actual Go library) instead.
Best for: Rapid prototyping of CLI tools or wrapping shell-like workflows in Go with minimal code.
Avoid if: You need type-safe APIs, complex state management, or deep integration with Go application logic.
Sign in to write a review
Sign In