whatisgithub

What is huh?

charmbracelet/huh — explained in plain English

Analysis updated 2026-06-24

6,876GoAudience · developerComplexity · 2/5Setup · easy

In one sentence

A Go library for building keyboard-navigated interactive forms in the terminal, add text inputs, dropdowns, multi-select lists, and yes/no prompts to any CLI tool in a few lines of code.

Mindmap

mindmap
  root((repo))
    Field types
      Text input
      Text area
      Dropdown select
      Multi-select
      Yes/No confirm
    Form structure
      Groups as pages
      Field chaining
      Answer binding
    Validation
      Per-field rules
      Error display
    Accessibility
      Screen reader mode
      Sequential prompts
    Styling
      Built-in themes
      Custom themes
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

What do people build with it?

USE CASE 1

Add interactive prompts to a Go CLI tool for collecting user input without writing any display logic.

USE CASE 2

Build multi-step terminal forms where each group of fields appears as a separate page the user tabs through.

USE CASE 3

Embed a form as a component inside a Bubble Tea terminal UI application.

What is it built with?

GoBubble Tea

How does it compare?

charmbracelet/huhxiaobaitech/golangfamilyfluxcd/flux
Stars6,8766,8816,865
LanguageGoGoGo
Setup difficultyeasyeasyhard
Complexity2/51/54/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

So what is it?

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.

Copy-paste prompts

Prompt 1
Build a Go CLI tool using huh that prompts for a project name, language, and license with input validation.
Prompt 2
How do I attach a validation rule to a huh text input that rejects empty strings and shows an error message?
Prompt 3
Create a multi-step terminal form with huh where step one collects personal info and step two collects project settings.
Prompt 4
Embed a huh form as a sub-component inside a Bubble Tea application and handle the result when submitted.

Frequently asked questions

What is huh?

A Go library for building keyboard-navigated interactive forms in the terminal, add text inputs, dropdowns, multi-select lists, and yes/no prompts to any CLI tool in a few lines of code.

What language is huh written in?

Mainly Go. The stack also includes Go, Bubble Tea.

How hard is huh to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is huh for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.