uiprogress alternatives and similar packages
Based on the "Advanced Console UIs" category.
Alternatively, view uiprogress alternatives based on common mentions on social networks and blogs.
-
Rich Interactive Widgets for Terminal UIs
Terminal UI library with rich, interactive widgets — written in Golang -
go-prompt
Building powerful interactive prompts in Go, inspired by python-prompt-toolkit. -
tcell
Tcell is an alternate terminal package, similar in some ways to termbox, but better in others. -
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. -
progressbar
A really basic thread-safe progress bar for Golang applications -
asciigraph
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies. -
termenv
Advanced ANSI style & color support for your terminal applications -
aurora
Golang ultimate ANSI-colors that supports Printf/Sprintf methods -
uitable
A go library to improve readability in terminal apps using tabular data -
termtables
A Go port of the Ruby library terminal-tables for simple ASCII table generation as well as providing markdown and HTML output -
chalk
Intuitive package for prettifying terminal/console output. http://godoc.org/github.com/ttacon/chalk -
GCli
🖥 Go CLI application, tool library, running CLI commands, support console color, user interaction, progress display, data formatting display, generate bash/zsh completion add more features. Go的命令行应用,工具库,运行CLI命令,支持命令行色彩,用户交互,进度显示,数据格式化显示,生成bash/zsh命令补全脚本 -
yacspin
Yet Another CLi Spinner; providing over 80 easy to use and customizable terminal spinners for multiple OSes -
tabular
Tabular simplifies printing ASCII tables from command line utilities -
bubble-table
A customizable, interactive table component for the Bubble Tea framework -
marker
🖍️ Marker is the easiest way to match and mark strings for colorful terminal outputs! -
ctc
Console Text Colors - The non-invasive cross-platform terminal color library does not need to modify the Print method -
crab-config-files-templating
Dynamic configuration file templating tool for kubernetes manifest or general configuration files
Updating dependencies is time-consuming.
Do you think we are missing an alternative of uiprogress or a related project?
README
uiprogress

A Go library to render progress bars in terminal applications. It provides a set of flexible features with a customizable API.
[example](doc/example_full.gif)
Progress bars improve readability for terminal applications with long outputs by providing a concise feedback loop.
Features
- Multiple Bars: uiprogress can render multiple progress bars that can be tracked concurrently
- Dynamic Addition: Add additional progress bars any time, even after the progress tracking has started
- Prepend and Append Functions: Append or prepend completion percent and time elapsed to the progress bars
- Custom Decorator Functions: Add custom functions around the bar along with helper functions
Usage
To start listening for progress bars, call uiprogress.Start()
and add a progress bar using uiprogress.AddBar(total int)
. Update the progress using bar.Incr()
or bar.Set(n int)
. Full source code for the below example is available at [example/simple/simple.go](example/simple/simple.go)
uiprogress.Start() // start rendering
bar := uiprogress.AddBar(100) // Add a new bar
// optionally, append and prepend completion and elapsed time
bar.AppendCompleted()
bar.PrependElapsed()
for bar.Incr() {
time.Sleep(time.Millisecond * 20)
}
This will render the below in the terminal
[example](doc/example_simple.gif)
Using Custom Decorators
You can also add a custom decorator function in addition to default bar.AppendCompleted()
and bar.PrependElapsed()
decorators. The below example tracks the current step for an application deploy progress. Source code for the below example is available at [example/full/full.go](example/full/full.go)
var steps = []string{"downloading source", "installing deps", "compiling", "packaging", "seeding database", "deploying", "staring servers"}
bar := uiprogress.AddBar(len(steps))
// prepend the current step to the bar
bar.PrependFunc(func(b *uiprogress.Bar) string {
return "app: " + steps[b.Current()-1]
})
for bar.Incr() {
time.Sleep(time.Millisecond * 10)
}
Rendering Multiple bars
You can add multiple bars using uiprogress.AddBar(n)
. The below example demonstrates updating multiple bars concurrently and adding a new bar later in the pipeline. Source for this example is available at [example/multi/multi.go](example/multi/multi.go)
waitTime := time.Millisecond * 100
uiprogress.Start()
// start the progress bars in go routines
var wg sync.WaitGroup
bar1 := uiprogress.AddBar(20).AppendCompleted().PrependElapsed()
wg.Add(1)
go func() {
defer wg.Done()
for bar1.Incr() {
time.Sleep(waitTime)
}
}()
bar2 := uiprogress.AddBar(40).AppendCompleted().PrependElapsed()
wg.Add(1)
go func() {
defer wg.Done()
for bar2.Incr() {
time.Sleep(waitTime)
}
}()
time.Sleep(time.Second)
bar3 := uiprogress.AddBar(20).PrependElapsed().AppendCompleted()
wg.Add(1)
go func() {
defer wg.Done()
for i := 1; i <= bar3.Total; i++ {
bar3.Set(i)
time.Sleep(waitTime)
}
}()
// wait for all the go routines to finish
wg.Wait()
This will produce
[example](doc/example_multi.gif)
Incr
counter
Bar.Incr() is an atomic counter and can be used as a general tracker, making it ideal for tracking progress of work fanned out to a lots of go routines. The source code for the below example is available at [example/incr/incr.go](example/incr/incr.go)
runtime.GOMAXPROCS(runtime.NumCPU()) // use all available cpu cores
// create a new bar and prepend the task progress to the bar and fanout into 1k go routines
count := 1000
bar := uiprogress.AddBar(count).AppendCompleted().PrependElapsed()
bar.PrependFunc(func(b *uiprogress.Bar) string {
return fmt.Sprintf("Task (%d/%d)", b.Current(), count)
})
uiprogress.Start()
var wg sync.WaitGroup
// fanout into go routines
for i := 0; i < count; i++ {
wg.Add(1)
go func() {
defer wg.Done()
time.Sleep(time.Millisecond * time.Duration(rand.Intn(500)))
bar.Incr()
}()
}
time.Sleep(time.Second) // wait for a second for all the go routines to finish
wg.Wait()
uiprogress.Stop()
Installation
$ go get -v github.com/gosuri/uiprogress
Todos
- [ ] Resize bars and decorators by auto detecting window's dimensions
- [ ] Handle more progress bars than vertical screen allows
License
uiprogress is released under the MIT License. See LICENSE.
*Note that all licence references and agreements mentioned in the uiprogress README section above
are relevant to that project's source code only.