Convert a Mermaid text file into a PNG or SVG image for use in documentation or presentations.
Process a Markdown file containing diagram code blocks and replace each one with an actual image reference.
Add automatic diagram generation to a CI pipeline or documentation build workflow.
Call the Node.js API to render Mermaid diagrams from inside another JavaScript program.
Some Linux environments hit a browser sandboxing issue, a documented workaround is provided in the README.
Mermaid is a system where you write plain-text descriptions of diagrams, like flowcharts or sequence diagrams, and the tool draws the actual visual for you. This repository, mermaid-cli, is a command-line companion that converts those text description files into image files you can use elsewhere. You give it an input file containing your diagram text, and it produces a PNG, SVG, or PDF output file. A one-line command covers the basic case: point it at your input file, tell it where to write the output, and it handles the rest. You can also control the visual theme (for example, a dark background) and whether the background is transparent. If you have a Markdown document that contains diagram code blocks, you can run the whole file through the tool and it will replace each diagram block with an actual image reference. Installation options are flexible. The most common route is installing it globally through npm, the standard JavaScript package manager. A Docker container image is also available if you prefer not to install anything on your machine directly. There is also a Node.js API if you want to call it from inside another JavaScript program, though that API does not follow the same version stability guarantees as the command-line tool itself. The tool uses a browser engine in the background to render the diagrams, which is why some Linux environments run into a sandboxing issue during setup. The README links to a documented workaround for that. On most machines the setup is straightforward, and the tool is well-suited for automation pipelines where diagrams need to be generated as part of a build or documentation workflow.
← mermaid-js on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.