prompt

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCancelled = errors.New("prompt cancelled")

ErrCancelled is returned when the user cancels a prompt.

Functions

func Confirm

func Confirm(message string) (bool, error)

Confirm asks for a yes/no answer. Default is no.

func Input

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

Input prompts for a single-line text value with an optional default.

func MaskedInput

func MaskedInput(label string) (string, error)

MaskedInput prompts for a secret value (API key, password) with masked display.

func Select

func Select(label string, items []string) (int, string, error)

Select presents a list of options and returns the selected index and value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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