PTerm is a Go module for building readable command-line interfaces with tables, charts, progress bars, spinners, and interactive prompts.
Overview
PTerm helps Go developers format console output with a shared component system called Printers. Components can be used alone or combined for richer CLI layouts.
Documented printers include progress bars, spinners, tables, trees, bar charts, heatmaps, panels, headers, loggers, and ANSI styling. Interactive pieces support text input, select and multiselect menus, and confirm or continue prompts.
The library emphasizes cross-platform behavior across Windows CMD, macOS terminals such as iTerm2, and Linux environments, including CI systems like GitHub Actions. It ships with extensive automated tests and works without mandatory configuration while remaining customizable.
Installation is via Go modules. Examples and documentation are published on PTerm.sh and in the examples tree.
Key features
- Composable printer components
- Progress bars and spinners
- Tables, trees, and charts
- Interactive select and text input
- ANSI colors and themes
- Logger and slog integration
- Cross-platform terminal support
- Large example catalog
Use cases
- Polished Go CLI output
- Terminal progress and status UI
- Interactive shell prompts
- CI-friendly console formatting