gitmyhub

tview

Go ★ 14k updated 3mo ago

Terminal UI library with rich, interactive widgets — written in Golang

tview is a Go library for building interactive text-based user interfaces that run inside a terminal, with ready-made components like forms, tables, tree views, and layouts, all keyboard-navigable.

Gotcellsetup: easycomplexity 2/5

tview is a Go library for building interactive user interfaces that run entirely inside a terminal window, without any graphical display. Instead of buttons, windows, and mouse clicks, it creates a text-based interface using characters and colors that work in any standard terminal on Linux, macOS, or Windows.

The library provides a set of ready-made interface components: text input fields, checkboxes, dropdowns, multi-line text views, editable text areas, tables with navigation, tree views, selectable lists, modal dialogs, and layout containers that arrange things in grids or flexible columns. Each component can be customized and combined to build complete applications that users interact with using just a keyboard.

Adding tview to a Go project takes a single command, and a basic working application is only a few lines of code. The library handles the event loop, keyboard input, and rendering automatically, so you write logic rather than boilerplate. A wiki on GitHub contains more examples with screenshots, and a demo program included in the repository showcases the available components.

The project has been used as the foundation for a large number of real tools, including the popular K9s Kubernetes cluster manager, the official GitHub CLI, database browsers for Redis and MySQL, Kubernetes dashboard tools, file managers, music players, and many others. This breadth of real-world usage shows that the library handles production-grade requirements.

tview is written entirely in Go and is available under a standard open-source license. It builds on a lower-level terminal library called tcell. Documentation is published on pkg.go.dev, Go's standard package documentation site.

Where it fits