Documentation
¶
Overview ¶
Package cli holds CLI-only output helpers — never imported by the SDK under pkg/gohai/, only by cmd/. Mirrors jot's theme system (same Theme struct, same role names) so all retr0h CLIs share one shape. Uses raw ANSI to avoid charmbracelet dependency conflicts.
Index ¶
- Variables
- func Accent(w io.Writer, s string) string
- func Banner(w io.Writer) string
- func Err(w io.Writer, s string) string
- func Failure(w io.Writer, msg string) string
- func Info(w io.Writer, s string) string
- func Mute(w io.Writer, s string) string
- func OK(w io.Writer, s string) string
- func Print(w io.Writer, s string)
- func Printf(w io.Writer, format string, a ...any)
- func Success(w io.Writer, msg string) string
- func WriteCollectorList(out io.Writer) error
- func WriteFlat(out io.Writer, facts *gohai.Facts) error
- func WriteJSON(out io.Writer, facts *gohai.Facts, pretty bool) error
- func WriteOCSF(out io.Writer, facts *gohai.Facts, pretty bool) error
- func WriteOutput(out io.Writer, facts *gohai.Facts, pretty, flat bool) error
- type Theme
Constants ¶
This section is empty.
Variables ¶
var ThemeMaxheadroom = Theme{
Name: "maxheadroom",
Mute: ansiFaint,
Accent: rgb(180, 167, 214),
OK: rgb(80, 250, 123),
Err: rgb(255, 110, 199),
Info: rgb(0, 212, 255),
BannerTop: ansiFaint,
BannerBot: rgb(180, 167, 214),
}
ThemeMaxheadroom is gohai's default — pulled from the maxheadroom palette. The primary accent is a soft lavender (#b4a7d6) — cooler and more muted than the magenta used by jot/grind; supporting roles are drawn from the same palette. Truecolor (24-bit) so the install banner and `gohai --help` paint with the exact same hue.
Functions ¶
func Banner ¶
Banner returns the GOHAI block-letter logo, themed via the active theme's BannerTop/BannerBot colors. Line-level coloring matches the install summary so curl|bash and `gohai --help` look the same.
func WriteCollectorList ¶
WriteCollectorList writes the collector registry grouped by category.
Types ¶
type Theme ¶
type Theme struct {
Name string
Mute string
Accent string
OK string
Err string
Info string
BannerTop string
BannerBot string
}
Theme is a six-role palette covering every place gohai's CLI surface emits styled text. Roles are stable across themes so a theme swap is a pure recolor — no callers change.