cli

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIClient *client.Client

APIClient is the shared API client used by CLI commands after pre-run.

Functions

func Configure

func Configure(opts CLIOptions)

Configure applies options to the root command (e.g. for tests or alternate entry points).

func Execute

func Execute()

Execute runs the root command with default flags (e.g. verbose) and exits on error.

func Root

func Root() *cobra.Command

Root returns the root cobra command. Used by main and tests.

Types

type CLIOptions

type CLIOptions struct {
	// DaemonManager handles daemon lifecycle. If nil, uses default.
	DaemonManager types.DaemonManager
	// AuthnProvider provides CLI-specific authentication.
	// If nil, token comes from flags/env (ARCTL_API_TOKEN).
	AuthnProvider types.CLIAuthnProvider
	// ClientFactory creates the API client. If nil, uses client.NewClientWithConfig (requires network).
	ClientFactory ClientFactory
}

CLIOptions configures the CLI behavior. Can be extended for more options (e.g. client factory).

type ClientFactory added in v0.1.26

type ClientFactory func(ctx context.Context, baseURL, token string) (*client.Client, error)

ClientFactory creates an API client for the given base URL and token. Used for testing when nil; production uses client.NewClientWithConfig.

Jump to

Keyboard shortcuts

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