PTerm for Go: printers, live areas and prompts for terminal output
✨ PTerm is a modern Go module to easily beautify console output. Featuring charts, progressbars, tables, trees, text input, select menus and much more 🚀 It's completely configurable and 100% cross-platform compatible.
At a glance
- What is it?
- PTerm is an MIT-licensed Go module that turns console output into reusable printers such as tables, trees, progress bars and interactive prompts. This article covers how the printers are built, what the module requires from your toolchain, and where it stops.
- Who is it for?
- Use PTerm if you write Go command line tools and want tables, spinners, progress bars and prompts without assembling ANSI escape codes yourself. Skip it if your toolchain is older than Go 1.26.0, or if you need argument parsing, since the printers cover output and input prompts only.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 34 days ago.
- What is it written in?
- Mainly Go, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- pterm/pterm5,568 ★ · +28
| Repository | 2026-09-23 | 2026-11-15 |
|---|---|---|
| pterm/pterm | 5.5k | 5.6k |
28 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
One go get adds the module, and go.mod demands Go 1.26.0
The only install route is the Go module system. Inside your project, you run:
go get github.com/pterm/ptermThe module's own `go.mod` declares `go 1.26.0`. That is a recent toolchain requirement, so a project pinned to an older Go release will either be forced to upgrade or fail to resolve the dependency. Check your CI images and your Dockerfiles before running the command, because the failure shows up at the point you add the module, not later.
The module path is `github.com/pterm/pterm`, the default branch is `master`, and the licence is MIT. The latest tag is v0.12.84, published on 10 October 2026, so the module is still on a 0.x version line.
Every component is a Printer value you configure by chaining
PTerm's unit of design is the Printer. The README calls them components, and the repository has one source file and one test file per printer: `area_printer.go`, `barchart.go`, `box_printer.go`, `bulletlist_printer.go`, `heatmap_printer.go` and so on. The list of examples names area, barchart, basictext, bigtext, box, bulletlist, center, coloring, header, heatmap, logger, panel, paragraph, prefix, progressbar, section, slog, spinner, style, table, theme and tree.
Configuration happens by chaining. The area example in the README starts a centred live area with `pterm.DefaultArea.WithCenter().Start()`. Each printer has a `Default` value you start from, and `With` methods return a modified copy for the option you want.
Because printers can be used on their own or combined, you can adopt one of them, say the table, and leave the rest of your output alone. Nothing forces an all-or-nothing rewrite of your logging.
Live printers redraw in place, and you must stop them yourself
Area, spinner and progress bar are live printers: they update a region of the terminal instead of appending lines. The area example makes the behaviour explicit with a comment saying that only the area redraws while anything printed before it stays put. The repository also contains `interface_live_printer.go` and a `multiple-live-printers` example, so running several live elements at once is a documented case, not an accident.
The consequence is lifecycle management. A live printer is started with `Start()`, and the example captures its return values, which means you hold a handle that needs to be stopped when the work finishes. If your program exits early or panics halfway through, the terminal is left showing whatever the last frame was.
Live redrawing also depends on the terminal honouring cursor movement. The module pulls in `atomicgo.dev/cursor` for that job.
Interactive prompts cover confirm, continue, select, multiselect and text input
There are five interactive printers: confirm, continue, multiselect, select and textinput. Each has its own source file and its own example folder. They read keystrokes through `atomicgo.dev/keyboard`, which is a direct dependency in `go.mod`, and `github.com/lithammer/fuzzysearch` sits alongside it in the same list.
The limit here is that prompts need a real keyboard source. A program that runs in a pipeline with no attached terminal has no one to answer a select menu, so a tool that must also run unattended needs a separate non-interactive path in your own code. The module has an `interactive_test.go` file, but nothing in the README tells you how a prompt behaves when standard input is not a terminal, so test that case before shipping.
Prompts also do not replace a command line parser. The printer list covers output and questions to the user. Reading flags and subcommands is left to another library.
Cross-platform means Windows CMD, iTerm2 and GitHub Actions are named targets
PTerm states that it works on various operating systems and terminals and names three: `Windows CMD`, `macOS iTerm2`, and CI systems such as `GitHub Actions`. The dependency list supports the claim, with `golang.org/x/sys`, `golang.org/x/term` and `github.com/containerd/console` as the platform-facing packages, and `github.com/mattn/go-runewidth` plus `golang.org/x/text` for measuring character width.
Colours follow the ANSI colour scheme for consistency, and `TrueColor` is supported for terminals that can show it. Where a terminal lacks TrueColor, a colour you picked with a precise RGB value will be shown differently, so check the look in the weakest terminal your users run.
Wide characters are the place cross-platform output usually breaks, which is why the width library matters. The README gives no per-terminal compatibility table beyond the three names above, so treat anything else as untested until you try it.
1538 tests and a contract test back the output, but the version is still 0.12
The README states high test coverage and 1538 automated tests. The file listing agrees with the emphasis: nearly every printer has a matching `_test.go`, and there are also `concurrency_test.go` and `contract_test.go`. The stated tooling includes `codecov.yml`, `.golangci.yml` and a `Taskfile.yml`.
Stability is a separate question. The module is on v0.12.84, and the repository keeps a `deprecated.go` file, which tells you older APIs are retained there while newer ones replace them. Under Go module conventions a 0.x version makes no promise of a stable API, so pin the version in `go.mod` and read changes before upgrading.
Release timing is uneven. v0.12.82 came out on 13 October 2025, v0.12.83 on 25 February 2026 and v0.12.84 on 10 October 2026. The most recent push to the repository was on 12 October 2026.
What you inherit in go.mod
Adding PTerm adds its direct requirements to your build: `atomicgo.dev/cursor`, `atomicgo.dev/keyboard`, `atomicgo.dev/schedule`, `github.com/lithammer/fuzzysearch`, `github.com/mattn/go-runewidth`, `golang.org/x/sys`, `golang.org/x/term` and `golang.org/x/text`. The `testify` package is also listed as a direct requirement, which Go modules record for test code.
Indirect requirements include `github.com/clipperhouse/uax29/v2`, `github.com/containerd/console`, `github.com/davecgh/go-spew`, `github.com/pmezard/go-difflib` and `gopkg.in/yaml.v3`. None of these is a large framework, but a security-conscious team that audits dependencies has about a dozen names to review.
The repository also holds `AGENTS.md` and `CLAUDE.md` at the top level, and a `SECURITY.md` for reporting problems, which is where to send a vulnerability report instead of opening a public issue.
Editorial conclusion
Use PTerm if you write Go command line tools and want tables, spinners, progress bars and prompts without assembling ANSI escape codes yourself. Skip it if your toolchain is older than Go 1.26.0, or if you need argument parsing, since the printers cover output and input prompts only. Check the Go version in go.mod before adding it to an existing project.
Frequently asked questions
How do I install PTerm in a Go project?
Run go get github.com/pterm/pterm inside your project when you use Go modules. The module's go.mod declares go 1.26.0.
Does PTerm work on Windows and in CI?
The README names Windows CMD, macOS iTerm2 and CI systems like GitHub Actions as supported environments. It supports TrueColor on terminals that can display it.
What components does PTerm provide?
It provides printers for area, barchart, bigtext, box, bulletlist, heatmap, panel, progressbar, spinner, table, tree and more. It also has interactive confirm, continue, select, multiselect and textinput printers.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/pterm-pterm)Star history chart for your README
[](https://hysenlabs.com/projects/pterm-pterm)Was this useful?