interactive

package
v0.0.62 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm added in v0.0.28

func Confirm(question string, defaultYes bool) (bool, error)

Confirm is a convenience wrapper around PromptConfirm with default value support

func MultiSelect added in v0.0.28

func MultiSelect(question string, options []string, defaultSelected func(string) bool) ([]string, error)

MultiSelect is a convenience wrapper around PromptMultiSelect that returns selected values

func PromptConfirm

func PromptConfirm(question string) (bool, error)

PromptConfirm prompts the user for yes/no confirmation

func PromptFilePicker

func PromptFilePicker(prompt string, directory string) ([]string, error)

PromptFilePicker prompts the user with a file picker for multi-file selection Returns a slice of absolute file paths that were selected. Users must explicitly select files with Space key; Enter with no selection cancels.

func PromptInput

func PromptInput(question string, defaultValue string) (string, error)

PromptInput prompts the user for text input

func PromptMultiSelect

func PromptMultiSelect(question string, options []string) ([]int, error)

PromptMultiSelect prompts the user to select multiple items from a list

func PromptSelect

func PromptSelect(question string, options []string) (int, error)

PromptSelect prompts the user to select one item from a list

func ShouldPrompt

func ShouldPrompt(cmd *cobra.Command, hasRequiredInfo bool) bool

ShouldPrompt determines if we should prompt for this specific scenario

Types

type Mode

type Mode int
const (
	ModeAuto           Mode = iota // Smart detection
	ModeInteractive                // Force interactive
	ModeNonInteractive             // Force non-interactive
)

func GetMode

func GetMode(cmd *cobra.Command) Mode

GetMode detects the appropriate mode based on flags and environment

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL