Skip to content

Command Line Interface

The MDNMan CLI allows developers to quickly access and explore the MDN Web Docs reference library directly from the command line. This tool is ideal for looking up JavaScript, HTML, and CSS documentation without leaving your terminal.

These commands search the MDN reference documentation for JavaScript (js), HTML (html), or CSS (css) topics, respectively. Each command accepts the same set of options and returns relevant documentation entries based on the search query provided.

Option NameAliasDefault ValueDescription
--output-ostdoutSpecifies the format in which to return the MDN documentation. Supported formats include stdout, file, and vim.
--section-snoneLimits the result to a specific section of the documentation (e.g., syntax, examples, specifications).
--path-p./ref.mdWrites the output to the specified file path instead of displaying it in the terminal. Useful for saving documentation locally.
--help-hnoneDisplays help information and usage details for the selected command.
Terminal window
mdnman js foreach
mdnman html div --output file --path my/custom/path
mdnman css font-family --output vim --section syntax

Launches an interactive mode that lets you search and browse the MDN reference library through a guided, prompt-based interface.

Option NameAliasDefault ValueDescription
--output-ostdoutSpecifies the format in which to return the MDN documentation. Supported formats include pager, stdout, file, and vim.
--path-p./ref.mdWrites the output to the specified file path instead of displaying it in the terminal. Useful for saving documentation locally.
--help-hnoneDisplays help information and usage details for the selected command.
Terminal window
mdnman interactive --output file --path my/custom/path