Documentation
¶
Index ¶
- Constants
- Variables
- func Confirm(label string, defaultYes bool) (bool, error)
- func IsInteractive() bool
- func LogError(msg string)
- func LogErrorf(format string, a ...any)
- func LogInfo(msg string)
- func LogInfof(format string, a ...any)
- func LogSuccess(msg string)
- func LogSuccessf(format string, a ...any)
- func LogWarning(msg string)
- func LogWarningf(format string, a ...any)
- func MultiSelect(label string, options []string) ([]int, error)
- func SectionBlank()
- func SectionEnd(msg string)
- func SectionLine(msg string)
- func SectionStart(title string)
- func Select(label string, options []string) (int, error)
- func SetNoColor(v bool)
- func TextInput(label string, placeholder string) (string, error)
- type Spinner
Constants ¶
const ( IconSuccess = "✓" IconFailure = "✗" IconWarning = "⚠" IconSpinner = "⠋" IconPrompt = "◆" IconSelected = "●" IconUnselected = "○" IconChecked = "[x]" IconUnchecked = "[ ]" IconPull = "↑" IconPush = "↓" IconNoChange = "=" )
Icons used throughout the CLI output.
const ( BoxTop = "┌" BoxMiddle = "│" BoxBottom = "└" )
Box-drawing characters for section framing.
Variables ¶
var ( StyleSuccess lipgloss.Style StyleError lipgloss.Style StyleWarning lipgloss.Style StyleInfo lipgloss.Style StylePath lipgloss.Style StyleEncryption lipgloss.Style StyleSecondary lipgloss.Style )
Lipgloss styles for consistent terminal output.
var ErrNonInteractive = errors.New("non-interactive terminal")
ErrNonInteractive is returned when a prompt requires user input but the terminal is not interactive.
Functions ¶
func IsInteractive ¶
func IsInteractive() bool
IsInteractive reports whether the terminal supports interactive prompts.
func LogSuccess ¶
func LogSuccess(msg string)
LogSuccess prints a success message with a green checkmark.
func LogSuccessf ¶
LogSuccessf prints a formatted success message.
func LogWarning ¶
func LogWarning(msg string)
LogWarning prints a warning message with a yellow indicator.
func LogWarningf ¶
LogWarningf prints a formatted warning message.
func MultiSelect ¶
MultiSelect presents a list of options with checkboxes and returns the indices of selected items.
func SectionLine ¶
func SectionLine(msg string)
SectionLine prints a continuation line within a section.
func SectionStart ¶
func SectionStart(title string)
SectionStart prints the opening line of a section.
func SetNoColor ¶
func SetNoColor(v bool)
SetNoColor forces color output on or off. Intended for the --no-color flag.
Types ¶
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner displays an animated loading indicator in the terminal.
func NewSpinner ¶
NewSpinner creates a spinner with the given message.