ui

package
v0.0.0-...-081cd02 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ui provides styled terminal output for the aisw CLI.

Index

Constants

View Source
const (
	Reset     = "\033[0m"
	Bold      = "\033[1m"
	Dim       = "\033[2m"
	Italic    = "\033[3m"
	Underline = "\033[4m"

	Red     = "\033[31m"
	Green   = "\033[32m"
	Yellow  = "\033[33m"
	Blue    = "\033[34m"
	Magenta = "\033[35m"
	Cyan    = "\033[36m"
	White   = "\033[37m"
	Gray    = "\033[90m"
)

ANSI color codes.

View Source
const (
	SymbolCheck   = "✓"
	SymbolCross   = "✗"
	SymbolWarning = "!"
	SymbolDot     = "●"
	SymbolArrow   = "→"
	SymbolInfo    = "ℹ"
	SymbolStar    = "★"
)

Symbols for status indicators.

Variables

This section is empty.

Functions

func ActiveBadge

func ActiveBadge(active bool) string

ActiveBadge returns a styled active/inactive indicator.

func Badge

func Badge(text, color string) string

Badge renders a colored badge/tag.

func BlueText

func BlueText(s string) string

func BoldBlue

func BoldBlue(s string) string

func BoldCyan

func BoldCyan(s string) string

func BoldGreen

func BoldGreen(s string) string

func BoldRed

func BoldRed(s string) string

func BoldText

func BoldText(s string) string

func BoldYellow

func BoldYellow(s string) string

func Box

func Box(title, body string)

Box prints text inside a bordered box.

func CyanText

func CyanText(s string) string

func DimText

func DimText(s string) string

func Error

func Error(msg string)

func GrayText

func GrayText(s string) string

func GreenText

func GreenText(s string) string
func Header(title string)

func Hint

func Hint(msg string)

func Info

func Info(msg string)

func KeyValue

func KeyValue(label, value string, width int)

KeyValue prints a label and value with consistent alignment.

func MagentaText

func MagentaText(s string) string

func ProviderBadge

func ProviderBadge(provider string) string

ProviderBadge returns a colored provider name.

func RedText

func RedText(s string) string

func Separator

func Separator()

Separator prints a dim horizontal line.

func StatusBadge

func StatusBadge(status string) string

StatusBadge returns a colored status indicator.

func SubHeader

func SubHeader(title string)

func Success

func Success(msg string)

func Warning

func Warning(msg string)

func YellowText

func YellowText(s string) string

Types

type Table

type Table struct {
	Headers []string
	Rows    [][]string
	// contains filtered or unexported fields
}

Table renders a formatted table with headers and rows.

func NewTable

func NewTable(headers ...string) *Table

func (*Table) AddRow

func (t *Table) AddRow(cols ...string)

func (*Table) Render

func (t *Table) Render()

Jump to

Keyboard shortcuts

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