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.
← charmbracelet on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.