# doctor

URL: /milo-cli/api/milo/doctor/
Section: milo
Description: Built-in diagnostic command for CLI health checks.

---

> For a complete page index, fetch /milo-cli/llms.txt.

Open LLM text
(/milo-cli/api/milo/doctor/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fdoctor%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fdoctor%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fdoctor%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fdoctor%2Findex.txt)

Module

#
`doctor`

Built-in diagnostic command for CLI health checks.

2Classes2Functions

## 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`
