doctor

package
v0.68.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"
	CheckRemote     = "remote"
	CheckHost       = "host"
	CheckDriver     = "driver"
	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
	Driver      *trackerdriver.Driver // the project's tracker driver; nil when it has none
	NeedsDriver bool                  // the tracker reads only through a driver, as Notion or Jira does

	Remote *RemoteState // the tailnet listener and the service; nil reads as both off

	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 RemoteState added in v0.62.0

type RemoteState struct {
	Enabled   bool
	Port      int
	MCP       bool   // MCP tools served on the listener at /mcp
	ConfigErr string // the setting does not read

	Tailnet string // this machine's Tailscale address; "" when Tailscale is down

	DaemonRunning bool
	Bound         string // the address the daemon listens on
	Reason        string // why it does not
	URL           string // the web client's address while bound
	HTTPSReason   string // why the listener serves plain HTTP

	ServiceFile      string // "" on a platform with no service
	ServiceInstalled bool
	ServiceProgram   string
	ProgramMissing   bool // the program the service runs is gone
}

RemoteState is what the remote check reads: the listener's setting, the Tailscale address, what the running daemon bound, and the service.

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