ui

package
v0.7.67 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bold

func Bold(text string) string

func CommandList

func CommandList(cmds []CommandEntry) string

CommandList formats commands in aligned columns.

func Cyan

func Cyan(text string) string

func Dim

func Dim(text string) string

func ErrBold added in v0.7.51

func ErrBold(text string) string

ErrBold applies bold using stderr color detection.

func ErrDim added in v0.7.51

func ErrDim(text string) string

ErrDim applies dim using stderr color detection.

func ErrGreen added in v0.7.51

func ErrGreen(text string) string

ErrGreen applies green color using stderr color detection.

func ErrSuccess added in v0.7.51

func ErrSuccess(msg string) string

ErrSuccess formats a success message using stderr color detection.

func ErrWarning added in v0.7.51

func ErrWarning(msg string) string

ErrWarning formats a warning message using stderr color detection.

func ErrYellow added in v0.7.51

func ErrYellow(text string) string

ErrYellow applies yellow color using stderr color detection.

func FormatError

func FormatError(brief string, detail string, suggestion string) string

FormatError formats a red error with optional detail and suggestion.

func Gray

func Gray(text string) string

func Green

func Green(text string) string

func Label

func Label(text string, width int) string

Label pads and bolds a label for aligned key-value output.

func Red

func Red(text string) string

func SetColorEnabled

func SetColorEnabled(enabled bool)

SetColorEnabled overrides automatic color detection for both stdout and stderr.

func Step

func Step(current, total int, title string) string

Step formats a numbered pipeline step header: "Step 1/3 Title".

func Success

func Success(msg string) string

Success formats a green checkmark success message.

func Warning

func Warning(msg string) string

Warning formats a yellow warning message.

func Yellow

func Yellow(text string) string

Types

type CommandEntry

type CommandEntry struct {
	Name        string
	Run         string
	Description string
}

CommandEntry describes a command for list formatting.

type Spinner

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

Spinner shows a braille dot animation on stderr during long operations. No-op when stderr is not a TTY.

func NewSpinner

func NewSpinner() *Spinner

NewSpinner creates a spinner that writes to stderr.

func (*Spinner) Log

func (s *Spinner) Log(message string)

Log prints a message on its own line while keeping the spinner running.

func (*Spinner) Start

func (s *Spinner) Start(message string)

func (*Spinner) Stop

func (s *Spinner) Stop()

func (*Spinner) StopWithMessage

func (s *Spinner) StopWithMessage(message string)

func (*Spinner) Update

func (s *Spinner) Update(message string)

Jump to

Keyboard shortcuts

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