Documentation
¶
Index ¶
- Constants
- func Banner(info VersionInfo) string
- func Color(text, colorCode string) string
- func Cyan(text string) string
- func Dim(text string) string
- func Enabled() bool
- func Error(text string) string
- func ErrorPrint(format string, args ...interface{})
- func ErrorPrintf(format string, args ...interface{})
- func Errorf(format string, args ...interface{}) string
- func FormatError(err error) string
- func FormatErrorWithContext(ctx ErrorContext) string
- func Info(text string) string
- func InfoPrint(format string, args ...interface{})
- func Infof(format string, args ...interface{}) string
- func Init(noColor bool)
- func Print(format string, args ...interface{})
- func PrintJSON(data interface{}) error
- func PrintJSONError(err error) error
- func PrintJSONResult(result JSONResult) error
- func Printf(format string, args ...interface{})
- func Println(args ...interface{})
- func QuietPrint(format string, args ...interface{})
- func SetVerbosity(level int)
- func SetWriters(out, err io.Writer)
- func Success(text string) string
- func SuccessPrint(format string, args ...interface{})
- func SuccessPrintln(text string)
- func Successf(format string, args ...interface{}) string
- func VerbosePrint(format string, args ...interface{})
- func VerbosePrintf(format string, args ...interface{})
- func Warning(text string) string
- func WarningPrint(format string, args ...interface{})
- func WarningPrintf(format string, args ...interface{})
- func WarningPrintln(text string)
- func Warningf(format string, args ...interface{}) string
- func WrapError(err error, suggestion string) error
- func WrapErrorWithCode(err error, suggestion string, code string) error
- func WriteJSON(data *export.Data, outputPath string) error
- func WriteTar(data *export.Data, outputPath string) error
- type ErrorContext
- type ErrorOutput
- type JSONResult
- type VersionInfo
Constants ¶
const ( Reset = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Gray = "\033[90m" )
ANSI color codes
const ( QuietLevel = iota NormalLevel VerboseLevel )
Verbosity levels
Variables ¶
This section is empty.
Functions ¶
func Banner ¶ added in v0.2.0
func Banner(info VersionInfo) string
Banner renders a branded ASCII art banner with version information. It uses Lipgloss for styling and respects the existing NO_COLOR / TTY detection handled by the output package.
func ErrorPrint ¶
func ErrorPrint(format string, args ...interface{})
ErrorPrint always prints (errors should always be shown).
func ErrorPrintf ¶
func ErrorPrintf(format string, args ...interface{})
ErrorPrintf always prints formatted text (errors should always be shown).
func FormatError ¶
FormatError formats an error with context and suggestions.
func FormatErrorWithContext ¶
func FormatErrorWithContext(ctx ErrorContext) string
FormatErrorWithContext formats an error with explicit context.
func InfoPrint ¶
func InfoPrint(format string, args ...interface{})
InfoPrint prints info message if verbosity allows.
func Init ¶
func Init(noColor bool)
Init initializes color output based on environment and flags. Call this early in the application lifecycle.
func PrintJSONError ¶ added in v0.3.5
PrintJSONError prints an error using a stable machine-readable shape.
func PrintJSONResult ¶
func PrintJSONResult(result JSONResult) error
PrintJSONResult prints a JSONResult as JSON.
func Printf ¶
func Printf(format string, args ...interface{})
Printf prints formatted text if verbosity allows.
func QuietPrint ¶
func QuietPrint(format string, args ...interface{})
QuietPrint prints text only in quiet mode (errors).
func SetWriters ¶
SetWriters sets the output and error writers (useful for testing).
func SuccessPrint ¶
func SuccessPrint(format string, args ...interface{})
SuccessPrint prints success message if verbosity allows.
func SuccessPrintln ¶
func SuccessPrintln(text string)
SuccessPrintln prints success message with newline if verbosity allows.
func VerbosePrint ¶
func VerbosePrint(format string, args ...interface{})
VerbosePrint prints text only in verbose mode.
func VerbosePrintf ¶
func VerbosePrintf(format string, args ...interface{})
VerbosePrintf prints formatted text only in verbose mode.
func WarningPrint ¶
func WarningPrint(format string, args ...interface{})
WarningPrint prints warning message if verbosity allows.
func WarningPrintf ¶
func WarningPrintf(format string, args ...interface{})
WarningPrintf prints formatted warning message if verbosity allows.
func WarningPrintln ¶
func WarningPrintln(text string)
WarningPrintln prints warning message with newline if verbosity allows.
func WrapErrorWithCode ¶
WrapErrorWithCode wraps an error with context and error code.
Types ¶
type ErrorContext ¶
ErrorContext provides additional context for errors.
type ErrorOutput ¶ added in v0.3.5
type ErrorOutput struct {
Success bool `json:"success"`
Error string `json:"error"`
Suggestion string `json:"suggestion,omitempty"`
ErrorCode string `json:"error_code,omitempty"`
}
ErrorOutput is the structured JSON representation of a command error.