interactive

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskConfirm

func AskConfirm(title string, defaultValue bool) (bool, error)

AskConfirm prompts for a yes/no confirmation

func AskMultiSelect

func AskMultiSelect(title string, options []SelectOption, limit int) ([]string, error)

AskMultiSelect prompts for multiple selections from a list

func AskSelect

func AskSelect(title string, options []SelectOption) (string, error)

AskSelect prompts for a selection from a list

func AskString

func AskString(title, placeholder string) (string, error)

AskString prompts for a string input

Types

type Confirm

type Confirm struct {
	Title       string
	Description string
	Value       *bool
	Affirmative string
	Negative    string
}

Confirm represents a yes/no confirmation prompt

func (*Confirm) Run

func (c *Confirm) Run() error

Run executes the confirmation prompt

type Form

type Form struct {
	Title       string
	Description string
	Groups      []FormGroup
}

Form represents a group of prompts

func (*Form) Run

func (f *Form) Run() error

Run executes the form

type FormGroup

type FormGroup struct {
	Title  string
	Fields []huh.Field
}

FormGroup represents a group of form fields

type MultiSelect

type MultiSelect struct {
	Title       string
	Description string
	Options     []SelectOption
	Value       *[]string
	Limit       int
}

MultiSelect represents a multi-selection prompt

func (*MultiSelect) Run

func (m *MultiSelect) Run() error

Run executes the multi-select prompt

type Prompt

type Prompt struct {
	Title       string
	Description string
	Placeholder string
	Value       *string
	Required    bool
}

Prompt represents a simple text input prompt

func (*Prompt) Run

func (p *Prompt) Run() error

Run executes the prompt

type Select

type Select struct {
	Title       string
	Description string
	Options     []SelectOption
	Value       *string
}

Select represents a selection prompt

func (*Select) Run

func (s *Select) Run() error

Run executes the select prompt

type SelectOption

type SelectOption struct {
	Key   string
	Value string
}

SelectOption represents an option in a select prompt

type Text

type Text struct {
	Title       string
	Description string
	Placeholder string
	Value       *string
	CharLimit   int
	Required    bool
}

Text represents a multi-line text input prompt

func (*Text) Run

func (t *Text) Run() error

Run executes the text prompt

Jump to

Keyboard shortcuts

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