cli

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package cli provides CLI tool dependency detection and installation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetArch

func GetArch() string

GetArch returns the current architecture (amd64, arm64)

func GetPlatform

func GetPlatform() string

GetPlatform returns the current platform (linux, darwin)

func PrintDependencyStatus

func PrintDependencyStatus(deps []DependencyStatus)

PrintDependencyStatus prints a summary of dependency status

func PrintInstallationError

func PrintInstallationError(name string, err error)

PrintInstallationError prints an error message if installation fails

func PrintInstallationStart

func PrintInstallationStart(name string)

PrintInstallationStart prints a message when starting installation

func PrintInstallationSuccess

func PrintInstallationSuccess(name string)

PrintInstallationSuccess prints a success message after installation

func PromptForInstall

func PromptForInstall(missing []DependencyStatus) (bool, error)

PromptForInstall asks user permission to install missing tools Returns true if the user approves installation

func PromptForSingleInstall

func PromptForSingleInstall(dep DependencyStatus) (bool, error)

PromptForSingleInstall asks permission to install a single tool

Types

type DependencyChecker

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

DependencyChecker handles detection of CLI tools

func NewDependencyChecker

func NewDependencyChecker(debug bool) *DependencyChecker

NewDependencyChecker creates a new dependency checker

func (*DependencyChecker) CheckAWSCLI

func (d *DependencyChecker) CheckAWSCLI() DependencyStatus

CheckAWSCLI checks if AWS CLI v2 is installed

func (*DependencyChecker) CheckAll

func (d *DependencyChecker) CheckAll() []DependencyStatus

CheckAll checks all K8s related dependencies

func (*DependencyChecker) CheckEksctl

func (d *DependencyChecker) CheckEksctl() DependencyStatus

CheckEksctl checks if eksctl is installed

func (*DependencyChecker) CheckKubectl

func (d *DependencyChecker) CheckKubectl() DependencyStatus

CheckKubectl checks if kubectl is installed

func (*DependencyChecker) CheckMissing

func (d *DependencyChecker) CheckMissing() []DependencyStatus

CheckMissing returns only the missing or invalid dependencies

type DependencyStatus

type DependencyStatus struct {
	Name       string
	Installed  bool
	Version    string
	Required   bool
	MinVersion string
	Message    string
}

DependencyStatus represents the status of a CLI tool

type InstallOptions

type InstallOptions struct {
	Sudo        bool   // Use sudo for installation
	InstallPath string // Where to install binaries (default: /usr/local/bin)
}

InstallOptions contains options for installation

func DefaultInstallOptions

func DefaultInstallOptions() InstallOptions

DefaultInstallOptions returns sensible defaults

type Installer

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

Installer handles installation of CLI tools

func NewInstaller

func NewInstaller(debug bool) *Installer

NewInstaller creates a new installer for the current platform

func (*Installer) Install

func (i *Installer) Install(ctx context.Context, name string, opts InstallOptions) error

Install installs a specific dependency by name

func (*Installer) InstallAWSCLI

func (i *Installer) InstallAWSCLI(ctx context.Context, opts InstallOptions) error

InstallAWSCLI installs AWS CLI v2

func (*Installer) InstallEksctl

func (i *Installer) InstallEksctl(ctx context.Context, opts InstallOptions) error

InstallEksctl installs eksctl

func (*Installer) InstallKubectl

func (i *Installer) InstallKubectl(ctx context.Context, opts InstallOptions) error

InstallKubectl installs kubectl

Jump to

Keyboard shortcuts

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