PromptsMay 17, 2026·2 min read

Huh — Build Terminal Forms and Prompts in Go

A Go library for building interactive terminal forms with inputs, selects, confirms, and file pickers, powered by the Bubble Tea TUI framework.

Agent ready

Ready-to-run agent install

This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.

Native · 96/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Prompt
Install
Single
Trust
Trust: Established
Entrypoint
Huh Overview
Direct install command
npx -y tokrepo@latest install c11aa6f6-51a7-11f1-9bc6-00163e2b0d79 --target codex

Run after dry-run confirms the install plan.

Introduction

Huh is a Go library by Charm for building rich interactive forms in the terminal. It provides pre-built components like text inputs, selects, multi-selects, confirms, and file pickers that render beautifully using the Bubble Tea framework underneath.

What Huh Does

  • Renders multi-step terminal forms with keyboard navigation
  • Provides input, select, multi-select, confirm, and text area fields
  • Supports theming via Lip Gloss styles for consistent branding
  • Validates user input with custom or built-in validators
  • Works in accessible mode for screen readers and simple terminals

Architecture Overview

Huh builds on Charm's Bubble Tea TUI framework. Each form field is a Bubble Tea model with its own Update/View cycle. A Form groups fields into ordered steps, managing focus transitions and collecting results into bound Go variables via pointer references.

Self-Hosting & Configuration

  • Add to your module: go get github.com/charmbracelet/huh
  • No external runtime or daemon required
  • Customize appearance with huh.NewTheme() and Lip Gloss styles
  • Set accessible mode with huh.NewForm().WithAccessible(true) for CI environments
  • Compose fields into groups and groups into multi-page forms

Key Features

  • Declarative API: define forms with a builder pattern in a few lines
  • Keyboard-driven UX with Vim-style and arrow key navigation
  • Built-in spinner component for async operations during form flow
  • Supports piped input and non-interactive environments gracefully
  • Lightweight with no CGo dependencies

Comparison with Similar Tools

  • Bubble Tea — lower-level TUI framework; Huh is a form abstraction on top of it
  • Survey (Go) — similar form library but less visually polished
  • promptui — simpler prompts, fewer field types, less active maintenance
  • Inquirer.js — Node.js equivalent; Huh brings the same UX to Go
  • tview — full TUI widget toolkit; heavier than what forms need

FAQ

Q: Can Huh forms run in CI without a TTY? A: Yes. Enable accessible mode or pipe values via stdin for non-interactive runs.

Q: Does Huh support custom validation? A: Yes. Each field accepts a Validate(func(string) error) callback.

Q: Can I theme the form to match my CLI brand? A: Yes. Huh exposes a full theming API using Lip Gloss styles for colors, borders, and spacing.

Q: Is Huh compatible with Windows terminals? A: Yes. It works on Windows Terminal, PowerShell, and cmd via Bubble Tea's cross-platform rendering.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets