cli

package
v0.0.0-...-1096d29 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package cli wires the cobra command tree for twoctl. Generated subcommands (one tree per API) are registered from init() functions in sibling files.

Index

Constants

View Source
const (
	ExitOK          = 0
	ExitGeneric     = 1
	ExitUsage       = 2 // bad flags / missing required input
	ExitAuth        = 3 // 401/403
	ExitNotFound    = 4 // 404
	ExitRateLimited = 5 // 429
	ExitServer      = 6 // 5xx
	ExitNetwork     = 7 // transport-level failure
)

Exit codes - documented in README so scripts and agents can branch on them.

Variables

This section is empty.

Functions

func HandleError

func HandleError(err error)

HandleError renders any error returned from a command and exits with the right code. apiErrors are serialised to stderr as JSON so agents can parse them; other errors print as plain text.

func Root

func Root() *cobra.Command

Root returns the configured root cobra.Command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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