explaingit

cheggaaa/pb

Analysis updated 2026-07-03

3,723GoAudience · developerComplexity · 1/5Setup · easy

TLDR

A small Go library that adds a progress bar to terminal programs, showing percentage complete, current speed, and estimated time remaining as your code processes items or copies data streams.

Mindmap

mindmap
  root((pb))
    What it does
      Terminal progress bar
      Speed and ETA display
      Reader proxy tracking
    Customization
      Built-in bar styles
      Custom Go templates
      Terminal color support
    Use Cases
      File downloads
      Batch processing
      Data copy tracking
    Tech Stack
      Go library
      Standard io interfaces
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Show a progress bar while downloading a large file in a Go CLI tool so users can see download speed and time remaining instead of a frozen screen.

USE CASE 2

Add automatic byte-count progress tracking to any Go data copy by wrapping the reader or writer with a single pb proxy call.

USE CASE 3

Display a custom-formatted progress bar in a batch processing loop, using Go's text/template syntax to show exactly the fields you want.

What is it built with?

Go

How does it compare?

cheggaaa/pbnikoksr/notifygoogle/trillian
Stars3,7233,7213,727
LanguageGoGoGo
Setup difficultyeasyeasyhard
Complexity1/52/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

In plain English

pb is a small Go library for displaying a progress bar in the terminal. When a program is doing something that takes time, such as downloading a file, copying data, or processing a large list of items, a progress bar lets the user see how far along the work is and roughly how long it will still take. Without something like this, a long-running terminal program just sits silently, giving no indication of whether it is nearly done or stuck. To use pb, you tell it the total number of items or bytes you plan to process, call Start, then increment the counter as each item completes. When the work is done, you call Finish. The bar automatically shows the percentage complete, the current rate, and a visual bar that fills from left to right. The library also handles a specific common case: tracking progress while copying data through Go's standard io.Reader and io.Writer interfaces. Rather than counting items manually, you wrap your reader in a proxy reader provided by pb, and the bar updates automatically as bytes flow through. The display can be customized. There are a few built-in visual styles (simple, default, full), and you can write your own template using Go's standard text/template syntax. Built-in template elements include the bar itself, percentage, speed, elapsed time, and color functions for terminal text colors. The library can also display sizes as bytes, kilobytes, and so on rather than raw numbers, using either standard IEC or SI byte prefix naming. The README is brief. It covers installation via the standard Go package tool, three short usage examples, and a description of the available settings and templating options.

Copy-paste prompts

Prompt 1
I have a Go CLI that downloads a file and I want to show a progress bar with speed and ETA. Show me how to use the pb library to wrap an http.Response.Body reader so the bar updates as bytes flow in.
Prompt 2
How do I create a custom progress bar template with pb in Go that shows percentage, bytes transferred, speed, and elapsed time in my own layout?
Prompt 3
I'm processing a slice of 10,000 items in Go and want a progress bar. Show me the minimal pb setup to start the bar, increment it inside the loop, and finish it cleanly at the end.
Prompt 4
How do I use pb's pool feature to display multiple simultaneous progress bars in a Go terminal app, one per concurrent worker?

Frequently asked questions

What is pb?

A small Go library that adds a progress bar to terminal programs, showing percentage complete, current speed, and estimated time remaining as your code processes items or copies data streams.

What language is pb written in?

Mainly Go. The stack also includes Go.

How hard is pb to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is pb for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub cheggaaa on gitmyhub

Verify against the repo before relying on details.