termui README

The project's README from github.com/gizak/termui. As one markdown file: README.md.

termui

demo cast under osx 10.10; Terminal.app; Menlo Regular 12pt.)

termui is a cross-platform and fully-customizable terminal dashboard and widget library built on top of termbox-go. It is inspired by blessed-contrib and tui-rs and written purely in Go.

Note

Please be aware that due to my fluctuating availability, the frequency of updates to this project may not always follow a consistent schedule. I would like to invite potential maintainers to contribute to this project. If you are interested in becoming a maintainer, please do not hesitate to reach out to me.

Versions

termui is currently compatible with Go 1.15 (as in go.mod) and above (tracking the Debian's oldstable). Please use the version-numbered branch as stable release. The new changes will be pushed to master branch first and then merge to version branch.

Features

Installation

Go modules

It is not necessary to go get termui, since Go will automatically manage any imported dependencies for you. Do note that you have to include /v3 in the import statements as shown in the 'Hello World' example below.

Dep

Add with dep ensure -add github.com/gizak/termui. With Dep, /v3 should not be included in the import statements.

Hello World

package main

import (
	"log"

	ui "github.com/gizak/termui/v3"
	"github.com/gizak/termui/v3/widgets"
)

func main() {
	if err := ui.Init(); err != nil {
		log.Fatalf("failed to initialize termui: %v", err)
	}
	defer ui.Close()

	p := widgets.NewParagraph()
	p.Text = "Hello World!"
	p.SetRect(0, 0, 25, 5)

	ui.Render(p)

	for e := range ui.PollEvents() {
		if e.Type == ui.KeyboardEvent {
			break
		}
	}
}

Widgets

Run an example with go run _examples/{example}.go or run each example consecutively with make run-examples.

Documentation

Uses

License

MIT

termui (gizak/termui)

Searching Database…

13.6K ·GitHub
What is this?termui is a cross-platform terminal dashboard and widget library for Go, used to build text-based UIs with charts, gauges, and tables right in the terminal.
Is it a library or a standalone app?It's a Go library you import into your own program to render dashboards; it's built on top of termbox-go and written purely in Go.
How do I add it to a project?Just import it with Go modules (no manual go get needed, Go handles dependencies), remembering to include /v3 in the import path; alternatively use Dep with 'dep ensure -add github.com/gizak/termui' (without /v3).
Which Go version do I need?You need Go 1.15 or above, and should use the version-numbered branch for stable releases rather than master.
Is this project actively maintained?The maintainer has fluctuating availability, so updates don't follow a consistent schedule, and they're actively looking for co-maintainers.
Who would use this?Go developers building CLI monitoring tools, system dashboards, or any terminal app that needs live-updating charts and widgets.
Does it run on Windows as well as Linux/Mac?Yes, it's explicitly designed to be cross-platform.
What widgets come built in?BarChart, Canvas (for braille-dot drawing), Gauge, Image, List, Tree, Paragraph, PieChart, Plot, Sparkline, StackedBarChart, Table, and Tabs.
Can widgets be positioned freely or only in a grid?Both: you can place widgets in a relative grid layout or use absolute coordinates.
Does it support mouse and resize events, or just keyboard?It handles keyboard, mouse, and terminal resizing events, plus colors and styling.
Are there real projects using termui?Yes, examples include gotop, dockdash, expvarmon, go-ethereum's monitorcmd, go-jira-ui, termeter, and updo.
What are similar projects?k9s, sampler, ctop, wtf, bubbletea, tview, lipgloss, gh-dash
Creator
gizak
Size
6 MB
Stars
13.6K
Updated
CommitJul 10
Age
11y
Commits · 90 Days