explaingit

nsf/termbox-go

4,778GoAudience · developerComplexity · 2/5Setup · easy

TLDR

A lightweight Go library for building interactive text-based interfaces in the terminal, letting you place text and colors at specific positions and respond to keyboard input with a minimal, cross-platform API.

Mindmap

mindmap
  root((termbox-go))
    What it does
      Terminal UI rendering
      Keyboard input handling
      Cross-platform TUI
    Tech Stack
      Go
    Use Cases
      Text editors
      Terminal games
      CLI dashboards
    Audience
      Go developers
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 an interactive command-line tool in Go with a custom layout, such as a text editor, dashboard, or menu system.

USE CASE 2

Create a terminal-based game like Tetris or Snake that redraws the screen in response to keyboard input.

USE CASE 3

Display a live-updating terminal dashboard that positions text and numbers in specific screen locations.

USE CASE 4

Build a hex editor or file browser that runs entirely in the terminal without any graphical UI.

Tech stack

Go

Getting it running

Difficulty · easy Time to first run · 30min

The library is no longer actively maintained, consider a maintained alternative if starting a new project.

In plain English

Termbox-go is a Go library for building text-based user interfaces that run in a terminal window. Rather than rendering graphical buttons and windows, it works with the character grid of a terminal, letting you place text, colors, and simple shapes in specific positions on screen and respond to keyboard input. The goal is a minimal, consistent abstraction that works the same way across Linux, macOS, and Windows. The library was designed around a simple idea: find the smallest set of features that all major terminals support, and expose only those. This makes the API small and relatively easy to learn. Developers have used it to build tools like text editors, terminal dashboards, games like Tetris and Snake, a hex editor, a stock market tracker, a Docker container manager, and various interactive command-line utilities. The author notes in the README that the library is no longer actively maintained and suggests that people looking for a well-maintained alternative for terminal interfaces consider a different library in the same space. That said, the library still functions, and the author continues to use it personally in a text editor project called godit. Installation follows the standard Go package pattern: one command fetches and installs the library. The repository includes a collection of demo programs in a folder called _demos that show how to handle keyboard events, draw to the screen, and build simple interactive apps. These can be run directly with the standard Go toolchain to see what the library does. This is a developer tool with no graphical interface of its own. Its audience is Go programmers who want to build command-line applications with interactive layouts, and who want a lightweight, dependency-free starting point.

Copy-paste prompts

Prompt 1
Using nsf/termbox-go, write a Go program that draws a bordered box in the terminal and moves a cursor around inside it using arrow keys.
Prompt 2
Show me how to handle keyboard events with termbox-go and exit cleanly when the user presses Q or Escape.
Prompt 3
Using termbox-go, build a simple terminal dashboard that displays three labeled sections side by side and updates one of them every second.
Prompt 4
How do I draw colored text at specific row and column positions using termbox-go in a Go program?
Open on GitHub → Explain another repo

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

Verify against the repo before relying on details.