charmbracelet/huh
Build terminal forms and prompts π€·π»ββοΈ
Healthy across the board
weakest axisPermissive license, no critical CVEs, actively maintained β safe to depend on.
Has a license, tests, and CI β clean foundation to fork and modify.
Documented and popular β useful reference codebase to read through.
No critical CVEs, sane security posture β runnable as-is.
- βLast commit 2w ago
- β14 active contributors
- βDistributed ownership (top contributor 39% of recent commits)
Show all 6 evidence items βShow less
- βMIT licensed
- βCI configured
- β No test directory detected
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Healthy" badge
Paste into your README β live-updates from the latest cached analysis.
[](https://repopilot.app/r/charmbracelet/huh)Paste at the top of your README.md β renders inline like a shields.io badge.
βΈPreview social card (1200Γ630)
This card auto-renders when someone shares https://repopilot.app/r/charmbracelet/huh on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: charmbracelet/huh
Generated by RepoPilot Β· 2026-05-09 Β· Source
π€Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale β STOP and ask the user to regenerate it before proceeding. - Treat the AI Β· unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/charmbracelet/huh shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything β but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
π―Verdict
GO β Healthy across the board
- Last commit 2w ago
- 14 active contributors
- Distributed ownership (top contributor 39% of recent commits)
- MIT licensed
- CI configured
- β No test directory detected
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
β Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live charmbracelet/huh
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale β regenerate it at
repopilot.app/r/charmbracelet/huh.
What it runs against: a local clone of charmbracelet/huh β the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in charmbracelet/huh | Confirms the artifact applies here, not a fork |
| 2 | License is still MIT | Catches relicense before you depend on it |
| 3 | Default branch main exists | Catches branch renames |
| 4 | Last commit β€ 45 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of charmbracelet/huh. If you don't
# have one yet, run these first:
#
# git clone https://github.com/charmbracelet/huh.git
# cd huh
#
# Then paste this script. Every check is read-only β no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of charmbracelet/huh and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "charmbracelet/huh(\\.git)?\\b" \\
&& ok "origin remote is charmbracelet/huh" \\
|| miss "origin remote is not charmbracelet/huh (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(MIT)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"MIT\"" package.json 2>/dev/null) \\
&& ok "license is MIT" \\
|| miss "license drift β was MIT at generation time"
# 3. Default branch
git rev-parse --verify main >/dev/null 2>&1 \\
&& ok "default branch main exists" \\
|| miss "default branch main no longer exists"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 45 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~15d)"
else
miss "last commit was $days_since_last days ago β artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) β safe to trust"
else
echo "artifact has $fail stale claim(s) β regenerate at https://repopilot.app/r/charmbracelet/huh"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
β‘TL;DR
Huh is a Go library for building interactive terminal forms, prompts, and multi-step wizards with a clean fluent API. It provides composable field types (Select, MultiSelect, Input, Text, File picker, etc.) organized into groups, handles both standalone and Bubble Tea integration modes, and includes first-class accessibility support for screen readers. Single-package design: the core library lives at the root (accessor.go, eval.go, form types) with no src/ or internal/ subdirectories visible. Examples are organized by feature (examples/burger, examples/conditional, examples/dynamic, examples/filepicker-picking) showing different use patterns and integration modes. Makefile suggests Go-native build process.
π₯Who it's for
Go developers building CLI tools, system administration utilities, and interactive terminal applications who need production-grade form handling without building from scratch. Specifically targets both accessibility-conscious developers and teams integrating with existing Bubble Tea applications.
π±Maturity & risk
Production-ready and actively maintained. The project is on v2 (with UPGRADE_GUIDE_V2.md indicating a major API evolution), has comprehensive CI/CD via GitHub Actions (build.yml, lint.yml, release.yml, dependabot sync), and demonstrates maturity through a dedicated release workflow and linter configuration (.golangci.yml). No clear sign of abandonment.
Low risk for active use. Single primary maintainer (charmbracelet org suggests backing, but codebase structure implies focused ownership), but mitigation includes robust CI/CD and dependency management via dependabot. No major red flags visible; the v2 transition suggests evolution rather than stagnation. Dependency chain is moderate (bubbletea, bubbles, lipgloss all Charm ecosystem).
Active areas of work
Active development indicated by v2 structure and UPGRADE_GUIDE_V2.md. Workflows show continuous linting, building, and dependabot-driven dependency updates. Multiple example categories (accessibility, bubbletea integration, dynamic forms, conditional logic) suggest recent feature additions and polish toward 2.0 stability.
πGet running
Clone and build: git clone https://github.com/charmbracelet/huh && cd huh. No package.json visible; this is pure Go. Inspect Makefile with cat Makefile for build targets. Run an example: go run examples/burger/main.go. Use go get charm.land/huh/v2 to add to your own project.
Daily commands:
Run the burger example: go run ./examples/burger/main.go. Run tests with go test ./... (inferred from .golangci.yml linting setup). Makefile likely contains test/lint targets; check make help or cat Makefile for available commands.
πΊοΈMap of the codebase
- accessor.go: Handles value binding between form fields and Go variables; critical for understanding how answers are captured and stored.
- eval.go: Implements conditional field visibility and dynamic form logic; essential for understanding groups with Show/Hide behavior.
- examples/burger/main.go: Canonical example showing a complete multi-group form with Select, MultiSelect, Input, and Text fields; best starting point for understanding the API.
- examples/accessibility/main.go: Demonstrates screen-reader friendly form construction; required reading if building accessible CLIs.
- examples/dynamic/dynamic-all/main.go: Shows advanced form composition with dynamic field visibility and conditional groups.
- UPGRADE_GUIDE_V2.md: Documents breaking changes from v1 to v2; mandatory reading if maintaining code that may migrate versions.
- .github/workflows/build.yml: Reveals test coverage expectations, supported Go versions, and CI matrix for platform support.
π οΈHow to make changes
Core field types are defined at root level (look for select.go, input.go, text.go patterns alongside accessor.go and eval.go). Add a new field type by creating a new file and implementing the Field interface. Accessibility features are likely in dedicated methods across field implementations. Examples in examples/accessibility and examples/accessibility-secure-input show accessible pattern usageβextend from these. The eval.go suggests conditional logic is centralized; modify there for form dependencies.
πͺ€Traps & gotchas
No required environment variables or external services detected. Go 1.25.9 is the target version (from examples/go.mod); older versions may have compatibility issues. The library uses generics heavily (note [string], [int] in examples), requiring Go 1.18+. Bubble Tea integration is opt-in but requires understanding event loops if combining with existing Bubble Tea appsβsee examples/bubbletea-options. The v2 migration is significant; mixing v1 and v2 APIs will fail.
π‘Concepts to learn
- Bubble Tea Model Pattern β Huh can be embedded in Bubble Tea apps via the Model interface; understanding the Init/Update/View lifecycle is essential for advanced integration and state management.
- Field Binding & Reflection β accessor.go uses Go pointers and reflection to bind form answers back to user variables; understanding this pattern is critical for adding custom fields or debugging value capture.
- Conditional/Dynamic Rendering β eval.go implements conditional field visibility based on prior answers; this is core to multi-step forms and branching logic.
- ARIA Accessibility Tree β Huh's accessibility mode outputs semantic terminal sequences for screen readers; examples/accessibility demonstrates ARIA role and label support for inclusive CLI tools.
- Go Generics β Fields use
[T]generic parameters (e.g.,Select[string],Select[int]) to support type-safe multi-type option handling without reflection overhead. - Fluent/Builder API Pattern β The entire library is built on method chaining (e.g.,
.Title().Options().Value()); understanding this ergonomic pattern is key to both using and extending Huh.
πRelated repos
charmbracelet/bubbleteaβ Core event-driven TUI framework that Huh builds on top of; required for understanding the event loop and Model interface integration.charmbracelet/bubblesβ Reusable Bubble Tea components (inputs, lists, spinners) that complement Huh's field types; used extensively as dependencies.charmbracelet/lipglossβ Styling and layout library used by Huh for terminal UI rendering; required for customizing form appearance.manifoldco/promptuiβ Alternative Go CLI prompting library focused on simplicity; useful comparison for understanding Huh's design choices around composability and accessibility.AlecAivazis/surveyβ Mature Go survey library with similar multi-choice/text field capabilities; reference for feature parity and architectural decisions.
πͺPR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive tests for accessor.go and eval.go
The repo has extensive examples and workflows but accessor.go and eval.go (core form evaluation logic) lack visible test coverage. These files handle critical form state management and field evaluationβadding unit tests would improve reliability and serve as reference documentation for contributors. This is especially important for a forms library where correctness is paramount.
- [ ] Create accessor_test.go with tests for field accessor patterns and state retrieval
- [ ] Create eval_test.go with tests for conditional field evaluation and dynamic form behavior
- [ ] Test edge cases like nested fields, nil values, and invalid accessor paths
- [ ] Ensure tests cover the dynamic examples (examples/dynamic/*) scenarios
Add GitHub Actions workflow to test all examples run without errors
The repo has 20+ examples (burger, filepicker, dynamic-*, accessibility, etc.) but no CI workflow validates they compile and run. Given the library's focus on interactive forms, a regression workflow that builds all examples would catch breaking changes early and ensure example code stays synchronized with API changes.
- [ ] Create .github/workflows/examples.yml that runs 'go build' for each example directory
- [ ] Add step to validate examples/go.mod stays in sync with main module changes
- [ ] Include linting check for example code consistency (using .golangci.yml)
- [ ] Reference specific example directories: examples/burger, examples/filepicker, examples/dynamic/, examples/accessibility
Create CONTRIBUTING.md with contributor guidelines and example architecture guide
The repo has UPGRADE_GUIDE_V2.md but no CONTRIBUTING.md. New contributors would benefit from docs explaining: (1) how to run examples during development, (2) the relationship between form field types and their accessibility wrappers, (3) testing approach for interactive components. This reduces friction for first-time contributions and ensures consistency.
- [ ] Document setup instructions (go version 1.25.9+, dependencies from examples/go.mod)
- [ ] Explain the form field architecture (reference accessor.go, eval.go, and field-specific files)
- [ ] Add section on testing accessibility features (reference examples/accessibility/main.go and UPGRADE_GUIDE_V2.md)
- [ ] Include example workflow: running examples/burger, modifying code, re-running to test changes
- [ ] Link to existing Bubble Tea and Lipgloss contribution guides for consistency
πΏGood first issues
- Add unit tests for accessor.go field binding logic; currently no visible test files at root level, but core value-binding is critical functionality that should have regression coverage.
- Expand examples/filepicker-picking with validation error handling and custom directory filters; the filepicker feature appears in the file list but lacks a full-featured example showing common UX patterns.
- Create a template/boilerplate example (e.g., examples/template-survey) showing best practices for multi-page survey collection, error recovery, and result serializationβuseful for onboarding new users.
βTop contributors
Click to expand
Top contributors
- @caarlos0 β 39 commits
- @dependabot[bot] β 26 commits
- @aymanbagabas β 19 commits
- @meowgorithm β 3 commits
- @charmcli β 3 commits
πRecent commits
Click to expand
Recent commits
38bb59fβ chore: remove CODEOWNERS (andreynering)14e5ad9β chore(deps): bump the all group with 3 updates (#772) (dependabot[bot])fde67e7β chore(deps): bump the all group in /examples with 3 updates (#771) (dependabot[bot])e3315ebβ chore(deps): bump charm.land/bubbles/v2 in the all group (#759) (dependabot[bot])76e0d6aβ chore(deps): bump charm.land/bubbles/v2 in /examples in the all group (#758) (dependabot[bot])3b90d9dβ docs(readme): update reference link (#753) (nerg4l)b2972a4β chore(deps): bump charm.land/lipgloss/v2 in the all group (#752) (dependabot[bot])3594cbaβ chore(deps): bump the all group in /examples with 4 updates (#751) (dependabot[bot])15f6205β fix: lint issues (aymanbagabas)8b8c42dβ fix(ci): use meta lint workflow (aymanbagabas)
πSecurity observations
The huh project appears to be a well-maintained terminal UI library with generally good security posture. The primary concerns are related to dependency management (version specification issues), build configuration clarity, and documentation gaps. No critical vulnerabilities were identified in the provided file structure. The main security recommendations involve: (1) correcting the Go version specification, (2) implementing a security policy for responsible disclosure, (3) ensuring dependency pinning in production, and (4) reviewing CI/CD pipelines. The codebase itself (terminal UI forms) has low inherent risk for injection attacks due to its domain, but users integrating with authentication systems should follow secure coding practices as documented in examples.
- Medium Β· Outdated Go Version in go.mod β
examples/go.mod. The examples/go.mod file specifies 'go 1.25.9', which appears to be a future or invalid version. Go 1.25.x does not exist in the current release timeline (as of early 2025). This could indicate version skew or misconfiguration that may lead to unexpected behavior or security patches not being applied. Fix: Update to a stable and currently supported Go version (e.g., go 1.23 or later, depending on project requirements). Verify compatibility with all dependencies. - Medium Β· Incomplete Dependency Pin β
examples/go.mod. The go.mod file contains a replace directive for 'charm.land/huh/v2' pointing to '../' (local path), which is appropriate for development but requires careful management in CI/CD. Additionally, some dependencies like 'github.com/rivo/uniseg v0' appear truncated, suggesting potential dependency resolution issues. Fix: Ensure all dependency versions are fully specified in production builds. Use 'go mod tidy' to clean up and verify dependency integrity. Consider using a monorepo tool or separate build processes for examples vs. main library. - Low Β· Potential Information Disclosure via Example Files β
examples/gh/, examples/git/. The examples directory contains real-world example implementations (e.g., 'examples/gh/create.go', 'examples/git/main.go') that could serve as templates for attackers. While examples are intended to be public, detailed examples showing form interactions with sensitive contexts (SSH, git credentials) could inadvertently reveal security patterns. Fix: Ensure example code clearly documents security best practices. Add warnings in examples that handle credentials or sensitive data. Consider adding security notes to the README for users integrating with authentication systems. - Low Β· Missing Security Policy β
Repository root. No visible SECURITY.md or security policy file in the repository root. This makes it unclear how security vulnerabilities should be reported, potentially leading to public disclosure of issues. Fix: Create a SECURITY.md file following the GitHub security advisory guidelines. Include instructions for responsible disclosure and a timeline for security fixes. - Low Β· Build Workflow Transparency β
.github/workflows/build.yml, .github/workflows/release.yml. The .github/workflows/build.yml and release.yml files are present but content not provided for review. Build pipelines can be vectors for supply chain attacks if not properly secured. Fix: Review GitHub Actions workflows to ensure: (1) pinned versions for actions, (2) proper access controls and secrets management, (3) no hardcoded credentials, (4) signed commits/releases enabled.
LLM-derived; treat as a starting point, not a security audit.
πWhere to read next
- Open issues β current backlog
- Recent PRs β what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals β see the live page for receipts. Re-run on a new commit to refresh.