Documentation
¶
Index ¶
- Constants
- Variables
- func Execute() error
- func ExitCode(err error) int
- func FormatUserError(err error) string
- func GetAPIURL(cmd *cobra.Command, cfgBaseURL string) string
- func GetDevAPIURL(cmd *cobra.Command) string
- func GetDevFrontendURL(cmd *cobra.Command) string
- func GetDevSettings(cmd *cobra.Command) (debug, verbose, tlsInsecure bool)
- func IsDevMode(cmd *cobra.Command) bool
- func NewUsageError(err error) error
- func RequiredFlag(name string) error
- func RequiredFlagf(name, hintFormat string, args ...any) error
- func RequiredOneOfFlags(names ...string) error
- func UsageErrorf(format string, args ...any) error
- type UsageError
Constants ¶
const ( ExitOK = 0 ExitError = 1 // runtime / operational failure ExitMisuse = 2 // invalid usage, unknown flags/commands, bad arguments )
Standard process exit codes (sysexits-aligned for CLI misuse).
Variables ¶
var ErrAgentNotFound = errors.New("agent not found")
ErrAgentNotFound reports that no agent matched the requested name.
Functions ¶
func FormatUserError ¶
FormatUserError is the stderr text for a failed command. Blocked provider APIs (CreateAgent, peering, cluster register, and similar) all print the same backend copy.
func GetAPIURL ¶
GetAPIURL returns the API URL with the following priority: 1. --api-url flag (if set) 2. Config-derived base URL (e.g. mothership.host profile for a LAN control plane) 3. Dev API URL (if --dev flag is set; localhost when no control-plane host is configured) 4. Config file API base URL
func GetDevAPIURL ¶
GetDevAPIURL returns the development API URL if --dev is enabled, otherwise returns empty string
func GetDevFrontendURL ¶
GetDevFrontendURL returns the development frontend URL if --dev is enabled, otherwise returns empty string
func GetDevSettings ¶
GetDevSettings returns development settings based on --dev flag If --dev is set, it enables debug, verbose, and TLS insecure mode
func NewUsageError ¶
NewUsageError wraps err as invalid CLI usage.
func RequiredFlag ¶
RequiredFlag reports a missing mandatory flag as invalid usage (exit 2).
func RequiredFlagf ¶
RequiredFlagf reports a missing mandatory flag together with a hint on how to supply it.
func RequiredOneOfFlags ¶
RequiredOneOfFlags reports that at least one of several alternative flags must be set.
func UsageErrorf ¶
UsageErrorf formats a usage error.
Types ¶
type UsageError ¶
type UsageError struct {
Err error
}
UsageError marks invalid CLI invocation (flags, args, unknown commands).
func (*UsageError) Error ¶
func (e *UsageError) Error() string
func (*UsageError) Unwrap ¶
func (e *UsageError) Unwrap() error
Source Files
¶
- agent.go
- auth.go
- cluster.go
- cluster_agent_resolve.go
- cluster_diagnostics.go
- cluster_inbound_peering.go
- cluster_leftover.go
- cluster_lifecycle.go
- cluster_operator_install.go
- cluster_operator_upgrade.go
- cluster_org.go
- cluster_peering_kubeconfig.go
- cluster_register_opts.go
- cluster_verify.go
- exit.go
- gateway_region.go
- metrics_credential.go
- operator_collect.go
- output.go
- prompt.go
- provider_review.go
- root.go
- service_account.go