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
这是什么?termui 是一个用于 Go 的跨平台终端仪表盘和控件库,可直接在终端中构建带有图表、仪表和表格的文本界面。
它是库还是独立应用?它是一个 Go 库,你可以将其导入自己的程序以渲染仪表盘;它基于 termbox-go 构建,且完全使用 Go 编写。
我该如何把它添加到项目中?直接通过 Go 模块导入即可(无需手动执行 go get,Go 会自动处理依赖),但要记得在导入路径中包含 /v3;也可以使用 Dep,运行 'dep ensure -add github.com/gizak/termui'(路径中不带 /v3)。
我需要哪个 Go 版本?需要 Go 1.15 或更高版本;如需稳定版本,应使用带版本号的分支,而不是 master 分支。
这个项目还在积极维护吗?维护者可投入的时间时多时少,因此更新没有固定的时间表;目前他们正在积极寻找共同维护者。
谁会用它?使用 Go 开发命令行监控工具、系统仪表盘,或任何需要实时更新图表和控件的终端应用的开发者。
它能在 Windows 上运行,也能在 Linux/Mac 上运行吗?可以,它明确设计为跨平台。
有哪些控件是内置的?内置控件包括 BarChart、Canvas(用于盲文点绘图)、Gauge、Image、List、Tree、Paragraph、PieChart、Plot、Sparkline、StackedBarChart、Table 和 Tabs。
控件可以自由定位,还是只能放在网格中?两种方式都支持:既可以将控件放置在相对网格布局中,也可以使用绝对坐标。
它支持鼠标和窗口大小调整事件,还是只支持键盘?它支持键盘、鼠标和终端窗口大小调整事件,同时也支持颜色和样式设置。
有没有实际使用 termui 的项目?有,例如 gotop、dockdash、expvarmon、go-ethereum 的 monitorcmd、go-jira-ui、termeter 和 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