charmbracelet

huh: Build Interactive Terminal Forms and Prompts

huh is a Go library for building interactive terminal forms, prompts, and spinners. Use it for standalone command-line input or embed forms in Bubble Tea apps, with validation, dynamic fields, themes, and a screen-reader-friendly mode.

View on GitHub Compare
Stars
7.2k
Forks
269
Stars, last 30 days
+56
Last commit
2 months ago
Contributors
58

Our take

Activerecent releases

Health score

58/100

How it is scored
Activity
51
Community
71
Issues
46
Pull requests
64

+56 stars in the last 30 days

huh is an actively maintained, MIT-licensed Go forms library with recent releases and contributions from a broad group, though recent issue closures are limited.

Good fit if

  • You are building a Go CLI or Bubble Tea app and need reusable terminal form fields.
  • Your input flow needs validation, dynamic options, or multiple form groups.
  • You want an accessible prompt mode and the option to customize the form theme.

Look elsewhere if

  • You need a web form or a graphical interface rather than terminal interaction.
  • Your application is not written in Go and cannot use a Go library.
  • Your adoption decision requires evidence of rapid issue resolution, since few issues were closed in the measured recent period.
All health signals
Last commit2026-08-12 (2 months ago)
Commits, last 90 days9
Releases, last 12 months5 (latest v2.0.3, 2026-03-10)
Contributors58 (top contributor: 44% of commits)
Issues closed, last 90 days1
Pull requests merged, last 90 days9 (typically merged in 0 days)
Project age3 years

Checked on 2026-10-11 with the GitHub API.

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

7,264

Forks

282

Change since Nov 19, 2026: +3 stars·+2 forks

Overview

huh is a Go library for collecting structured input through terminal interfaces. It helps CLI developers build multi-field forms and single prompts without implementing the interaction and rendering themselves. Forms can validate answers and organize fields into groups.

It works on its own or as a Bubble Tea model, so it suits both small command-line utilities and larger terminal applications. An accessible mode uses standard prompts instead of a full TUI for better screen-reader interaction.

Key Features

  • Single-line and multiline text inputs, single- and multiple-choice selects, and yes-or-no confirmations.
  • Bind field values directly to Go variables, with generic option values such as strings or integers.
  • Validate field input and display errors in the form.
  • Recompute titles and choices when other answers change, supporting dynamic forms.
  • Integrate forms into Bubble Tea applications through its model interface.
  • Provide an accessible prompt mode intended for screen readers.
  • Customize appearance with built-in themes or a custom theme.
  • Include a standalone spinner package for indicating background work.

Use Cases

  • CLI authors can gather configuration or setup answers in a guided form rather than parsing many flags.
  • Developers of terminal apps built with Bubble Tea can add focused form-based input without replacing their application model.
  • Command-line tools can collect validated details, such as names or free-text instructions, before running an operation.
  • Tools with changing follow-up questions can present choices based on earlier answers, such as selecting a state after a country.
  • Maintainers can offer a screen-reader-oriented input path for terminal forms.

What you need

Detected in the repository

  • Go 1.25.8 or newer (from go.mod)
  • Automated checks on GitHub Actions

License in plain words

MITpermissive

  • Commercial use: yes
  • Modify and redistribute: yes
  • You must keep: the copyright and license notice
  • Share your changes: no

A summary, not legal advice: the LICENSE file is what applies.

Getting Started

Import the module in your Go code:

import "charm.land/huh/v2"

See the README for a complete form example and integration details.

Alternatives

  • gum: Gum provides ready-made interactive prompts for shell scripts, while huh is a Go library for building forms and prompts in applications.
ProjectLanguageLicenseStarsStatus
huhGoMIT7.2kActive
gumGoMIT24.5kActive

Considerations

The project is active, with recent commits and releases, and has contributions from dozens of people; activity is not the same as guaranteed support. Issue closures were sparse in the measured period, so teams relying on upstream responses should review the issue tracker and assess whether they can handle fixes themselves. The repository uses the MIT license, which permits broad use subject to its license terms.

Found this useful?

Share it with someone who would like huh.

Comparisons