doctor

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package doctor checks that the two halves of an f10 install - the Claude Code plugin and the f10 binary - are present, agree with each other, and are wired into the environment they run in. Every check reads; none writes, so `f10 doctor` is always safe to run.

Index

Constants

View Source
const (
	CheckVersion    = "version"
	CheckScripts    = "scripts"
	CheckHooks      = "hooks"
	CheckStatusline = "statusline"
	CheckHerdr      = "herdr"
	CheckHost       = "host"
	CheckProject    = "project"
)

Check names, in the order Run reports them.

View Source
const (
	StatusOK        = "ok"
	StatusProblem   = "problem"
	StatusNotNeeded = "not_needed" // the check does not apply here; it never fails the run
)

The three outcomes of a check.

Variables

This section is empty.

Functions

func Failed

func Failed(results []Result) bool

Failed reports whether any check that every command needs has a problem. A scoped problem affects only the commands it names, and a check that is not needed here never fails.

Types

type Env

type Env struct {
	ClaudeDir string // CLAUDE_CONFIG_DIR or ~/.claude
	Home      string // the statusline symlink lives under ~/.claude/f10 whatever ClaudeDir is
	Layout    *layout.Layout
	Probes    *probe.Probes
	Facts     *facts.Effective
	Version   string // the binary's, as `f10 --version` prints it

	Getenv   func(string) string
	LookPath func(string) (string, error)
	Run      func(ctx context.Context, dir, name string, args ...string) (shell.Result, error)
}

Env is everything the checks read from outside, so a test can hand them a temp directory and fakes instead of the real home and PATH.

type Result

type Result struct {
	Name   string   `json:"name"`
	Status string   `json:"status"`
	Scope  []string `json:"scope"`  // what a problem affects (commands, or the badge); empty means every command
	Detail string   `json:"detail"` // the evidence, one line
	Remedy string   `json:"remedy"` // empty unless the status is problem
}

A Result is one check's answer.

func Run

func Run(ctx context.Context, env *Env) []Result

Run runs every check in a fixed order; a failing check never stops the ones after it.

Jump to

Keyboard shortcuts

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