Documentation
¶
Overview ¶
Package interactive provides auto-prompting for missing required flags using huh forms when running in a TTY.
Index ¶
- func IsInteractive(cmd *cobra.Command) bool
- func PromptAndSetFlags(cmd *cobra.Command, meta []flagutil.FlagMeta) error
- func PromptForBodyJSON(cmd *cobra.Command, flagName, description string) error
- func ShouldPrompt(cmd *cobra.Command, meta []flagutil.FlagMeta) bool
- func ShouldPromptForBody(cmd *cobra.Command, flagName string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsInteractive ¶
IsInteractive returns true when the CLI should use interactive features. Requires both stdin and stdout to be a TTY, --no-interactive must not be set, and agent mode must not be active. Agent mode (auto-detected from AI coding agent env vars or --agent-mode flag) implies non-interactive operation even when running in a real terminal.
func PromptAndSetFlags ¶
PromptAndSetFlags builds a huh form for unresolved required flags (one per form), then offers to prompt for optional flags too. Each field is shown in its own separate form to avoid multi-group rendering issues.
func PromptForBodyJSON ¶
PromptForBodyJSON prompts for a JSON body when the operation uses a single body flag (non-metadata-driven). Used for complex request bodies that aren't expanded into individual flags.
func ShouldPrompt ¶
ShouldPrompt returns true when the command should auto-prompt for missing required flags. This is true when IsInteractive is true and at least one required flag has no value from any resolution source (flag, env, config).
Types ¶
This section is empty.