Documentation
¶
Index ¶
- Constants
- Variables
- func Box(text string) string
- func C(code string) string
- func Code(text string) string
- func ColorEnabled() bool
- func Debug(format string, args ...interface{})
- func DidYouMean(suggestions []string) string
- func Divider(char string, width int)
- func Error(format string, args ...interface{})
- func ErrorWithCommand(err string, cmd string)
- func ErrorWithSuggestion(err string, suggestion string)
- func FormatDoctorReport(checks []Check) string
- func FormatExample(cmd, desc string) string
- func Header(title string)
- func Highlight(text string) string
- func Info(format string, args ...interface{})
- func IsStderrTTY() bool
- func IsTTY() bool
- func ListItem(name, desc string, nameWidth int)
- func Status(format string, args ...interface{})
- func SubHeader(title string)
- func Success(format string, args ...interface{})
- func VersionLong() string
- func VersionString() string
- func Warn(format string, args ...interface{})
- type Check
- type CheckStatus
- type ProgressBar
- type Spinner
Constants ¶
const ( Reset = "\033[0m" Bold = "\033[1m" Dim = "\033[2m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36m" White = "\033[37m" BoldRed = "\033[1;31m" BoldGreen = "\033[1;32m" BoldYellow = "\033[1;33m" BoldBlue = "\033[1;34m" BoldCyan = "\033[1;36m" )
Color codes
Variables ¶
var ( SpinnerDots = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"} SpinnerLine = []string{"-", "\\", "|", "/"} SpinnerBounce = []string{"⠁", "⠂", "⠄", "⠂"} SpinnerGrow = []string{"▁", "▃", "▄", "▅", "▆", "▇", "█", "▇", "▆", "▅", "▄", "▃"} SpinnerCircle = []string{"◐", "◓", "◑", "◒"} SpinnerArrow = []string{"←", "↖", "↑", "↗", "→", "↘", "↓", "↙"} SpinnerDefault = SpinnerDots )
Spinner frames
var ( Version = "1.0.1" BuildDate = "2026-01-25" GitCommit = "dev" )
Version information (set via ldflags or defaults)
var ( Quiet bool Verbose bool NoColor bool )
Global settings
Functions ¶
func Debug ¶
func Debug(format string, args ...interface{})
Debug prints a debug message to stderr (only in verbose mode)
func DidYouMean ¶
DidYouMean formats a "did you mean" suggestion
func ErrorWithCommand ¶
ErrorWithCommand prints an error with a command suggestion
func ErrorWithSuggestion ¶
ErrorWithSuggestion prints an error with a suggestion
func FormatDoctorReport ¶
FormatDoctorReport formats the doctor check results
func FormatExample ¶
FormatExample returns a formatted example
func Info ¶
func Info(format string, args ...interface{})
Info prints an info message to stderr (only in verbose mode)
func Status ¶
func Status(format string, args ...interface{})
Status prints a status message (non-quiet mode)
Types ¶
type Check ¶
type Check struct {
Name string
Status CheckStatus
Message string
Detail string
}
Check represents a diagnostic check result
type CheckStatus ¶
type CheckStatus int
const ( CheckOK CheckStatus = iota CheckWarn CheckFail CheckSkip )
func (CheckStatus) Icon ¶
func (s CheckStatus) Icon() string
func (CheckStatus) String ¶
func (s CheckStatus) String() string
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar displays a progress bar
func NewProgressBar ¶
func NewProgressBar(total int, message string) *ProgressBar
NewProgressBar creates a new progress bar
func (*ProgressBar) Increment ¶
func (p *ProgressBar) Increment()
Increment increments progress by 1
func (*ProgressBar) SetWidth ¶
func (p *ProgressBar) SetWidth(width int)
SetWidth sets the progress bar width
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner provides an animated loading indicator
func NewSpinner ¶
NewSpinner creates a new spinner with a message
func (*Spinner) SetMessage ¶
SetMessage updates the spinner message
func (*Spinner) StopSuccess ¶
StopSuccess stops with a success message
func (*Spinner) StopWithMessage ¶
StopWithMessage stops and prints a final message