Purpose
doctor checks renderer candidates without rendering a document.
Input and output
The command accepts no input. Text or JSON output goes to stdout; command failures go to stderr. The JSON envelope is described from the same versioned schema that ships with Margo, so this page does not duplicate the output contract:
Margo doctor report v1
The JSON envelope emitted by margo doctor --diagnostics json.
buildobject requiredIdentity of the Margo binary that produced the report.
archstring requiredTarget architecture.
commitstring requiredSource commit used to build the binary.
goVersionstring requiredGo toolchain identity.
osstring requiredTarget operating system.
versionstring requiredMargo release or development version.
candidatesarray requiredPDF engine candidates in deterministic discovery order.
*availableboolean requiredWhether the candidate can be selected for rendering.
codestringStable diagnostic code when discovery or probing failed.
compiledboolean requiredWhether this candidate is compiled into the binary.
namestring requiredEngine name.
pathstringExecutable path when the candidate is external.
reasonstringHuman-readable discovery or probe explanation.
sourcestring requiredHow the candidate was discovered.
- Constraints
enum=["flag","environment","path","known-location","native"]
versionstringDetected executable version.
See the doctor report schema reference for the full tree and its other consumers.
Examples
margo doctor
margo doctor --diagnostics json > build/margo-doctor.json
Failures and diagnostics
Read available, not merely the presence of a row. A missing known path can
appear with pdf.engine_path_invalid; the native slot can appear with
pdf.native.compiled_out. Invalid flags or diagnostic formats exit 1 and
write the command failure to stderr.
doctor can exit 0 while listing only unavailable candidates, because the
report itself was produced successfully.
Limitations and care
Discovery follows automatic PDF selection: explicit path where applicable,
MARGO_CHROMIUM_PATH, PATH and known locations in platform order, then the
native slot. doctor does not download, install, or launch a document render.
It cannot guarantee that a later document-specific export will succeed.