The dcode doctor command: report install health and diagnostics.
Inspired by claude doctor, this prints a grouped, tree-style summary of the
running install, update status, and configuration locations so the output is
safe to paste into a bug report. It stays offline: the update section reads
only the local cache and never contacts PyPI.
Help rendering for dcode doctor -h is served by ui.show_doctor_help, which
does not import this module, so the help path stays light.
Write a JSON envelope to stdout and flush.
The envelope is a single-line JSON object with a stable schema:
{"schema_version": 1, "command": "...", "data": ...}Gather every diagnostic section in display order.
Run dcode doctor, printing diagnostics as text or JSON.