Mermaid CLI Diagram-as-Code Renderer
Mermaid CLI (mmdc) is the command-line interface for the Mermaid diagramming library. It converts text-based diagram definitions into SVG, PNG, and PDF output files, enabling automated diagram generation from code.
Installation
Use the upstream install or setup path that matches your environment:
- npm install -g @mermaid-js/mermaid-cli
Use Docker/Podman:
- docker pull minlag/mermaid-cli
- docker pull ghcr.io/mermaid-js/mermaid-cli/mermaid-cli
Requirements and caveats from upstream:
Basic usage or getting-started notes:
sh
Convert Mermaid mmd Diagram File To SVG
mmdc -i input.mmd -o output.svg
Extracted from upstream docs: https://raw.githubusercontent.com/mermaid-js/mermaid-cli/HEAD/README.md