Help us shape the future of Go! Take the 2026 Go Developer Survey

interactive

package
v0.3.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(label string) (bool, error)

Confirm prompts the user for a yes/no confirmation

func Input

func Input(label string, defaultValue string) (string, error)

Input prompts the user for text input

func InputSecret

func InputSecret(label string) (string, error)

InputSecret prompts the user for secret input (hidden)

func IsInteractive

func IsInteractive() bool

IsInteractive returns true if stdin is a terminal

func SelectString

func SelectString(label string, items []string) (string, error)

SelectString prompts the user to select from a list of strings

Types

type Option

type Option struct {
	Label       string
	Value       string
	Description string
}

Option represents a selectable option

func MultiSelect

func MultiSelect(label string, options []Option) ([]Option, error)

MultiSelect prompts the user to select multiple options

func Select

func Select(label string, options []Option) (Option, error)

Select prompts the user to select from a list of options

Jump to

Keyboard shortcuts

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