explaingit

charmbracelet/huh

6,876Go
This is a quick first-pass explanation. The richer sections — use-cases, tech stack, setup, prompts — are still being generated.

TLDR

Huh is a Go library for building interactive forms and prompts that run inside a terminal window.

Mindmap

A visual breakdown will appear here once this repo is fully enriched.

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

In plain English

Huh is a Go library for building interactive forms and prompts that run inside a terminal window. Instead of a web page or a graphical dialog box, the interface appears as text that the user navigates with a keyboard. The library provides a small set of field types: a single-line text input, a multi-line text area, a dropdown list for picking one option, a multi-select list for picking several options, and a yes/no confirmation prompt. Forms are organized into groups, which act like pages. Fields within a group appear together, and the user moves between groups as they complete each one. Building a form means creating field objects in Go code, chaining options onto them (title, default value, character limit, validation rule), and then calling the form's Run method to display it and wait for the user to finish. Answers are stored directly into variables you supply. Validation can be attached to any field: the library highlights errors and shows messages without the developer having to write display logic. Huh also has an accessibility mode that replaces the visual terminal interface with plain sequential prompts, which works better with screen reader software. Themes control colors and styling, five built-in themes are included and custom themes are supported. The library is written to integrate with Bubble Tea, which is another terminal UI toolkit from the same team, so complex applications can embed forms as components. It can also be used on its own for simpler scripts. The README includes a complete walk-through tutorial and a full field reference with code examples.

Open on GitHub → Explain another repo

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

Verify against the repo before relying on details.