Module

doctor

Built-in diagnostic command for CLI health checks.

Classes

Check 4
A single diagnostic check.

A single diagnostic check.

Attributes

Name Type Description
name str
status str
message str
suggestion str
DoctorReport 4
Aggregated diagnostic report.

Aggregated diagnostic report.

Attributes

Name Type Description
checks tuple[Check, ...]
ok int
warnings int
failures int

Functions

run_doctor 5 DoctorReport
Run all diagnostic checks and return a report.
def run_doctor(cli: CLI, *, config_spec: ConfigSpec | None = None, required_env: tuple[str, ...] = (), required_tools: tuple[str, ...] = (), custom_checks: tuple[Any, ...] = ()) -> DoctorReport
Parameters
Name Type Description
cli CLI

The CLI instance to diagnose.

config_spec ConfigSpec | None

If provided, check that config files exist.

Default:None
required_env tuple[str, ...]

Environment variables that must be set.

Default:()
required_tools tuple[str, ...]

External binaries that must be on PATH.

Default:()
custom_checks tuple[Any, ...]

Callables that return Check instances.

Default:()
Returns
DoctorReport
format_doctor_report 2 str
Format a doctor report for terminal display.
def format_doctor_report(report: DoctorReport, *, color: bool = True) -> str
Parameters
Name Type Description
report DoctorReport
color bool Default:True
Returns
str