commands

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package commands provides CLI command-specific UI components.

Index

Constants

This section is empty.

Variables

View Source
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 ColorInfo

func ColorInfo(text string) string

ColorInfo returns text styled with the info color.

func ColorSuccess

func ColorSuccess(text string) string

ColorSuccess returns text styled with the success color.

func ColorWarning

func ColorWarning(text string) string

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

func PromptYesNo(prompt string) bool

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

func PromptYesNoDefault(prompt string, defaultYes bool) bool

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

func NewSpinner(message string) *Spinner

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) Stop added in v0.0.5

func (s *Spinner) Stop()

Stop stops the spinner animation.

func (*Spinner) UpdateMessage added in v0.0.5

func (s *Spinner) UpdateMessage(message string)

UpdateMessage changes the spinner message while running.

Jump to

Keyboard shortcuts

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