output

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ExitOK           = 0
	ExitError        = 1
	ExitUsage        = 2
	ExitNotFound     = 3
	ExitConflict     = 4
	ExitAuth         = 5
	ExitRate         = 6
	ExitTimeout      = 7
	ExitStaleIndex   = 8
	ExitModelUnavail = 9
	ExitPartial      = 10
)

Variables

This section is empty.

Functions

func AgentMode

func AgentMode() bool

AgentMode reports whether the caller asked for the agent surface.

func ConfirmOrError

func ConfirmOrError(prompt string, dangerouslySkipConfirmation bool) error

func EncodeJSON

func EncodeJSON(w io.Writer, v any) error

func FilterFields

func FilterFields(v any, fields []string) (any, error)

func IsTerminal

func IsTerminal() bool

func NoColor

func NoColor() bool

func PrintTable

func PrintTable(w io.Writer, header []string, rows [][]string)

func SetAgentMode

func SetAgentMode(v bool)

SetAgentMode is called from main before any command runs.

func WriteError

func WriteError(w io.Writer, format Format, e *CLIError)

Types

type CLIError

type CLIError struct {
	Code        string   `json:"code"`
	Message     string   `json:"message"`
	Suggestions []string `json:"suggestions,omitempty"`
	ExitCode    int      `json:"exit_code"`
	Retryable   bool     `json:"retryable,omitempty"`
}

func Err

func Err(code, message string) *CLIError

func ErrWithExit

func ErrWithExit(code, message string, exitCode int) *CLIError

func (*CLIError) Error

func (e *CLIError) Error() string

type Format

type Format string
const (
	FormatTable Format = "table"
	FormatJSON  Format = "json"
	FormatYAML  Format = "yaml"
	FormatRaw   Format = "raw"
	FormatPlain Format = "plain"
)

func ResolveFormat

func ResolveFormat(flag string, jsonFlag bool) Format

Jump to

Keyboard shortcuts

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