Help us shape the future of Go! Take the 2026 Go Developer Survey

cliutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IconSuccess = StyleSuccess.Bold(true).Render("✓")
	IconError   = StyleError.Bold(true).Render("✗")
	IconWarning = StyleWarning.Bold(true).Render("⚠")
	IconInfo    = StyleInfo.Bold(true).Render("i")
	IconArrow   = StyleInfo.Bold(true).Render("→")
	IconDot     = StyleMuted.Render("•")
	IconStep    = StylePrimary.Render("◆")
)
View Source
var (
	// Basic typography
	StyleTitle    = lipgloss.NewStyle().Foreground(DefaultTheme.Primary).Bold(true)
	StyleSubtitle = lipgloss.NewStyle().Foreground(DefaultTheme.Secondary)
	StyleBody     = lipgloss.NewStyle().Foreground(DefaultTheme.Text)
	StyleMuted    = lipgloss.NewStyle().Foreground(DefaultTheme.Muted)
	StyleLabel    = lipgloss.NewStyle().Foreground(DefaultTheme.Text).Bold(true)
	StyleValue    = lipgloss.NewStyle().Foreground(DefaultTheme.Secondary)

	// Status semantics
	StyleSuccess = lipgloss.NewStyle().Foreground(DefaultTheme.Success)
	StyleError   = lipgloss.NewStyle().Foreground(DefaultTheme.Error)
	StyleWarning = lipgloss.NewStyle().Foreground(DefaultTheme.Warning)
	StyleInfo    = lipgloss.NewStyle().Foreground(DefaultTheme.Info)

	// Specialty
	StyleCode      = lipgloss.NewStyle().Foreground(DefaultTheme.Secondary).Background(DefaultTheme.Border).Padding(0, 1)
	StyleCommand   = lipgloss.NewStyle().Foreground(DefaultTheme.Primary).Bold(true)
	StyleURL       = lipgloss.NewStyle().Foreground(DefaultTheme.Secondary).Underline(true)
	StyleHighlight = lipgloss.NewStyle().Foreground(DefaultTheme.Secondary).Bold(true)

	// Containers
	StyleBox = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(DefaultTheme.Border).
				Padding(1, 2)
)
View Source
var (
	ColorSuccess   = DefaultTheme.Success
	ColorError     = DefaultTheme.Error
	ColorWarning   = DefaultTheme.Warning
	ColorInfo      = DefaultTheme.Info
	ColorHighlight = DefaultTheme.Secondary
	ColorDim       = DefaultTheme.Muted

	StyleHeader  = StyleTitle.Padding(0, 1).MarginTop(1).MarginBottom(1).Background(lipgloss.Color("62")) // Kept temporarily
	StyleSubtext = StyleMuted
	StyleBold    = lipgloss.NewStyle().Bold(true)
	StylePrompt  = StyleInfo.Bold(true)
)

Back-compatibility aliases

View Source
var DefaultTheme = Theme{
	Primary:    lipgloss.Color("#6366F1"),
	Secondary:  lipgloss.Color("#22D3EE"),
	Success:    lipgloss.Color("#22C55E"),
	Error:      lipgloss.Color("#EF4444"),
	Warning:    lipgloss.Color("#F59E0B"),
	Info:       lipgloss.Color("#3B82F6"),
	Muted:      lipgloss.Color("#71717A"),
	Text:       lipgloss.Color("#FAFAFA"),
	Background: lipgloss.Color("#18181B"),
	Border:     lipgloss.Color("#27272A"),
}

AtlasTheme defines the standard color palette for the CLI. Indigo/Cyan branding.

View Source
var NonInteractive bool

Global flag to disable interactive UI in CI/JSON

View Source
var StylePrimary = StyleTitle

Functions

func ApplyListTheme added in v0.2.0

func ApplyListTheme(d *list.DefaultDelegate)

ApplyListTheme applies the Atlas theme to a bubbles list delegate.

func Box added in v0.2.0

func Box(text string) string

Box returns a beautifully styled box containing the provided text.

func Error added in v0.2.0

func Error(msg string)

Error prints a standardized error message

func FormatBox

func FormatBox(text string) string

FormatBox renders a text string inside a beautifully styled box.

func FormatHeader

func FormatHeader(title string) string

FormatHeader renders a prominent header block. (Kept for compatibility)

func FormatStep

func FormatStep(label, value string) string

FormatStep renders a step with a highlighted value. (Kept for compatibility)

func FormatSuccess

func FormatSuccess(label, value string) string

FormatSuccess renders a success message with an aligned label. (Kept for compatibility)

func Info added in v0.2.0

func Info(msg string)

Info prints a standardized info message

func Panel added in v0.2.0

func Panel(title, text string) string

Panel is an alias for Box for larger content areas.

func PrintWelcome added in v0.2.0

func PrintWelcome()

PrintWelcome prints a side-by-side logo and description.

func PromptConfirm

func PromptConfirm(label string) (bool, error)

PromptConfirm prompts the user for a y/N response and returns true if yes.

func PromptSecret

func PromptSecret(label string) (string, error)

PromptSecret prompts the user for a secret using a masked input (no echo).

func PromptSecretFromReaderForTest

func PromptSecretFromReaderForTest(label string, r io.Reader) (string, error)

PromptSecretFromReaderForTest is an exported variant for testing environments.

func RenderStep added in v0.2.0

func RenderStep(name string, status StepStatus, message string) string

func Success added in v0.2.0

func Success(msg string)

Success prints a standardized success message

func Table added in v0.2.0

func Table(rows [][]string) string

Table renders a simple aligned key-value table.

func Warning added in v0.2.0

func Warning(msg string)

Warning prints a standardized warning message

Types

type DeployLogger added in v0.2.0

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

func NewDeployLogger added in v0.2.0

func NewDeployLogger(jsonMode bool) *DeployLogger

func (*DeployLogger) Box added in v0.2.0

func (l *DeployLogger) Box(msg string)

func (*DeployLogger) ErrorBox added in v0.2.0

func (l *DeployLogger) ErrorBox(err error, suggestion string)

func (*DeployLogger) Section added in v0.2.0

func (l *DeployLogger) Section(name string)

Section starts a new major phase (e.g. "◆ Detect")

func (*DeployLogger) StartSpinner added in v0.2.0

func (l *DeployLogger) StartSpinner(msg string)

func (*DeployLogger) StepLog added in v0.2.0

func (l *DeployLogger) StepLog(status StepStatus, msg string, duration ...time.Duration)

StepLog prints a sub-step (e.g. " ✓ Next.js")

func (*DeployLogger) StopSpinner added in v0.2.0

func (l *DeployLogger) StopSpinner(status StepStatus, finalMsg string, duration ...time.Duration)

type Spinner

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

Spinner represents a CLI loader built on Bubble Tea.

func StartSpinner

func StartSpinner(message string) *Spinner

StartSpinner starts a loader with a message.

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop stops the spinner and clears the line.

func (*Spinner) UpdateMessage

func (s *Spinner) UpdateMessage(newMessage string)

UpdateMessage changes the spinner message.

type StepStatus added in v0.2.0

type StepStatus int
const (
	StepPending StepStatus = iota
	StepRunning
	StepSuccess
	StepFailed
	StepSkipped
)
const StepInfo StepStatus = 100
const StepWarning StepStatus = 99

type Theme added in v0.2.0

type Theme struct {
	Primary    lipgloss.Color
	Secondary  lipgloss.Color
	Success    lipgloss.Color
	Error      lipgloss.Color
	Warning    lipgloss.Color
	Info       lipgloss.Color
	Muted      lipgloss.Color
	Text       lipgloss.Color
	Background lipgloss.Color
	Border     lipgloss.Color
}

Jump to

Keyboard shortcuts

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