[ANN] doctor 0.3.0: read-only OCaml environment diagnostics

Hi,

I released doctor 0.3.0.

doctor is a small read-only CLI for checking a local OCaml development environment. It reports common setup issues around opam, switches, PATH, dune, ocaml-lsp-server, ocamlformat, and the VS Code OCaml Platform extension.

Install:

opam update
opam install doctor

Basic use:

doctor check
doctor check --json

The 0.3.0 release focuses on opam switch environment diagnostics. In particular, it tries to distinguish missing tools from cases where opam has an active switch but the current shell has not loaded that switch environment.

For example, it can report when ocaml resolves outside the active switch, or when installed switch tools such as dune, ocamllsp, or ocamlformat are missing from PATH.

The command does not run opam init, create switches, install packages, or edit shell/editor files. It only reports what it sees and suggests commands to run manually.

JSON output is intended for editor integrations or small scripts that want stable diagnostic names and exit-code mapping.

Repository:

opam package:

Feedback on confusing diagnostics or missing common setup cases would be useful.

Thanks!

Given this tool looks at the global opam state as well as per-switch information, you can also activate flags: plugin to turn it into an opam plugin (and install a opam-doctor binary in the package). This will allow users to type in opam doctor and it’ll install the package automatically.

This is a great idea. Thanks!

Just for reference note that there is an issue for an opam doctor in opam with mentions of “interesting” setup failures.

There are however a few shortcomings of having this a seperate install, perhaps you could try to sync with upstream to see if they want to integrate your work.