Skip to content
Margo dev

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.

  • build object required

    Identity of the Margo binary that produced the report.

    • arch string required

      Target architecture.

    • commit string required

      Source commit used to build the binary.

    • goVersion string required

      Go toolchain identity.

    • os string required

      Target operating system.

    • version string required

      Margo release or development version.

  • candidates array required

    PDF engine candidates in deterministic discovery order.

    • *
      • available boolean required

        Whether the candidate can be selected for rendering.

      • code string

        Stable diagnostic code when discovery or probing failed.

      • compiled boolean required

        Whether this candidate is compiled into the binary.

      • name string required

        Engine name.

      • path string

        Executable path when the candidate is external.

      • reason string

        Human-readable discovery or probe explanation.

      • source string required

        How the candidate was discovered.

        Constraints
        enum=["flag","environment","path","known-location","native"]
      • version string

        Detected executable version.

See the doctor report schema reference for the full tree and its other consumers.

Examples

sh
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.