ui

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 7 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 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.

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