Add experimental huh-only prompter gated by GH_EXPERIMENTAL_PROMPTER#12859
Draft
Add experimental huh-only prompter gated by GH_EXPERIMENTAL_PROMPTER#12859
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a new
Prompterimplementation (huhPrompter) that uses thecharmbracelet/huhlibrary in its standard interactive TUI mode, gated behind theGH_EXPERIMENTAL_PROMPTERenvironment variable.Differences from existing prompters
surveyPrompter(default)accessiblePrompterhuhPrompter(new)EchoModeNoneEchoModePassword(*)OptionsFuncKey design decisions
GH_ACCESSIBLE_PROMPTERGH_EXPERIMENTAL_PROMPTERtakes precedence overGH_ACCESSIBLE_PROMPTERinprompter.New()InputandMultiSelectfield.OptionsFuncdynamically updates the option list when the search query changes. Initial results are pre-loaded viaOptions().Files changed
internal/prompter/huh_prompter.go— NewhuhPrompterimplementationinternal/prompter/prompter.go— Factory updatepkg/iostreams/iostreams.go—experimentalPrompterEnabledflagpkg/cmd/factory/default.go— Env var checkAcceptance test results
All 9 prompt types tested and passing with
GH_EXPERIMENTAL_PROMPTER=true:https://gist.github.com/BagToad/c606e2bb8380e4ff7caec1a33f4dca31