# charmbracelet/huh

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/charmbracelet-huh).**

6,575 stars · 220 forks · Go · mit

## Links

- GitHub: https://github.com/charmbracelet/huh
- awesome-repositories: https://awesome-repositories.com/repository/charmbracelet-huh.md

## Description

Huh is a Go library for building interactive terminal forms, designed to work with the Bubbletea TUI framework. It provides a complete form-building system with text inputs, selection lists, confirmation prompts, and file pickers, all navigable using only the keyboard without requiring a mouse.

The library distinguishes itself through dynamic form adaptation, allowing fields to be shown, hidden, or modified at runtime based on user selections and conditional rules. It includes screen reader support that announces form fields and falls back to text prompts when a visual interface is unavailable, making terminal forms accessible to visually impaired users. Huh also supports multi-step form workflows, timed auto-submission with countdown timers, and secure input collection that masks typed characters.

Additional capabilities include file path browsing through an interactive directory navigation interface, scrollable lists for compact viewports, custom validation functions with error messages, and animated spinner widgets for indicating background work. The library integrates forms as composable models within terminal applications, with a centralized theme system that applies consistent colors, borders, and typography across all form elements.

## Tags

### User Interface & Experience

- [Terminal](https://awesome-repositories.com/f/user-interface-experience/form-builders/terminal.md) — Builds interactive multi-step forms in the terminal with text inputs, selects, confirmations, and file pickers.
- [Go TUI Libraries](https://awesome-repositories.com/f/user-interface-experience/go-tui-libraries.md) — Builds interactive terminal forms with text inputs, selects, confirmations, and file pickers using Go and Bubbletea.
- [Terminal Form Frameworks](https://awesome-repositories.com/f/user-interface-experience/terminal-form-frameworks.md) — Forms are embedded as a Bubbletea model within a Tea program, inheriting its message-passing architecture and terminal rendering lifecycle.
- [CLI Confirmation Prompts](https://awesome-repositories.com/f/user-interface-experience/cli-confirmation-prompts.md) — Display a yes/no prompt and return the user's binary choice before proceeding. ([source](https://github.com/charmbracelet/huh/tree/main/examples/bubbletea-options))
- [Multi-Step Orchestrators](https://awesome-repositories.com/f/user-interface-experience/data-tables/data-entry-forms/complex-form-layouts/multi-step-orchestrators.md) — Orchestrates a sequence of input groups as pages, guiding a user through structured data entry. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/huh@main/README.md))
- [Dynamic Input Forms](https://awesome-repositories.com/f/user-interface-experience/dynamic-input-forms.md) — Creates forms that show, hide, or modify fields at runtime based on user input and conditional rules.
- [Reflection-Based Model Bindings](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/form-handling/dynamic-input-bindings/reflection-based-model-bindings.md) — Each form field is bound to a Go model struct, with values automatically read and written through reflection-based mapping.
- [Dynamic Field Populators](https://awesome-repositories.com/f/user-interface-experience/form-field-extensions/dynamic-field-populators.md) — Recomputes field titles and choices based on the current value of another field in the form. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/huh@main/README.md))
- [Conditional Field Adapters](https://awesome-repositories.com/f/user-interface-experience/form-field-extensions/dynamic-field-populators/conditional-field-adapters.md) — Update field titles and options based on previous selections as the user progresses. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/huh@main/README.md))
- [Short-form Text Inputs](https://awesome-repositories.com/f/user-interface-experience/form-field-extensions/short-form-text-inputs.md) — Prompts the user to enter a line of free-form text and returns the submitted value. ([source](https://github.com/charmbracelet/huh/tree/main/examples/gh))
- [Keyboard Navigation](https://awesome-repositories.com/f/user-interface-experience/keyboard-navigation.md) — Navigates and completes terminal forms using only keyboard controls without requiring a mouse.
- [Select Inputs](https://awesome-repositories.com/f/user-interface-experience/multi-select-inputs/select-inputs.md) — Chooses one or more options from a presented list of choices. ([source](https://github.com/charmbracelet/huh/tree/main/examples/bubbletea-options))
- [Single-Select Inputs](https://awesome-repositories.com/f/user-interface-experience/multi-select-inputs/single-select-inputs.md) — Presents a list of choices and records the one the user picks, supporting any value type. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/huh@main/README.md))
- [Selection Lists](https://awesome-repositories.com/f/user-interface-experience/selection-lists.md) — Presents a list of choices and stores the selected value. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/huh@main/README.md))
- [Accessible Terminal Inputs](https://awesome-repositories.com/f/user-interface-experience/terminal-accessibility-tools/accessible-terminal-inputs.md) — Collecting user input in terminal environments with screen reader support and secure text masking.
- [Text Input Widgets](https://awesome-repositories.com/f/user-interface-experience/text-input-widgets.md) — Accepts free-form text from the user, validating and returning the entered value. ([source](https://github.com/charmbracelet/huh/tree/main/examples/bubbletea-options))
- [Form Field Announcements](https://awesome-repositories.com/f/user-interface-experience/accessible-interface-design/screen-reader-optimizations/form-field-announcements.md) — Announce form fields and their labels to screen readers, switching to text prompts when a visual interface is not accessible. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/huh@main/README.md))
- [Terminal Fallback Bridges](https://awesome-repositories.com/f/user-interface-experience/accessible-interface-design/screen-reader-optimizations/terminal-fallback-bridges.md) — Detects non-TUI environments and switches to a text-prompt mode that reads fields aloud via standard output, maintaining accessibility.
- [Text Prompt Fallbacks](https://awesome-repositories.com/f/user-interface-experience/accessible-interface-design/screen-reader-optimizations/text-prompt-fallbacks.md) — Renders form fields as standard text prompts so assistive technology can navigate them without a visual interface. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/huh@main/README.md))
- [Multi-line Text Inputs](https://awesome-repositories.com/f/user-interface-experience/data-display-components/list-components/multi-line-item-renderers/multi-line-text-inputs.md) — Provides multi-line text input fields with configurable character limits for terminal forms. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/huh@main/README.md))
- [Terminal Directory Browsers](https://awesome-repositories.com/f/user-interface-experience/file-selection-interfaces/terminal-directory-browsers.md) — Browsing and selecting file paths through an interactive directory navigation interface.
- [Terminal Input Validation](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/form-validation/input-validation-rules/selection-input-validators/terminal-input-validation.md) — Validates terminal form input against custom functions and displays error messages on rejection. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/huh@main/README.md))
- [Field Grouping Containers](https://awesome-repositories.com/f/user-interface-experience/forms/field-grouping-containers.md) — Steps through related fields organized into labeled groups one at a time. ([source](https://github.com/charmbracelet/huh/tree/main/examples/))
- [Scrollable Form Lists](https://awesome-repositories.com/f/user-interface-experience/scrollable-interfaces/scrollable-form-lists.md) — Scrolls through a long list of options or fields inside a compact terminal viewport. ([source](https://github.com/charmbracelet/huh/tree/main/examples/))
- [Multiple Selections](https://awesome-repositories.com/f/user-interface-experience/selectable-lists/multiple-selections.md) — Selects several items from a list with an optional limit on the number of selections. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/huh@main/README.md))
- [Terminal Accessibility Tools](https://awesome-repositories.com/f/user-interface-experience/terminal-accessibility-tools.md) — Renders forms with screen reader announcements and falls back to text prompts when visual UI is unavailable.

### Data & Databases

- [TUI Form Embeddings](https://awesome-repositories.com/f/data-databases/model-as-a-table-integrations/tui-form-embeddings.md) — Embeds forms as standard Bubbletea models within terminal applications for custom layout and state management. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/huh@main/README.md))

### Software Engineering & Architecture

- [Channel-Based Event Loops](https://awesome-repositories.com/f/software-engineering-architecture/eventemitter-based-event-loops/channel-based-event-loops.md) — Drives form progression and field updates through a central event loop that dispatches keyboard and timer events over Go channels.
- [Composable Field Widgets](https://awesome-repositories.com/f/software-engineering-architecture/object-oriented-models/widget-tree-hierarchies/composable-field-widgets.md) — Builds forms as a tree of composable field widgets, each implementing a shared interface for rendering, input handling, and validation.

### Web Development

- [Conditional Field Visibility](https://awesome-repositories.com/f/web-development/form-field-state-management/conditional-field-visibility.md) — Displays or hides input fields based on the value of another field, adapting the form to user choices. ([source](https://github.com/charmbracelet/huh/tree/main/examples/conditional))
- [Runtime Field Graph Resolutions](https://awesome-repositories.com/f/web-development/form-field-state-management/conditional-field-visibility/runtime-field-graph-resolutions.md) — Resolves field visibility and order at runtime by evaluating conditional rules against the current form state, enabling adaptive flows.
- [Conditional Field Skipping](https://awesome-repositories.com/f/web-development/form-field-state-management/conditional-field-visibility/conditional-field-skipping.md) — Jumps over a field when a rule is met, letting users bypass irrelevant questions. ([source](https://github.com/charmbracelet/huh/tree/main/examples/))

### Part of an Awesome List

- [Text Input Fields](https://awesome-repositories.com/f/awesome-lists/devtools/text-inputs/text-input-fields.md) — Ships single-line text input fields with optional validation and character limits. ([source](https://cdn.jsdelivr.net/gh/charmbracelet/huh@main/README.md))

### Development Tools & Productivity

- [Interactive File Pickers](https://awesome-repositories.com/f/development-tools-productivity/path-autocompletion-tools/file-path-autocompletion/interactive-file-pickers.md) — Navigates directories and selects a file path using an interactive file browser. ([source](https://github.com/charmbracelet/huh/tree/main/examples/filepicker))

### DevOps & Infrastructure

- [Timed Auto-Submissions](https://awesome-repositories.com/f/devops-infrastructure/workflow-run-management/run-annotations/timed-auto-submissions.md) — Running terminal forms with automatic submission after a configurable countdown timer expires. ([source](https://github.com/charmbracelet/huh/tree/main/examples/))

### Security & Cryptography

- [Secure Input Session Support](https://awesome-repositories.com/f/security-cryptography/secure-input-session-support.md) — Collects sensitive text input without echoing characters to the terminal, protecting against shoulder surfing. ([source](https://github.com/charmbracelet/huh/tree/main/examples/))
