ui

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package ui holds the look of locksql'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

View Source
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).

View Source
const (
	MarkOK   = "✓"
	MarkWarn = "▲"
	MarkFail = "✗"
	MarkStep = "›"
)

Status marks.

View Source
const Tagline = "Your AI writes the query. You hold the key."

Tagline is the line under the name.

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

func For(f *os.File) Painter

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) Accent

func (p Painter) Accent(s string) string

func (Painter) Banner

func (p Painter) Banner(version string, context ...string) string

Banner is the logo with the name, the version, the tagline and up to two lines of context beside it, indented by two columns.

func (Painter) Bold

func (p Painter) Bold(s string) string

func (Painter) Brand

func (p Painter) Brand(s string) string

func (Painter) Dim

func (p Painter) Dim(s string) string

func (Painter) Fail

func (p Painter) Fail(s string) string

func (Painter) Green

func (p Painter) Green(s string) string

func (Painter) Heading

func (p Painter) Heading(title string, width int) string

Heading is a section title: "── title ───…" padded to width columns.

func (Painter) OK

func (p Painter) OK(s string) string

OK, Warn and Fail are status lines led by their mark.

func (Painter) Paint

func (p Painter) Paint(code, s string) string

Paint wraps s in the escape code when the painter is on.

func (Painter) Red

func (p Painter) Red(s string) string

func (Painter) Step

func (p Painter) Step(s string) string

Step is a line that announces what happens next.

func (Painter) Warn

func (p Painter) Warn(s string) string

func (Painter) Yellow

func (p Painter) Yellow(s string) string

Jump to

Keyboard shortcuts

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