Page
Library
Module
Module type
Parameter
Class
Class type
Source
doctor checks a local OCaml development environment. It reports missing tools, suspicious opam state, and editor setup issues; it does not modify switches, shell files, or editor settings.
It currently checks platform details, core tool versions, opam initialization state, active and available switches, whether the resolved ocaml appears to match the active switch, selected opam packages, and the VS Code OCaml Platform extension when code is available.
opam update
opam install doctorTo build from a checkout:
git clone https://github.com/funwithcthulhu/doctor
cd doctor
opam install . --deps-only --with-test
opam exec -- dune buildFor local testing through opam, use a path pin:
opam pin add doctor . -y --kind=pathdoctor check
doctor check --json
doctor version
doctor --helpdoctor check prints a text report:
$ doctor check
OCaml Doctor
[OK] platform detected: macOS
[OK] opam found: 2.2.1
[OK] OCaml found: 5.2.0
[OK] dune found: 3.17.0
[OK] OCaml LSP found: 1.19.0 (ocamllsp)
[WARN] ocamlformat not installed
Suggested fix: opam install ocamlformat
[OK] active switch: 5.2.0
[WARN] VS Code OCaml Platform extension not detected
Suggested fix: Install extension ocamllabs.ocaml-platform in VS Code.
Summary: 6 OK, 2 WARN, 0 ERRORUse --json when another program needs to read the report:
$ doctor check --json
{
"summary": {
"status": "warn",
"exit_code": 1
},
"diagnostics": [
{
"name": "command.ocamlformat",
"status": "warn",
"message": "ocamlformat not installed",
"details": ["Suggested fix: opam install ocamlformat"]
}
]
}doctor version prints:
doctor 0.2.00: no warnings or errors1: one or more warnings, no errors2: one or more errors3: unexpected internal failureopam install . --deps-only --with-test
opam exec -- dune build
opam exec -- dune runtest
opam exec -- dune exec doctor -- checkTests fake process execution, so they do not depend on the host opam setup, VS Code, or a particular shell.
Maintainer release notes are in RELEASE.md.