explaingit

rivo/tview

13,849GoAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

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.

Mindmap

mindmap
  root((tview))
    Components
      Text inputs
      Tables
      Tree views
      Modal dialogs
    Layout
      Grid containers
      Flexible columns
      Nested panels
    Built on tcell
      Any terminal
      Linux macOS Windows
    Real-world uses
      K9s Kubernetes
      GitHub CLI
      Database browsers
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

Things people build with this

USE CASE 1

Build a terminal-based dashboard or admin panel for your Go application with tables, menus, and input forms.

USE CASE 2

Create an interactive CLI tool with keyboard-navigable lists, dropdowns, and modal dialogs.

USE CASE 3

Add a text-based file manager or database browser to a Go project without needing a graphical interface.

USE CASE 4

Build a TUI frontend for a developer tool, similar to how K9s manages Kubernetes clusters from the terminal.

Tech stack

Gotcell

Getting it running

Difficulty · easy Time to first run · 30min
Available under a standard open-source license, use freely in your own projects.

In plain English

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.

Copy-paste prompts

Prompt 1
Using tview in Go, build me a terminal UI with a table that loads rows from a JSON file and lets the user navigate with arrow keys and select a row.
Prompt 2
Show me how to create a tview form with text inputs, a dropdown, and a submit button that validates required fields before accepting.
Prompt 3
Build a tview app with a sidebar menu on the left and a main content panel on the right, switching displayed content when the user highlights a menu item.
Prompt 4
How do I handle keyboard shortcuts in tview while also updating the UI from a background goroutine without causing race conditions?
Open on GitHub → Explain another repo

← rivo on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.