cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDockerClient

func CreateDockerClient(cfg *manifest.Config) *dockercli.Client

CreateDockerClient creates a Docker client using config context and identifier.

func CreatePlanner

func CreatePlanner(docker *dockercli.Client, pr ui.Printer) *planner.Planner

CreatePlanner creates a planner with Docker client and printer configured.

func Execute

func Execute() int

Execute runs the root command and handles error formatting and exit codes.

func GetConfirmation

func GetConfirmation(cmd *cobra.Command, pr ui.Printer, opts ConfirmationOptions) (bool, error)

GetConfirmation handles user confirmation with TTY detection and appropriate prompting.

func LoadConfigWithWarnings

func LoadConfigWithWarnings(cmd *cobra.Command, pr ui.Printer) (*manifest.Config, error)

LoadConfigWithWarnings loads the configuration from the --config flag and displays warnings.

func ProgressOperation

func ProgressOperation(pr ui.StdPrinter, message string, operation func(*ui.Progress) error) error

ProgressOperation runs an operation with a progress bar.

func SpinnerOperation

func SpinnerOperation(pr ui.StdPrinter, message string, operation func() error) error

SpinnerOperation runs an operation with a spinner, automatically handling start/stop.

func TestPrintUserFriendly

func TestPrintUserFriendly(err error)

TestPrintUserFriendly exposes printUserFriendly for testing

func ValidateWithDocker

func ValidateWithDocker(ctx context.Context, cfg *manifest.Config, docker *dockercli.Client) error

ValidateWithDocker runs validation against the configuration and Docker client.

func Version

func Version() string

func VersionDetailed

func VersionDetailed() string

VersionDetailed returns version info with build metadata if available.

Types

type CLIContext

type CLIContext struct {
	Config  *manifest.Config
	Docker  *dockercli.Client
	Printer ui.Printer
	Planner *planner.Planner
}

CLIContext contains all the components needed for most CLI operations.

func SetupCLIContext

func SetupCLIContext(cmd *cobra.Command) (*CLIContext, error)

SetupCLIContext performs the standard CLI setup: load config, create Docker client, validate, and create planner.

func (*CLIContext) ApplyPlan

func (ctx *CLIContext) ApplyPlan() error

ApplyPlan executes the plan with progress tracking.

func (*CLIContext) BuildPlan

func (ctx *CLIContext) BuildPlan() (*planner.Plan, error)

BuildPlan creates a plan using the CLI context with spinner UI.

func (*CLIContext) PrunePlan

func (ctx *CLIContext) PrunePlan() error

PrunePlan executes pruning with spinner.

type ConfirmationOptions

type ConfirmationOptions struct {
	SkipConfirmation bool
	Message          string
}

ConfirmationOptions configures the confirmation prompt behavior.

Jump to

Keyboard shortcuts

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