doctor

package
v0.50.0 Latest Latest
Warning

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

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

Documentation

Overview

Package doctor checks that the Claude Code plugin and the f10 binary are present, agree with each other and are wired into their environment. Every check reads and 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 a problem in a check every command needs: a scoped problem affects only the commands it names, and a not-needed check 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 one never stops the rest.

Jump to

Keyboard shortcuts

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