doctor

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package doctor implements `sf doctor` — a one-call health check of the local sf install. Its anchor check is binary staleness: whether bin/sf is older than git HEAD (the "fixed in git but never rebuilt" trap, which silently makes the agent run outdated tools). It also checks PATH resolution and shell completions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand() *cobra.Command

NewCommand returns the `doctor` Cobra command (`sf doctor`).

func Run

func Run(opts Options, w io.Writer) error

Run collects the checks, renders them, logs the call, and returns a non-nil error (→ exit 1) when any check FAILs so doctor can gate scripts.

Types

type Check

type Check struct {
	Name   string `json:"name"`
	Status string `json:"status"` // ok | warn | fail
	Detail string `json:"detail"`
}

Check is one health probe.

type Options

type Options struct {
	Format string
}

Options carries flag state.

type Result

type Result struct {
	Checks []Check `json:"checks"`
}

Result is the full report.

func Collect

func Collect(_ Options) (*Result, error)

Collect runs every check in order. It never errors (each check degrades to a warn/ok), so the report is always renderable.

Jump to

Keyboard shortcuts

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