ocp-index is designed as a simple and light-weight documentation extractor for OCaml, for command-line use or integrated in other tools (e.g. for completion). It gathers information from .cmi (à la ocamlbrowser) and .cmt/cmti files, including structure, location, type, and ocamldoc comments when available.


ocp-index on GithubLatest sources in the official GIT repository


ocp-index COMMAND params OPTIONS




make install

See below to compile and install the optional ocp-browser.

Other tools

Emacs mode

A script ocp-index.el is included under tools/, and can be used together with tuareg-mode or ocaml-mode and auto-complete (packaged as auto-complete-el in Debian) to get completions and types in a popup menu.

You can run the script tools/emacs-setup.sh to get hints on the configuration of emacs for ocp-index (it won't modify any files). Adding the following line to your .emacs:

(load-file "<OPAM_ROOT>/share/typerex/ocp-index/ocp-index.el")

Will give you:

See M-x customize ocp-index for more options.


A small ncurses-based browser based on ocp-index is also included. You will need ocaml-curses installed to build it:

$ opam install curses
$ ocp-build ocp-browser
$ ocp-build install ocp-browser