Documentation
¶
Index ¶
Constants ¶
const ( ExitGeneral = 1 // unclassified error ExitBadArgs = 2 // bad arguments or flag misuse ExitAuthError = 3 // authentication failure ExitAPIError = 4 // API call failure ExitNotFound = 5 // resource not found )
Exit codes for specific failure modes. Commands should return errors that carry one of these codes so scripts can distinguish failure categories.
Variables ¶
This section is empty.
Functions ¶
func ExecuteRoot ¶ added in v0.7.188
ExecuteRoot runs rootCmd and flushes buffered telemetry whether or not the command succeeds.
The flush cannot live in PersistentPostRunE: cobra returns as soon as RunE reports an error and never reaches its post-run hooks, so every failed invocation would drop the events it buffered. A lost command_invocation is only a missing row, but an auth flow prompted mid-command also buffers the identify that joins the user's pre-auth events to them — and that is sent once, on the run that logs in. If the command then fails, nothing re-sends it and the anonymous half of the journey stays orphaned for good.
func GoneError ¶ added in v0.7.124
GoneError returns a formatted error when err contains a 410 Gone status, which the API uses for two distinct conditions: this CLI being too old for the API, and a sidecar being too old for the API. Returns nil for any other error. Use at the top of main's error path to intercept 410s before generic handling.
func NewRootCmd ¶
Types ¶
This section is empty.
Source Files
¶
- auth.go
- authhelper.go
- buildprompt.go
- commands.go
- completion.go
- config.go
- conflicts.go
- env.go
- errmsg.go
- execregister.go
- hook.go
- init.go
- mutate.go
- org.go
- prune.go
- receivetelemetry.go
- root.go
- sidecar.go
- sidecarlogs.go
- skills.go
- snapshotpick.go
- task.go
- upgrade.go
- usererr.go
- validate.go
- validate_variants.go
- watch.go
- watchdaemon.go