output

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package output renders command results as a human table or as machine JSON or YAML, selected by the --format flag. Agents pass --format json for a stable, parseable surface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blue added in v0.12.0

func Blue(s string) string

func Bold added in v0.12.0

func Bold(s string) string

func Check added in v0.12.0

func Check() string

Check returns a light brand-green check mark (plain ASCII when colour is off).

func Emit

func Emit(format string, v interface{}, tableFn func() Table) error

Emit writes v in the requested format. For "table" it calls tableFn to build the columns; for "json"/"yaml" it marshals v directly. tableFn may be nil when only structured output makes sense.

func Green added in v0.12.0

func Green(s string) string

Green/Blue/Slate/Bold colourise a string for human terminals (no-ops when colour is disabled).

func Slate added in v0.12.0

func Slate(s string) string

func Str

func Str(m map[string]interface{}, key string) string

Str returns a string field from a generic record, or "" if absent.

func Success added in v0.12.0

func Success(w io.Writer, format string, a ...interface{})

Success writes a "✔ <message>" line (to stderr by convention, so stdout stays the data channel for piping).

func Wordmark added in v0.12.0

func Wordmark() string

Wordmark returns the "privasys" wordmark in bold white (the brand colours stay on the logo mark, not the name).

Types

type Table

type Table struct {
	Headers []string
	Rows    [][]string
}

Table is a set of column headers and rows.

Jump to

Keyboard shortcuts

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