ui

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IconSuccess     = "✓"
	IconError       = "❌"
	IconWarning     = "⚠"
	IconInfo        = "ℹ"
	IconProcessing  = "⏳"
	IconLock        = "🔒"
	IconUnlock      = "🔓"
	IconBranch      = "🌿"
	IconEnvironment = "🏗️"
	IconPromote     = "⬆️"
	IconDemote      = "⬇️"
	IconRelease     = "🚀"
	IconMerge       = "🔀"
	IconHook        = "🪝"
	IconGit         = "📦"
	IconStar        = "⭐"
	IconSparkles    = "✨"
	IconGear        = "⚙️"
	IconCheck       = "✔"
	IconCross       = "✖"
	IconArrowRight  = "→"
	IconArrowLeft   = "←"
	IconBullet      = "•"
	IconDiamond     = "◆"
	IconSquare      = "■"
	IconCircle      = "●"
)

ASCII icons and symbols

View Source
const (
	BoxTopLeft     = "╭"
	BoxTopRight    = "╮"
	BoxBottomLeft  = "╰"
	BoxBottomRight = "╯"
	BoxHorizontal  = "─"
	BoxVertical    = "│"
	BoxCross       = "┼"
)

Box drawing characters for borders

Variables

View Source
var (
	// Primary colors
	ColorPrimary   = color.New(color.FgCyan, color.Bold)
	ColorSecondary = color.New(color.FgBlue)
	ColorAccent    = color.New(color.FgMagenta)

	// Status colors
	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.FgWhite)

	// Environment colors
	ColorDev     = color.New(color.FgCyan)
	ColorQA      = color.New(color.FgYellow)
	ColorStaging = color.New(color.FgBlue)
	ColorProd    = color.New(color.FgRed, color.Bold)

	// Muted colors
	ColorMuted     = color.New(color.FgHiBlack)
	ColorDim       = color.New(color.FgBlack)
	ColorHighlight = color.New(color.BgCyan, color.FgBlack, color.Bold)
)

Color palette for the CLI

Functions

func Bullet

func Bullet(msg string, icon string, color *color.Color)

Bullet prints a bullet point with custom icon and color

func BulletItem

func BulletItem(msg string)

BulletItem prints a simple bullet item

func CheckItem

func CheckItem(msg string)

CheckItem prints a checkmark item

func CrossItem

func CrossItem(msg string)

CrossItem prints a cross item

func Error

func Error(msg string)

Error prints an error message with icon and color

func Errorf

func Errorf(format string, args ...interface{})

Errorf prints a formatted error message

func Header(title string)

Header prints a stylized header

func Info

func Info(msg string)

Info prints an info message with icon and color

func Infof

func Infof(format string, args ...interface{})

Infof prints a formatted info message

func PrintBox

func PrintBox(lines []string, title string)

PrintBox prints text in a decorative box

func PrintBranch

func PrintBranch(branchName string)

PrintBranch prints branch information with icon

func PrintCommand

func PrintCommand(cmd string)

PrintCommand prints a command with highlighting

func PrintDemotion

func PrintDemotion(branch, env string)

PrintDemotion prints demotion information with icons

func PrintEmptyLine

func PrintEmptyLine()

PrintEmptyLine prints an empty line for spacing

func PrintEnvironment

func PrintEnvironment(envName string, envInfo interface{})

PrintEnvironment prints environment information with appropriate styling

func PrintLockStatus

func PrintLockStatus(locked bool, lockedBy string, lockedAt time.Time)

PrintLockStatus prints lock status with appropriate icon and color

func PrintPromotion

func PrintPromotion(branch, env string, isRelease bool)

PrintPromotion prints promotion information with icons

func PrintSeparator

func PrintSeparator()

PrintSeparator prints a visual separator

func PrintSpinner

func PrintSpinner(msg string)

PrintSpinner prints a simple spinner (for future async operations)

func PrintTimestamp

func PrintTimestamp(t time.Time)

PrintTimestamp prints a formatted timestamp

func Section

func Section(title string)

Section prints a section separator

func SubHeader

func SubHeader(title string)

SubHeader prints a stylized subheader

func Success

func Success(msg string)

Success prints a success message with icon and color

func Successf

func Successf(format string, args ...interface{})

Successf prints a formatted success message

func Warning

func Warning(msg string)

Warning prints a warning message with icon and color

func Warningf

func Warningf(format string, args ...interface{})

Warningf prints a formatted warning message

Types

type ProgressBar

type ProgressBar struct {
	// contains filtered or unexported fields
}

ProgressBar creates a simple progress bar (placeholder for future use)

func NewProgressBar

func NewProgressBar(total, width int) *ProgressBar

func (*ProgressBar) Update

func (p *ProgressBar) Update(current int)

Jump to

Keyboard shortcuts

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