Skip to content

Add experimental huh-only prompter gated by GH_EXPERIMENTAL_PROMPTER#12859

Draft
BagToad wants to merge 4 commits intotrunkfrom
kw/experimental-huh-prompter
Draft

Add experimental huh-only prompter gated by GH_EXPERIMENTAL_PROMPTER#12859
BagToad wants to merge 4 commits intotrunkfrom
kw/experimental-huh-prompter

Conversation

@BagToad
Copy link
Member

@BagToad BagToad commented Mar 7, 2026

Summary

Introduces a new Prompter implementation (huhPrompter) that uses the charmbracelet/huh library in its standard interactive TUI mode, gated behind the GH_EXPERIMENTAL_PROMPTER environment variable.

Differences from existing prompters

surveyPrompter (default) accessiblePrompter huhPrompter (new)
Library go-survey huh + accessible mode huh (interactive TUI)
Rendering Survey TUI Plain sequential I/O Bubble Tea TUI
Password masking Survey masked EchoModeNone EchoModePassword (*)
MultiSelectWithSearch Shared loop Shared loop Single-group form with OptionsFunc

Key design decisions

  • Env var gating: Follows the same truthy/falsey pattern as GH_ACCESSIBLE_PROMPTER
  • Priority: GH_EXPERIMENTAL_PROMPTER takes precedence over GH_ACCESSIBLE_PROMPTER in prompter.New()
  • MultiSelectWithSearch: Uses a single huh group with both an Input and MultiSelect field. OptionsFunc dynamically updates the option list when the search query changes. Initial results are pre-loaded via Options().

Files changed

  • internal/prompter/huh_prompter.go — New huhPrompter implementation
  • internal/prompter/prompter.go — Factory update
  • pkg/iostreams/iostreams.goexperimentalPrompterEnabled flag
  • pkg/cmd/factory/default.go — Env var check

Acceptance test results

All 9 prompt types tested and passing with GH_EXPERIMENTAL_PROMPTER=true:
https://gist.github.com/BagToad/c606e2bb8380e4ff7caec1a33f4dca31

BagToad and others added 4 commits March 6, 2026 20:47
Introduce a new Prompter implementation (huhPrompter) that uses the
charmbracelet/huh library in its standard interactive mode, as an
alternative to the survey-based default prompter. The new implementation
is gated behind the GH_EXPERIMENTAL_PROMPTER environment variable,
following the same truthy/falsey pattern as GH_ACCESSIBLE_PROMPTER.

Key differences from the accessible prompter:
- No WithAccessible(true) flag (full interactive TUI)
- Uses EchoModePassword (masked with *) instead of EchoModeNone
- No default value annotations appended to prompt text

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implement a huh-native MultiSelectWithSearch that renders the search
input and multi-select list simultaneously using LayoutStack. The
search input is in Group 0 and the multi-select in Group 1, with
OptionsFunc bound to the search query so results update when the
user presses Enter to advance focus. Users can Shift+Tab back to
refine their search, and selections persist across queries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant