Documentation
¶
Index ¶
- Constants
- Variables
- func Badge(text, badgeType string) string
- func Banner(name, version, description string)
- func Divider(width int) string
- func Error(msg string)
- func Errorf(format string, args ...interface{})
- func Header(msg string)
- func Info(msg string)
- func Infof(format string, args ...interface{})
- func KeyValue(key, value string) string
- func List(items []string)
- func Muted(msg string)
- func Newline()
- func NumberedList(items []string)
- func Panel(title, content string) string
- func Print(msg string)
- func Printf(format string, args ...interface{})
- func ProgressBar(current, total int, width int) string
- func Section(title string) string
- func SpinnerError(msg string)
- func SpinnerSuccess(msg string)
- func StartSpinner(msg string)
- func StatusIcon(status string) string
- func StatusRow(component, status, details string) ([]string, []tablewriter.Colors)
- func StopSpinner()
- func SubSection(title string) string
- func Subtitle(msg string)
- func Success(msg string)
- func Successf(format string, args ...interface{})
- func Summary(title string, items map[string]string)
- func Title(msg string)
- func Tree(root string, children []string)
- func Warning(msg string)
- func Warningf(format string, args ...interface{})
- type Printer
- type Table
- type TableConfig
Constants ¶
View Source
const ( IconSuccess = "✓" IconWarning = "⚠" IconError = "✗" IconInfo = "ℹ" IconRunning = "●" IconPending = "○" IconArrow = "→" IconBullet = "•" IconCheck = "✔" IconCross = "✘" IconStar = "★" IconDot = "·" IconPipe = "│" IconCorner = "└" IconTee = "├" IconDash = "─" IconDoubleDash = "═" )
Status icons
Variables ¶
View Source
var ( // Primary colors PrimaryColor = lipgloss.Color("#7C3AED") // Purple SecondaryColor = lipgloss.Color("#06B6D4") // Cyan AccentColor = lipgloss.Color("#F59E0B") // Amber // Status colors SuccessColor = lipgloss.Color("#10B981") // Green WarningColor = lipgloss.Color("#F59E0B") // Amber ErrorColor = lipgloss.Color("#EF4444") // Red InfoColor = lipgloss.Color("#3B82F6") // Blue // Neutral colors MutedColor = lipgloss.Color("#6B7280") // Gray BackgroundColor = lipgloss.Color("#1F2937") // Dark gray BorderColor = lipgloss.Color("#374151") // Medium gray )
Theme colors for consistent styling
View Source
var ( // Title styles TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(PrimaryColor). MarginBottom(1) SubtitleStyle = lipgloss.NewStyle(). Foreground(SecondaryColor). Italic(true) // Status styles SuccessStyle = lipgloss.NewStyle(). Foreground(SuccessColor). Bold(true) WarningStyle = lipgloss.NewStyle(). Foreground(WarningColor). Bold(true) ErrorStyle = lipgloss.NewStyle(). Foreground(ErrorColor). Bold(true) InfoStyle = lipgloss.NewStyle(). Foreground(InfoColor) MutedStyle = lipgloss.NewStyle(). Foreground(MutedColor) // Box styles BoxStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(BorderColor). Padding(1, 2) HeaderBoxStyle = lipgloss.NewStyle(). Border(lipgloss.DoubleBorder()). BorderForeground(PrimaryColor). Padding(0, 2). Bold(true) // Badge styles SuccessBadge = lipgloss.NewStyle(). Background(SuccessColor). Foreground(lipgloss.Color("#FFFFFF")). Padding(0, 1). Bold(true) WarningBadge = lipgloss.NewStyle(). Background(WarningColor). Foreground(lipgloss.Color("#000000")). Padding(0, 1). Bold(true) ErrorBadge = lipgloss.NewStyle(). Background(ErrorColor). Foreground(lipgloss.Color("#FFFFFF")). Padding(0, 1). Bold(true) InfoBadge = lipgloss.NewStyle(). Background(InfoColor). Foreground(lipgloss.Color("#FFFFFF")). Padding(0, 1). Bold(true) )
Styled text helpers
View Source
var ( ColorSuccess = color.New(color.FgGreen, color.Bold) ColorWarning = color.New(color.FgYellow, color.Bold) ColorError = color.New(color.FgRed, color.Bold) ColorInfo = color.New(color.FgBlue) ColorMuted = color.New(color.FgHiBlack) ColorPrimary = color.New(color.FgMagenta, color.Bold) ColorCyan = color.New(color.FgCyan) )
Color print helpers using fatih/color for table compatibility
Functions ¶
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf prints a formatted error message
func ProgressBar ¶
ProgressBar renders a simple progress bar
func SpinnerSuccess ¶
func SpinnerSuccess(msg string)
SpinnerSuccess stops spinner with success message
func StatusRow ¶
func StatusRow(component, status, details string) ([]string, []tablewriter.Colors)
StatusRow returns a colored row based on status
Types ¶
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer handles all CLI output
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table represents a styled table
func ResourceTable ¶
ResourceTable creates a pre-configured resource table
func SimpleTable ¶
SimpleTable creates a borderless simple table
func StatusTable ¶
StatusTable creates a pre-configured status table
func (*Table) AddColoredRow ¶
func (t *Table) AddColoredRow(row []string, colors []tablewriter.Colors)
AddColoredRow adds a row with specific colors
Click to show internal directories.
Click to hide internal directories.