tui

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ColorError     = color.New(color.FgRed)
	ColorWarning   = color.New(color.FgYellow)
	ColorSuccess   = color.New(color.FgGreen)
	ColorHeader    = color.New(color.FgGreen)
	ColorSeparator = color.New(color.FgMagenta)
	ColorDim       = color.New(color.Faint)
	ColorCyan      = color.New(color.FgCyan)
	ColorBlue      = color.New(color.FgBlue)
	ColorHiYellow  = color.New(color.FgHiYellow)

	// Asset category colours
	ColorAgents    = color.New(color.FgBlue)
	ColorRoles     = color.New(color.FgGreen)
	ColorContexts  = color.New(color.FgCyan)
	ColorTasks     = color.New(color.FgHiYellow)
	ColorSettings  = color.New(color.FgMagenta)
	ColorPrompts   = color.New(color.Faint)
	ColorPaths     = color.New(color.FgHiCyan)
	ColorInstalled = color.New(color.FgHiGreen)
	ColorRegistry  = color.New(color.FgYellow)
)

Colour definitions per DR-042

Functions

func Annotate

func Annotate(format string, a ...any) string

Annotate returns text wrapped in cyan parentheses with dim content: (text)

func Bracket

func Bracket(format string, a ...any) string

Bracket returns text wrapped in cyan square brackets with dim content: [text]

func CategoryColor

func CategoryColor(category string) *color.Color

CategoryColor returns the colour for an asset category. Matching is case-insensitive.

Types

type Progress

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

Progress provides an in-place progress indicator using carriage return. Each Update overwrites the previous line. Done clears it. When the writer is not a terminal, Update and Done are no-ops.

func NewProgress

func NewProgress(w io.Writer, quiet bool) *Progress

NewProgress creates a progress writer. Carriage-return progress output is suppressed when w is not a terminal or quiet is true.

func (*Progress) Done

func (p *Progress) Done()

Done clears the progress line and resets. No-op when the writer is not a terminal.

func (*Progress) Update

func (p *Progress) Update(format string, a ...any)

Update writes a progress message, overwriting the previous line. No-op when the writer is not a terminal.

Jump to

Keyboard shortcuts

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