interactive

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package interactive provides modern interactive CLI components using PTerm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(message string) (bool, error)

Confirm shows a confirmation prompt

func PasswordInput

func PasswordInput(message string) (string, error)

PasswordInput shows a masked password input prompt

func SelectString

func SelectString(message string, options []string) (string, error)

SelectString shows an interactive selection menu and returns the selected string

func TextInput

func TextInput(message string, defaultValue string) (string, error)

TextInput shows an interactive text input prompt

Types

type Option

type Option struct {
	Label string
	Value string
}

Option represents an item in a selection list

func MultiSelect

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

MultiSelect shows an interactive multi-selection menu

func Select

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

Select shows an interactive selection menu and returns the selected option Users can navigate with arrow keys, type to filter, and press Enter to select

Jump to

Keyboard shortcuts

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