ui

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 7 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 exits an interactive prompt.

Functions

func RenderCommandHelp

func RenderCommandHelp(cmd *cobra.Command) string

RenderCommandHelp renders a styled help view for Cobra commands.

func RenderInfo

func RenderInfo(message string) string

RenderInfo renders an informational message.

func RenderSuccess

func RenderSuccess(message string) string

RenderSuccess renders a success message.

func RenderWarning

func RenderWarning(message string) string

RenderWarning renders a warning message.

func RunConfirm

func RunConfirm(prompt string, initialValue bool) (bool, error)

RunConfirm renders a simple yes/no prompt.

func RunTextInput

func RunTextInput(prompt string, placeholder string, initialValue string, validate Validator) (string, error)

RunTextInput renders a simple single-line text prompt.

Types

type Option

type Option struct {
	Label       string
	Description string
	Value       string
}

Option is a single selectable item in the TUI.

func RunSelect

func RunSelect(prompt string, options []Option, initialIndex int) (Option, error)

RunSelect renders a simple keyboard-driven selector.

type Validator

type Validator func(value string) error

Validator validates text input.

Jump to

Keyboard shortcuts

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