SkillAgentSearch skills...

Pterm

✨ 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.

Install / Use

/learn @pterm/Pterm

README

<!--suppress HtmlDeprecatedAttribute --> <h1 align="center">πŸ’» PTerm | Pretty Terminal Printer</h1> <p align="center">A modern Go framework to make beautiful CLIs</p> <p align="center"> <a href="https://github.com/pterm/pterm/releases" style="text-decoration: none"> <img src="https://img.shields.io/github/v/release/pterm/pterm?style=flat-square" alt="Latest Release"> </a> <a href="https://github.com/pterm/pterm/stargazers" style="text-decoration: none"> <img src="https://img.shields.io/github/stars/pterm/pterm.svg?style=flat-square" alt="Stars"> </a> <a href="https://github.com/pterm/pterm/fork" style="text-decoration: none"> <img src="https://img.shields.io/github/forks/pterm/pterm.svg?style=flat-square" alt="Forks"> </a> <a href="https://opensource.org/licenses/MIT" style="text-decoration: none"> <img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square" alt="License: MIT"> </a> <a href="https://codecov.io/gh/pterm/pterm" style="text-decoration: none"> <img src="https://img.shields.io/codecov/c/gh/pterm/pterm?color=magenta&logo=codecov&style=flat-square" alt="Downloads"> </a> <a href="https://codecov.io/gh/pterm/pterm" style="text-decoration: none"> <!-- unittestcount:start --><img src="https://img.shields.io/badge/Unit_Tests-28774-magenta?style=flat-square" alt="Forks"><!-- unittestcount:end --> </a> <br/> <a href="https://github.com/pterm/pterm/releases" style="text-decoration: none"> <img src="https://img.shields.io/badge/platform-windows%20%7C%20macos%20%7C%20linux-informational?style=for-the-badge" alt="Downloads"> </a> <a href="https://marvin.ws/twitter"> <img src="https://img.shields.io/badge/Twitter-%40MarvinJWendt-1DA1F2?logo=twitter&style=for-the-badge"/> </a> <br/> <br/> <a href="https://github.com/pterm/pterm/tree/master/_examples/demo/demo" style="text-decoration: none"> <img src="https://raw.githubusercontent.com/pterm/pterm/master/_examples/demo/demo/animation.svg" alt="PTerm"> </a> <p align="center"><a href="https://github.com/pterm/pterm/tree/master/_examples/demo/demo" >Show Demo Code</p></p> </p>
<p align="center"> <strong><a href="https://pterm.sh">PTerm.sh</a></strong> | <strong><a href="#-installation">Installation</a></strong> | <strong><a href="https://docs.pterm.sh/getting-started">Getting Started</a></strong> | <strong><a href="https://docs.pterm.sh/">Documentation</a></strong> | <strong><a href="https://github.com/pterm/pterm/tree/master/_examples">Examples</a></strong> | <strong><a href="https://github.com/pterm/pterm/discussions?discussions_q=category%3AQ%26A">Q&A</a></strong> | <strong><a href="https://discord.gg/vE2dNkfAmF">Discord</a></strong> </p>

πŸ“¦ Installation

To make PTerm available in your project, you can run the following command.
Make sure to run this command inside your project, when you're using go modules πŸ˜‰

go get github.com/pterm/pterm

⭐ Main Features

| Feature | Description | |------------------|-----------------------------------------------------| | πŸͺ€ Easy to use | PTerm emphasizes ease of use, with examples and consistent component design. | | πŸ€Ήβ€β™€οΈ Cross-Platform | PTerm works on various OS and terminals, including Windows CMD, macOS iTerm2, and in CI systems like GitHub Actions. | | πŸ§ͺ Well tested | A high test coverage and <!-- unittestcount2:start -->28774<!-- unittestcount2:end --> automated tests ensure PTerm's reliability. | | ✨ Consistent Colors | PTerm uses the ANSI color scheme for uniformity and supports TrueColor for advanced terminals. | | πŸ“š Component system | PTerm's flexible Printers can be used individually or combined to generate beautiful console output. | | πŸ›  Configurable | PTerm is ready to use without configuration but allows easy customization for unique terminal output. | | ✏ Documentation | Access comprehensive docs on pkg.go.dev and view practical examples in the examples section. |

Printers (Components)

<div align="center"> <!-- printers:start -->

| Feature | Feature | Feature | Feature | Feature | | :-------: | :-------: | :-------: | :-------: | :-------: | | Area <br/> (Examples) |Barchart <br/> (Examples) |Basictext <br/> (Examples) |Bigtext <br/> (Examples) |Box <br/> (Examples) | | Bulletlist <br/> (Examples) |Center <br/> (Examples) |Coloring <br/> (Examples) |Header <br/> (Examples) |Heatmap <br/> (Examples) | | Interactive confirm <br/> (Examples) |Interactive continue <br/> (Examples) |Interactive multiselect <br/> (Examples) |Interactive select <br/> (Examples) |Interactive textinput <br/> (Examples) | | Logger <br/> (Examples) |Multiple-live-printers <br/> (Examples) |Panel <br/> (Examples) |Paragraph <br/> (Examples) |Prefix <br/> (Examples) | | Progressbar <br/> (Examples) |Section <br/> (Examples) |Slog <br/> (Examples) |Spinner <br/> (Examples) |Style <br/> (Examples) | | Table <br/> (Examples) |Test.sh <br/> (Examples) |Theme <br/> (Examples) |Tree <br/> (Examples) | |

<!-- printers:end --> </div>
<div align="center">

πŸ¦Έβ€β™‚οΈ Sponsors

<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg" />
</div>

πŸ§ͺ Examples

<p align="center"> <table> <tbody> <td align="center"> <img width="2000" height="0"><br> <a href="https://github.com/pterm/pterm/tree/master/_examples">‼️ You can find all the examples, in a much better structure and their source code, in "_examples" ‼️</a><br> <sub>Click on the link above to show the examples folder.</sub> <img width="2000" height="0"> </td> </tbody> </table> </p> <!-- examples:start -->

area/demo

Animation

<details> <summary>SHOW SOURCE</summary>
package main

import (
	"time"

	"github.com/pterm/pterm"
	"github.com/pterm/pterm/putils"
)

func main() {
	// Print an informational message using PTerm's Info printer.
	// This message will stay in place while the area updates.
	pterm.Info.Println("The previous text will stay in place, while the area updates.")

	// Print two new lines as spacer.
	pterm.Print("\n\n")

	// Start the Area printer from PTerm's DefaultArea, with the Center option.
	// The Area printer allows us to update a specific area of the console output.
	// The returned 'area' object is used to control the area updates.
	area, _ := pterm.DefaultArea.WithCenter().Start()

	// Loop 10 times to update the area with the current time.
	for i := 0; i < 10; i++ {
		// Get the current time, format it as "15:04:05" (hour:minute:second), and convert it to a string.
		// Then, create a BigText from the time string using PTerm's DefaultBigText and putils NewLettersFromString.
		// The Srender() function is used to save the BigText as a string.
		str, _ := pterm.DefaultBigText.WithLetters(putils.LettersFromString(time.Now().Format("15:04:05"))).Srender()

		// Update the Area contents with the current time string.
		area.Update(str)

		// Sleep for a second before the next update.
		time.Sleep(time.Second)
	}

	// Stop the Area printer after all updates are done.
	area.Stop()
}

</details>

area/center

Animation

<details> <summary>SHOW SOURCE</summary>
package main

import (
	"time"

	"github.com/pterm/pterm"
)

func main() {
	// Start a new default area in the center of the terminal.
	// The Start() function returns the created area and an error.
	area, _ := pterm.DefaultArea.WithCenter().Start()

	// Loop 5 times to simulate a dynamic update.
	for i := 0; i < 5; i++ {
		// Update the content of the area with the current count.
		// The Sprintf function is used to format the string.
		area.Update(pterm.Sprintf("Current count: %d\nAreas can update their content dynamically!", i))

		// Pause for a second to simulate a t
View on GitHub
GitHub Stars5.4k
CategoryDevelopment
Updated2d ago
Forks215

Languages

Go

Security Score

100/100

Audited on Mar 20, 2026

No findings