cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)

Build metadata, injected via -ldflags by the Makefile/goreleaser.

Functions

func NewRootCmd

func NewRootCmd() *cobra.Command

NewRootCmd builds the full command tree.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App holds shared state threaded through every command.

type ExitError

type ExitError struct {
	Code int
	Err  error
}

ExitError carries a process exit code up to main.

func (*ExitError) Error

func (e *ExitError) Error() string

func (*ExitError) Unwrap

func (e *ExitError) Unwrap() error

type Format

type Format string

Format is an output rendering format.

const (
	FormatTable Format = "table"
	FormatJSON  Format = "json"
	FormatJSONL Format = "jsonl"
	FormatCSV   Format = "csv"
	FormatTSV   Format = "tsv"
	FormatURL   Format = "url"
	FormatRaw   Format = "raw"
)

type Renderer

type Renderer struct {
	Format   Format
	Fields   []string // optional column subset/order
	NoHeader bool
	Template string // Go text/template applied per record
	// contains filtered or unexported fields
}

Renderer turns slices of records into one of the supported output formats.

func NewRenderer

func NewRenderer(w io.Writer, format Format, fields []string, noHeader bool, tmpl string) *Renderer

NewRenderer builds a Renderer writing to w.

func (*Renderer) Render

func (r *Renderer) Render(records any) error

Render writes records (a slice of structs) in the configured format.

Jump to

Keyboard shortcuts

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