doctor

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteInstall

func ExecuteInstall(plan *InstallPlan, autoConfirm bool) error

ExecuteInstall runs the install plan, printing each command before running it.

func RunAuthStep

func RunAuthStep(step AuthStep, envFile string) bool

RunAuthStep executes a single authentication step interactively. Returns true if the step was completed successfully.

Types

type AuthStep

type AuthStep struct {
	Name       string `json:"name"`
	RequiredBy string `json:"required_by"`
	Configured bool   `json:"configured"`
	Detail     string `json:"detail"`
	Action     string `json:"action,omitempty"` // human-readable action to take
}

AuthStep represents a single authentication step.

func AuthPlan

func AuthPlan(envFile string) []AuthStep

AuthPlan returns the list of authentication steps with their current status.

type CredentialStatus

type CredentialStatus struct {
	Name       string `json:"name"`
	RequiredBy string `json:"required_by"`
	Configured bool   `json:"configured"`
	Detail     string `json:"detail,omitempty"`
	HowToFix   string `json:"how_to_fix,omitempty"`
}

CredentialStatus represents the state of a credential or auth session.

func CheckCredentials

func CheckCredentials(envFile string) []CredentialStatus

CheckCredentials audits all credentials and auth sessions.

type InstallPlan

type InstallPlan struct {
	PackageManager string        `json:"package_manager"`
	Steps          []InstallStep `json:"steps"`
}

InstallPlan describes what will be installed and the commands to run.

func PlanInstall

func PlanInstall(requiredOnly bool) (*InstallPlan, error)

PlanInstall looks at missing tools and returns the commands needed to install them. If requiredOnly is true, only required tools are included.

type InstallStep

type InstallStep struct {
	Tool       string `json:"tool"`
	Command    string `json:"command"`
	Tap        string `json:"tap,omitempty"`
	IsRequired bool   `json:"required"`
}

InstallStep is a single install action.

type Report

type Report struct {
	System      SystemInfo         `json:"system"`
	Tools       []ToolStatus       `json:"tools"`
	Credentials []CredentialStatus `json:"credentials"`
}

Report is the full doctor audit result.

func RunFullAudit

func RunFullAudit(envFile string) Report

RunFullAudit runs the complete doctor check.

type SystemInfo

type SystemInfo struct {
	OS             string `json:"os"`
	Arch           string `json:"arch"`
	PackageManager string `json:"package_manager"`
	PMVersion      string `json:"pm_version,omitempty"`
}

SystemInfo holds detected system information.

func DetectSystem

func DetectSystem() SystemInfo

DetectSystem detects the OS, architecture, and package manager.

type ToolStatus

type ToolStatus struct {
	Name        string `json:"name"`
	Binary      string `json:"binary"`
	FeatureArea string `json:"feature_area"`
	Required    bool   `json:"required"`
	Installed   bool   `json:"installed"`
	Version     string `json:"version,omitempty"`
	Path        string `json:"path,omitempty"`
	InstallCmd  string `json:"install_cmd,omitempty"`
	InstallTap  string `json:"install_tap,omitempty"`
	Note        string `json:"note,omitempty"`
}

ToolStatus represents the state of a single prerequisite tool.

func CheckTools

func CheckTools() []ToolStatus

CheckTools audits all prerequisite CLI tools.

Jump to

Keyboard shortcuts

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