Documentation
¶
Overview ¶
Package cli implements the stacktower command-line interface.
Index ¶
- Constants
- func ExitCodeForError(err error) int
- func NewSystemError(message string, hint string) error
- func NewUserError(message string, hint string) error
- func WrapSystemError(cause error, message string, hint string) error
- func WrapUserError(cause error, message string, hint string) error
- type CLI
- type CLIError
- type ErrorKind
- type VulnError
Constants ¶
View Source
const ( LogDebug = log.DebugLevel LogInfo = log.InfoLevel )
Log levels exported for use in main.go.
View Source
const ( // ExitCodeFailure is a generic runtime failure. ExitCodeFailure = 1 // ExitCodeUsage indicates invalid input/usage from the caller. ExitCodeUsage = 2 // ExitCodeVuln signals that new vulnerabilities were detected (used by diff --fail-on-vuln). ExitCodeVuln = 3 // ExitCodeInterrupted follows shell convention for SIGINT/SIGTERM. ExitCodeInterrupted = 130 )
Variables ¶
This section is empty.
Functions ¶
func ExitCodeForError ¶
ExitCodeForError maps errors to stable process exit codes.
func NewSystemError ¶
NewSystemError constructs an execution/network/runtime error with optional hint.
func NewUserError ¶
NewUserError constructs a usage/input error with an optional actionable hint.
func WrapSystemError ¶
WrapSystemError wraps a cause as an execution/network/runtime error.
Types ¶
type CLI ¶
type CLI struct {
Logger *log.Logger
Quiet bool // suppress non-essential output (success messages, stats, next steps)
}
CLI holds shared state for all commands.
func New ¶
New creates a new CLI instance with a default logger. Registers observability hooks for pipeline and security events.
func (*CLI) RootCommand ¶
RootCommand creates the root cobra command with all subcommands registered.
func (*CLI) SetLogLevel ¶
SetLogLevel updates the logger's level.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.