Documentation
¶
Index ¶
- Constants
- func Bullet(item string)
- func C(color, text string) string
- func Checked(item string)
- func CommandHeader(title, subtitle string)
- func CommandHeaderStderr(title, subtitle string)
- func Dimmed(msg string)
- func Error(msg string)
- func Info(msg string)
- func PrintJSON(v interface{}) error
- func PrintJSONError(err error)
- func Section(title string)
- func Separator()
- func Step(current, total int, message string)
- func Success(msg string)
- func SummaryBox(title string, items []string)
- func UXError(problem, context string, solutions []string)
- func Unchecked(item string)
- func Warn(msg string)
- type Spinner
- type Table
Constants ¶
const ( // Styles Reset = "\033[0m" Bold = "\033[1m" Dim = "\033[2m" Underline = "\033[4m" // Foreground Black = "\033[0;30m" Red = "\033[0;31m" Green = "\033[0;32m" Yellow = "\033[0;33m" Blue = "\033[0;34m" Magenta = "\033[0;35m" Cyan = "\033[0;36m" White = "\033[0;37m" // Bright (for high-visibility) BrightRed = "\033[1;31m" BrightGreen = "\033[1;32m" BrightYellow = "\033[1;33m" // Background (rare, for critical alerts) BgRed = "\033[41m" BgGreen = "\033[42m" BgYellow = "\033[43m" BgBlue = "\033[44m" )
ANSI color and style constants.
const ( IconSuccess = "\u2713" // ✓ — success, healthy, done IconFailure = "\u2717" // ✗ — error, failed IconWarning = "\u26A0" // ⚠ — warning IconInfo = "\u2139" // ℹ — informational IconArrow = "\u2192" // → — next steps, navigation, section header IconBullet = "\u2022" // • — list items )
Unicode icon constants for terminal output.
Variables ¶
This section is empty.
Functions ¶
func Bullet ¶
func Bullet(item string)
Bullet prints an indented bullet point with a blue bullet icon.
func C ¶
C wraps text in the given ANSI color code if colors are enabled. Returns plain text otherwise.
func CommandHeader ¶
func CommandHeader(title, subtitle string)
CommandHeader prints a 60-char wide double-line box with title and subtitle. Every command starts with this header.
func CommandHeaderStderr ¶
func CommandHeaderStderr(title, subtitle string)
CommandHeaderStderr prints the command header to stderr. Use this for commands whose stdout output is machine-readable (URLs, values, JSON).
func PrintJSON ¶
func PrintJSON(v interface{}) error
PrintJSON marshals v to indented JSON (2-space indent) and writes it to stdout.
func PrintJSONError ¶
func PrintJSONError(err error)
PrintJSONError writes a JSON error object {"error": "message"} to stderr.
func Section ¶
func Section(title string)
Section prints a newline, blue arrow, and bold title to stdout.
func SummaryBox ¶
SummaryBox prints a green double-line box with a star-decorated title and bulleted items.
Types ¶
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner provides a goroutine-based terminal spinner with braille animation.
func NewSpinner ¶
NewSpinner creates a new Spinner with the given message.
func (*Spinner) Fail ¶
Fail stops the spinner and prints a red cross with the given message to stderr.
func (*Spinner) Start ¶
func (s *Spinner) Start()
Start begins the spinner animation in a background goroutine. In non-TTY environments, it prints "... message" once with no animation.