doctor

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyFailed

func AnyFailed(results []Result) bool

AnyFailed reports whether any result is StatusFail.

Types

type Check

type Check struct {
	Name string
	Fn   func(ctx context.Context) Result
}

Check is a named diagnostic. Fn must be safe to call without network access; see ADR-018.

func DefaultChecks

func DefaultChecks(cfg config.Config) []Check

DefaultChecks returns the checks `nem doctor` runs against cfg.

type Result

type Result struct {
	Name        string
	Status      Status
	Detail      string // user-facing one-liner, e.g. "/usr/bin/sandbox-exec"
	Remediation string // optional: "run 'nem activate'"
}

Result is the outcome of a single check.

func CheckCatalog

func CheckCatalog(ctx context.Context, rc config.CatalogConfig) Result

CheckCatalog reports whether a catalog's on-disk state is sufficient to load packages offline (ADR-018); requires a pkgs/ subdir per the catalog reference.

func CheckNemHome

func CheckNemHome(ctx context.Context) Result

CheckNemHome verifies NEM_HOME can be created and written to.

func CheckProjectManifest

func CheckProjectManifest(ctx context.Context) Result

CheckProjectManifest parses nem.ver in the current working directory.

func CheckSandbox

func CheckSandbox(ctx context.Context) Result

CheckSandbox verifies the platform sandbox tool is on PATH (ADR-004).

func CheckShellIntegration

func CheckShellIntegration(ctx context.Context) Result

CheckShellIntegration reports whether the user's shell rc file contains the managed nem block. For bash, probes ~/.bashrc, ~/.bash_profile, and ~/.profile since the sourced file depends on interactive vs login mode.

func Run

func Run(ctx context.Context, checks []Check) []Result

Run invokes every check in order. Panics from a check are recovered and reported as StatusFail so a buggy check cannot break the diagnostic surface.

type Status

type Status int
const (
	StatusOK Status = iota
	StatusFail
	StatusSkip
)

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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