Install
openclaw skills install @jarekbird/mermaidGenerate and render diagrams from Mermaid syntax into PNG, SVG, or PDF using customizable themes and various diagram types.
openclaw skills install @jarekbird/mermaidGenerate diagrams from text using Mermaid.
@mermaid-js/mermaid-cli (npm install -g @mermaid-js/mermaid-cli).mmd filemmdc to render PNG/SVGmmdc -i input.mmd -o output.png -t dark -b transparent
| Flag | Description |
|---|---|
-i | Input .mmd file |
-o | Output file (.png, .svg, .pdf) |
-t | Theme: default, dark, forest, neutral |
-b | Background color (transparent, hex) |
-w | Width in pixels (default: 800) |
-H | Height in pixels |
-s | Scale factor (default: 1, use 2-3 for high-res) |
-c | Config JSON file for advanced theming |
graph TD / graph LRsequenceDiagramclassDiagramstateDiagram-v2erDiagramganttpiemindmaptimelinegitGraphquadrantChartblock-beta.mmd file to /tmp/mermaid-<name>.mmdmmdc -i /tmp/mermaid-<name>.mmd -o /tmp/mermaid-<name>.png -t dark -b transparent -s 2Read toolgraph LR for left-to-right flow, graph TD for top-down-t dark -b transparent-s 2 or -s 3 for sharp images on retina displayspty: false when calling mmdcFor custom colors, create a config JSON:
{
"theme": "base",
"themeVariables": {
"primaryColor": "#f59e0b",
"primaryTextColor": "#1a1a1a",
"primaryBorderColor": "#d97706",
"lineColor": "#6b7280",
"secondaryColor": "#10b981",
"tertiaryColor": "#3b82f6"
}
}
Then: mmdc -i input.mmd -o output.png -c config.json