Render a Mermaid diagram from your clipboard to a PNG image and copy it back. Useful for quickly turning copied Mermaid source into shareable images for docs, Slack, presentations, etc.
macOS only — uses pbpaste and osascript for clipboard access.
brew install mermaid-cliDownload mermaid-clip.sh and put it somewhere on your $PATH:
cp mermaid-clip.sh /usr/local/bin/mermaid-clip
chmod +x /usr/local/bin/mermaid-clipWorks from any shell (bash, zsh, fish, etc.).
- Download
mermaid-clip.raycast.shinto your Raycast Script Commands directory - Make it executable:
chmod +x mermaid-clip.raycast.sh - Search "Mermaid to Clipboard" in Raycast
The Raycast script uses the full Homebrew path (
/opt/homebrew/bin/mmdc) since Raycast doesn't inherit your shell's$PATH. If you installed Homebrew to a non-default location, update the path accordingly.
- Copy Mermaid text to your clipboard (e.g.
graph LR; A-->B) - Run
mermaid-clip - Paste the rendered PNG image wherever you need it
-s, --size SIZE Render size: small (1x), medium (2x, default), large (4x)
-t, --theme THEME Mermaid theme: default, dark, forest, neutral
-h, --help Show help
mermaid-clip # medium size, default theme
mermaid-clip -s large # 4x resolution for print/retina
mermaid-clip -t dark # dark theme
mermaid-clip -s small -t neutral # small, neutral themeThe Raycast script exposes size and theme as dropdown arguments.
- Outputs PNG with a transparent background, ideal for pasting into slides and docs
- Default scale is 2x for a good balance of quality and file size
- Uses a temporary directory for the rendered image, cleaned up automatically on exit