doctor

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintText

func PrintText(out io.Writer, report Report)

PrintText writes the report as plain text: a header with the version, the platform and the runtime root, then the checks grouped by section with their status label, detail and advice.

func StatusLabel

func StatusLabel(status Status) string

StatusLabel returns the fixed-width label printed before a check in the text report: [ok], [warn], [fail], or [skip] for any other status.

Types

type Check

type Check struct {
	Name    string `json:"name"`
	Status  Status `json:"status"`
	Detail  string `json:"detail,omitempty"`
	Advice  string `json:"advice,omitempty"`
	Section string `json:"section,omitempty"`
}

Check is one line of the doctor's report: what was checked, its Status, a Detail that says what was found, the Advice to fix it, and the Section it belongs to.

type Options

type Options struct {
	Version string
	Config  config.Config
}

Options configures a doctor run: the version to show and the configuration to check.

type Report

type Report struct {
	Version     string  `json:"version"`
	OS          string  `json:"os"`
	Arch        string  `json:"arch"`
	RuntimeRoot string  `json:"runtime_root"`
	ConfigPath  string  `json:"config_path,omitempty"`
	Checks      []Check `json:"checks"`
}

Report is the result of a doctor run: the version, the platform, the runtime root and configuration path, and every Check.

func Run

func Run(ctx context.Context, opts Options) Report

Run performs the checks (the runtime directories and the configuration, the model and the credential of the provider, and the tools the runtime relies on, git and uv) and returns the report.

func (Report) HasFailures

func (r Report) HasFailures() bool

HasFailures reports whether any check of the report has failed. Warnings do not count.

type Status

type Status string

Status is the outcome of a check: ok, warn, fail or skipped.

const (
	StatusOK      Status = "ok"
	StatusWarn    Status = "warn"
	StatusFail    Status = "fail"
	StatusSkipped Status = "skipped"
)

Jump to

Keyboard shortcuts

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