Documentation
¶
Overview ¶
Package output provides gh-style pretty printing: tables, key-value, JSON, status messages, and script-friendly output (--jq).
Index ¶
- Variables
- func ApplyJQ(data any, expr string) error
- func Bold(msg string)
- func Dim(msg string)
- func Error(msg string)
- func Errorf(format string, a ...any)
- func FormatCell(v any) string
- func FormatCellPlain(v any) string
- func FormatRelativeTime(s string) string
- func Hint(msg string)
- func Hyperlink(text, target string) string
- func Info(msg string)
- func IsJSON() bool
- func IsTTY() bool
- func JSON(data any) error
- func KV(pairs []KVPair)
- func KVWithTitle(pairs []KVPair, title string)
- func OutputDetail(raw any, fields []FieldDef, title string) error
- func OutputList(raw any, rows []map[string]any, cols []Column, total, page int) error
- func Panel(title string, lines ...string)
- func Resolve(m map[string]any, key string) any
- func Success(msg string)
- func Table(rows []map[string]any, cols []Column)
- func TableTo(w io.Writer, rows []map[string]any, cols []Column, emptyMsg string)
- func VerboseF(format string, a ...any)
- func Warning(msg string)
- func Writer() io.Writer
- type Column
- type FieldDef
- type KVPair
- type Opts
Constants ¶
This section is empty.
Variables ¶
View Source
var Current = &Opts{Format: "table"}
Functions ¶
func ApplyJQ ¶ added in v0.2.0
ApplyJQ applies a jq expression to data and prints results to stdout. Returns an error if the expression is invalid.
func FormatCell ¶
func FormatCellPlain ¶ added in v0.2.0
FormatCellPlain formats a cell value without ANSI colors or timestamp rewriting. It is intended for TUI rendering where colors are applied later and timestamps should display as-is.
func FormatRelativeTime ¶
func KVWithTitle ¶
func OutputList ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.