wizard

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package wizard provides shared interactive prompt helpers using charmbracelet/huh.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskCheckbox

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

AskCheckbox prompts the user to select multiple options.

func AskConfirm

func AskConfirm(label string, defaultVal bool) (bool, error)

AskConfirm prompts the user for a yes/no confirmation.

func AskInput

func AskInput(label, defaultVal string, validate func(string) error) (string, error)

AskInput prompts for a single-line text input.

func AskSelect

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

AskSelect prompts the user to select one option from a list.

func ParseCommaSeparated

func ParseCommaSeparated(input string) []string

ParseCommaSeparated splits a comma-separated string, trims whitespace, and filters empty entries.

func ToPascalCase

func ToPascalCase(s string) string

ToPascalCase converts a kebab-case or snake_case string to PascalCase.

func TodayISO

func TodayISO() string

TodayISO returns today's date in YYYY-MM-DD format.

func ValidateKebabCase

func ValidateKebabCase(input string) error

ValidateKebabCase validates that input is lowercase kebab-case.

func ValidateMinLength

func ValidateMinLength(min int) func(string) error

ValidateMinLength returns a validator that checks minimum string length.

func ValidatePort

func ValidatePort(input string) error

ValidatePort validates that input is a valid port number (1-65535).

Types

type Option

type Option struct {
	Value string
	Label string
}

Option represents a choice in select/checkbox prompts.

Jump to

Keyboard shortcuts

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