Versions in this module Expand all Collapse all v0 v0.2.4 May 6, 2026 v0.2.3 May 4, 2026 v0.2.2 May 1, 2026 v0.2.1 Apr 28, 2026 Changes in this version type Question + Out io.Writer type Select + Out io.Writer v0.2.0 Apr 25, 2026 v0.1.0 Apr 25, 2026 Changes in this version + const ERR + const OK + var ErrUIAborted = ui.ErrAborted + var ErrUIInvalidState = ui.ErrInvalidState + var ErrUINoTTY = ui.ErrNoTTY + var ErrUINotImplemented = ui.ErrNotImplemented + func AnswerIsYes(defVal ...bool) bool + func Ask(question, defVal string, fn func(ans string) error, maxTimes ...int) string + func Checkbox(title string, options any, defOpts []string, allowQuit ...bool) []string + func Choice(title string, options any, defOpt string, allowQuit ...bool) string + func Confirm(message string, defVal ...bool) bool + func GetHiddenInput(message string, trimmed bool) string + func MultiSelect(title string, options any, defOpts []string, allowQuit ...bool) []string + func NewUIConfirm(prompt string, def bool) *ui.Confirm + func NewUIFakeBackend(events ...backend.Event) backend.Backend + func NewUIInput(prompt string) *ui.Input + func NewUIMultiSelect(prompt string, items []ui.Item) *ui.MultiSelect + func NewUIPlainBackend() backend.Backend + func NewUIReadlineBackend() backend.Backend + func NewUISelect(prompt string, items []ui.Item) *ui.Select + func NewUIStrictReadlineBackend() backend.Backend + func Prompt(ctx context.Context, query, defaultAnswer string) (string, error) + func Query(question, defVal string, fn func(ans string) error, maxTimes ...int) string + func ReadFirst(question string) (string, error) + func ReadInput(question string) (string, error) + func ReadLine(question string) (string, error) + func ReadPassword(question ...string) string + func SelectOne(title string, options any, defOpt string, allowQuit ...bool) string + func SingleSelect(title string, options any, defOpt string, allowQuit ...bool) string + func Unconfirmed(message string, defVal ...bool) bool + type Collector struct + func NewCollector() *Collector + func (c *Collector) AddParam(p InputParameter) error + func (c *Collector) AddParams(ps ...InputParameter) error + func (c *Collector) MustParam(name string) InputParameter + func (c *Collector) Param(name string) (InputParameter, bool) + func (c *Collector) Results() maputil.Data + func (c *Collector) Run() error + type ComOptions struct + ValidFn func(val any) (any, error) + type InputParameter interface + Desc func() string + Name func() string + Run func() error + Set func(v string) error + Type func() string + Value func() structs.Value + type Interactive struct + Name string + func New(name string) *Interactive + type ItemFace interface + Name func() string + Value func() string + type Options struct + DefVal string + Quit bool + type Question struct + DefVal string + Func func(ans string) error + MaxTimes int + Q string + func NewQuestion(q string, defVal ...string) *Question + func (q *Question) Run() *Value + type RunFace interface + Run func() *Value + type Select struct + DefOpt string + DefOpts []string + DisableQuit bool + MultiSelect bool + Options any + Title string + func NewSelect(title string, items any) *Select + func (s *Select) EnableMulti() *Select + func (s *Select) Run() *SelectResult + type SelectResult struct + K Value + func (sv *SelectResult) Key() any + func (sv *SelectResult) KeyString() string + func (sv *SelectResult) KeyStrings() []string + func (sv *SelectResult) WithKey(key any) *SelectResult + type StepHandler func(ctx context.Context) error + type StepsRun struct + Steps []StepHandler + func (s *StepsRun) Err() error + func (s *StepsRun) Run() + func (s *StepsRun) Stop() + type UIBackend = backend.Backend + type UIConfirm = ui.Confirm + type UIInput = ui.Input + type UIItem = ui.Item + type UIMultiSelect = ui.MultiSelect + type UIResult = ui.Result + type UISelect = ui.Select + type Value = structs.Value