Documentation
¶
Overview ¶
Package ui holds the look of a product's human-facing output: the palette of the logo, the banner and the status marks. Agent-facing output (the client commands, MCP) never goes through it.
Index ¶
- Constants
- type Painter
- func (p Painter) Accent(s string) string
- func (p Painter) Banner(name, tagline, version string, context ...string) string
- func (p Painter) Bold(s string) string
- func (p Painter) Brand(s string) string
- func (p Painter) Dim(s string) string
- func (p Painter) Fail(s string) string
- func (p Painter) Green(s string) string
- func (p Painter) Heading(title string, width int) string
- func (p Painter) OK(s string) string
- func (p Painter) Paint(code, s string) string
- func (p Painter) Red(s string) string
- func (p Painter) Step(s string) string
- func (p Painter) Warn(s string) string
- func (p Painter) Yellow(s string) string
Constants ¶
const ( Reset = "\x1b[0m" Bold = "\x1b[1m" Dim = "\x1b[2m" Red = "\x1b[1;31m" Green = "\x1b[32m" Yellow = "\x1b[33m" Violet = "\x1b[38;5;99m" Lilac = "\x1b[38;5;183m" Teal = "\x1b[38;5;37m" Neutral = "\x1b[38;5;245m" )
ANSI escapes. The brand colours are the 256-colour neighbours of the logo's: violet #8B5CF6 (body), lavender #C4B5FD (lid), teal #14B8A6 (shackle).
const ( MarkOK = "✓" MarkWarn = "▲" MarkFail = "✗" MarkStep = "›" )
Status marks.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Painter ¶
type Painter struct{ On bool }
Painter colours text when On, and returns it unchanged otherwise.
func For ¶
For returns a painter that colours output to f when f is a terminal and the environment does not opt out (NO_COLOR, TERM=dumb).
func (Painter) Banner ¶
Banner is the logo with the product name, the version, the tagline (split after its first ". ") and up to two lines of context beside it, indented by two columns.