cmd

package
v1.261004.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 27 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 (
	ExitSuccess  = 0 // Successful execution
	ExitError    = 1 // Generic/unclassified error
	ExitUsage    = 2 // Invalid usage / flags / command invocation
	ExitAuth     = 3 // Authentication failure (missing, unauthorized, forbidden)
	ExitNotFound = 4 // Resource not found
	ExitConflict = 5 // Conflict / resource already exists
	ExitReadOnly = 6 // Read-only mode refused a mutating request
	ExitPending  = 7 // An opted-in bounded wait ended before its target finished (builds wait --report-pending)

	// HTTP 4xx range: 10 + (status - 400)
	// Note: 404 and 409 are mapped to ExitNotFound and ExitConflict above.
	ExitHTTPBadRequest    = 10       // 400
	ExitHTTPUnauthorized  = ExitAuth // 401 (special case)
	ExitHTTPForbidden     = ExitAuth // 403 (special case)
	ExitHTTPUnprocessable = 32       // 422

	// HTTP 5xx range: 60 + (status - 500)
	ExitHTTPInternalServer     = 60 // 500
	ExitHTTPBadGateway         = 62 // 502
	ExitHTTPServiceUnavailable = 63 // 503
)

Exit codes following the CI/CD specification.

Variables

This section is empty.

Functions

func APIErrorCodeToExitCode

func APIErrorCodeToExitCode(code string) int

APIErrorCodeToExitCode maps an API error code string to the appropriate exit code.

func ExitCodeFromError

func ExitCodeFromError(err error) int

ExitCodeFromError maps an error to the appropriate exit code. This is the single source of truth for exit code determination.

func HTTPStatusToExitCode

func HTTPStatusToExitCode(status int) int

HTTPStatusToExitCode maps an HTTP status code to the appropriate exit code.

func RootCommand

func RootCommand(version string) *ffcli.Command

RootCommand returns the root command

func RootUsageFunc

func RootUsageFunc(c *ffcli.Command) string

RootUsageFunc renders grouped root help, similar to gh style.

func Run

func Run(args []string, versionInfo string) int

Run executes the CLI using the provided args (not including argv[0]) and version string. It returns the intended process exit code.

Types

This section is empty.

Jump to

Keyboard shortcuts

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