Documentation
¶
Overview ¶
Package commands provides CLI command-specific UI components.
Index ¶
- Variables
- func ColorInfo(text string) string
- func ColorSuccess(text string) string
- func ColorWarning(text string) string
- func PrintError(msg string)
- func PrintErrorf(format string, args ...interface{})
- func PrintInfo(msg string)
- func PrintInfof(format string, args ...interface{})
- func PrintSuccess(msg string)
- func PrintSuccessf(format string, args ...interface{})
- func PrintWarning(msg string)
- func PrintWarningf(format string, args ...interface{})
- func PromptYesNo(prompt string) bool
- func PromptYesNoDefault(prompt string, defaultYes bool) bool
- func WithSpinner(message string, fn func())
- type Spinner
Constants ¶
This section is empty.
Variables ¶
var ( TitleStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("62")). Bold(true) SuccessStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("46")) ErrorStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("196")) WarningStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("226")) InfoStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("75")) )
Functions ¶
func ColorSuccess ¶
ColorSuccess returns text styled with the success color.
func ColorWarning ¶
ColorWarning returns text styled with the warning color.
func PrintError ¶
func PrintError(msg string)
PrintError prints an error message with red [ERROR] prefix.
func PrintErrorf ¶ added in v0.0.5
func PrintErrorf(format string, args ...interface{})
PrintErrorf prints a formatted error message with red [ERROR] prefix.
func PrintInfo ¶
func PrintInfo(msg string)
PrintInfo prints an informational message with blue [INFO] prefix.
func PrintInfof ¶ added in v0.0.5
func PrintInfof(format string, args ...interface{})
PrintInfof prints a formatted informational message with blue [INFO] prefix.
func PrintSuccess ¶
func PrintSuccess(msg string)
PrintSuccess prints a success message with green [SUCCESS] prefix.
func PrintSuccessf ¶ added in v0.0.5
func PrintSuccessf(format string, args ...interface{})
PrintSuccessf prints a formatted success message with green [SUCCESS] prefix.
func PrintWarning ¶
func PrintWarning(msg string)
PrintWarning prints a warning message with yellow [WARNING] prefix.
func PrintWarningf ¶ added in v0.0.5
func PrintWarningf(format string, args ...interface{})
PrintWarningf prints a formatted warning message with yellow [WARNING] prefix.
func PromptYesNo ¶
PromptYesNo displays a prompt and returns true if user responds y/yes. Defaults to no if the user just presses enter.
func PromptYesNoDefault ¶ added in v0.0.5
PromptYesNoDefault displays a prompt with a configurable default. If defaultYes is true, pressing enter without input returns true.
func WithSpinner ¶ added in v0.0.5
func WithSpinner(message string, fn func())
WithSpinner runs a function while displaying a spinner.
Types ¶
type Spinner ¶ added in v0.0.5
type Spinner struct {
// contains filtered or unexported fields
}
Spinner provides an animated spinner for long-running operations.
func NewSpinner ¶ added in v0.0.5
NewSpinner creates a new spinner with the given message.
func (*Spinner) Start ¶ added in v0.0.5
func (s *Spinner) Start()
Start begins the spinner animation.
func (*Spinner) UpdateMessage ¶ added in v0.0.5
UpdateMessage changes the spinner message while running.