Help us shape the future of Go! Take the 2026 Go Developer Survey

commands

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Package commands implements the CLI command tree and runtime wiring.

Index

Constants

View Source
const (
	ExitSuccess    = 0
	ExitValidation = 1
	ExitProvider   = 2
	ExitNetwork    = 3
	ExitTimeout    = 4
)

Exit codes.

Variables

View Source
var (
	// Version is the semantic version of the CLI.
	Version = "dev"
	// Commit is the git commit hash.
	Commit = "unknown"
	// BuildDate is the date when the binary was built.
	BuildDate = "unknown"
)

Version information set at build time via ldflags. Example: go build -ldflags "-X github.com/petal-labs/iris/cli/commands.Version=v1.0.0"

Functions

func Execute

func Execute() error

Execute runs the default app root command.

Types

type App added in v0.12.0

type App struct {
	// contains filtered or unexported fields
}

App holds CLI state and runtime dependencies.

func NewApp added in v0.12.0

func NewApp(opts ...AppOption) *App

NewApp creates a new CLI app with default dependencies.

func (*App) Execute added in v0.12.0

func (a *App) Execute() error

Execute runs the root command.

type AppOption added in v0.12.0

type AppOption func(*App)

AppOption customizes App dependencies.

func WithConfigLoader added in v0.12.0

func WithConfigLoader(loader ConfigLoader) AppOption

WithConfigLoader injects a config loader dependency.

func WithIO added in v0.12.0

func WithIO(stdin io.Reader, stdout, stderr io.Writer) AppOption

WithIO injects process I/O streams.

func WithKeystoreFactory added in v0.12.0

func WithKeystoreFactory(factory KeystoreFactory) AppOption

WithKeystoreFactory injects a keystore factory dependency.

func WithProviderFactory added in v0.12.0

func WithProviderFactory(factory ProviderFactory) AppOption

WithProviderFactory injects a provider factory dependency.

type ConfigLoader added in v0.12.0

type ConfigLoader func(path string) (*config.Config, error)

ConfigLoader loads CLI config from a path.

type KeystoreFactory added in v0.12.0

type KeystoreFactory func() (keystore.Keystore, error)

KeystoreFactory creates a keystore instance.

type ProviderFactory added in v0.12.0

type ProviderFactory func(providerID, apiKey string, cfg *config.Config) (core.Provider, error)

ProviderFactory creates a provider using CLI config context.

Jump to

Keyboard shortcuts

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