Mermaid CLI
Mermaid CLI processes diagrams inside Markdown, creating SVG files and replacing diagram blocks with references to the images.
- 5,158 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- The CLI runs a renderer and writes images or converted Markdown; remote icon packs can be downloaded from configured URLs.
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/mermaid-cliDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The CLI runs a renderer and writes images or converted Markdown; remote icon packs can be downloaded from configured URLs.
This is third-party code. Review the repository files before installing.
What it does
Mermaid CLI reads a diagram definition and renders an image or PDF. An agent can write the source, run `mmdc` and inspect the output before adding it to documentation. Theme, background and selected styling options are configurable. Basic Markdown conversion renders Mermaid blocks into SVG and inserts image references. Versioned text sources support repeatable rendering as diagrams change.
Who it is for. Technical writers maintaining architecture and sequence diagrams as text beside documentation.
Good fit when
- An agent has finished a Mermaid definition, and you save it as a documentation image.
- A technical writer applies one theme to several project diagrams.
- Readers use a Markdown viewer without Mermaid support, so diagrams are rendered to SVG first.
- CI regenerates diagram images after their text sources change.
Not a fit when
- You need a canvas editor with manual object positioning.
- The environment cannot run the browser renderer.
- Every diagram type must produce exact PNG dimensions without inspection.
Example request
Render this Mermaid diagram to a separate SVG output and check that labels are not clipped.Limitations
The current manifest requires Node.js 22.13 or later; verify the selected package release before installing. Rendering uses a browser environment, which may need extra system dependencies on servers. Size settings do not behave identically for every diagram type, so inspect the produced file. Markdown conversion writes a document and adjacent SVGs; use separate output paths to preserve the original source blocks.
How to disable. Remove mmdc from build scripts and stop rendering. Mermaid sources and generated images remain as separate files.
FAQ
How do I create SVG?
Use `mmdc -i input.mmd -o output.svg` with your filenames. The command reads the definition and writes an SVG to the output path.
Can I make a transparent PNG?
Yes. Use the documented `-b transparent` option with PNG output.
Where are the flags listed?
Run `mmdc -h`.
Should I use the old Homebrew package?
That method is no longer supported and can provide an old version; use the primary npm route.
Can input come from stdin?
Yes. `--input -` reads a definition from standard input instead of a file, including text passed by another command.
Discussion
No questions or reviews yet.
Related
CLI toolsAn MCP server that generates mermaid diagrams and charts with syntax validation and svg, png and file export
A skill that draws validated architecture, workflow, sequence and data-flow diagrams as one interactive HTML file
Marp CLI rebuilds slides when Markdown or a theme changes, so authors can review the output while editing their text.
The official draw.io MCP server: an agent builds diagrams from XML or Mermaid and opens them in the draw.io editor
Markdy
markdy-com
Animated diagrams as code: text turns into a step-by-step explanation of architecture. A library, a CLI and an MCP server, HTML output
Smart Drawio
Smart Drawio Next
An MCP server and skill for editable draw.io diagrams: an agent generates XML from a prompt, validates references, repairs tags and applies themes
README in short
Custom CSS and icon packs are supported. Site content policies can affect inline styling in generated SVGs.