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 DockerPullProgress(quiet bool) func(error)
- func Error(msg string)
- func FirstRunProgress(quiet bool) func()
- 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 InitSteps
- type ProgressBar
- 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 DockerPullProgress ¶ added in v1.0.12
DockerPullProgress prints an animated Docker pull progress indicator. It returns a done-func that, when called, clears the line and prints completion.
func FirstRunProgress ¶ added in v1.0.11
func FirstRunProgress(quiet bool) func()
FirstRunProgress prints a first-run progress note to stdout. It outputs a static one-liner in non-TTY/quiet mode and a timed line in TTY mode. Returns a done function that must be called when the pull is complete.
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 InitSteps ¶ added in v1.0.12
type InitSteps struct {
// contains filtered or unexported fields
}
InitSteps renders a multi-step progress display for nself init. Each call to Next() advances one step and prints the current step label.
func NewInitSteps ¶ added in v1.0.12
NewInitSteps creates an InitSteps tracker for the given ordered step labels.
type ProgressBar ¶ added in v1.0.12
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar renders a terminal progress bar with percentage and elapsed time. It is safe to call from a single goroutine; updates are synchronous.
func NewProgressBar ¶ added in v1.0.12
func NewProgressBar(label string, total int, quiet bool) *ProgressBar
NewProgressBar creates a ProgressBar with the given label and total steps. Width defaults to 40 characters of fill area.
func (*ProgressBar) Done ¶ added in v1.0.12
func (p *ProgressBar) Done()
Done marks the bar at 100% and prints a newline.
func (*ProgressBar) Inc ¶ added in v1.0.12
func (p *ProgressBar) Inc()
Inc increments the bar by one step.
func (*ProgressBar) Set ¶ added in v1.0.12
func (p *ProgressBar) Set(n int)
Set advances the bar to an absolute position (0..total).
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.