A Raycast extension that converts Mermaid syntax from selected text or the clipboard into shareable PNG and SVG diagrams.
beautiful-mermaid for supported SVG diagrams, mermaid-cli (mmdc) for PNG and compatibility fallbackCopy SVG Code actionbeautiful-mermaid syntaxcmd+yIf you use:
Render Engine = Auto or BeautifulOutput Format = SVGbeautiful-mermaid syntaxthe extension works without installing anything else.
For some SVG preview and Copy Image cases that need browser-backed raster fidelity, the extension may still ask to download a managed browser later. This mainly affects diagrams whose SVG output is known to render incorrectly through the macOS raster path, such as sequenceDiagram.
If you want to override the bundled beautiful-mermaid, the extension resolves sources in this order:
Custom beautiful-mermaid Pathbeautiful-mermaidFor these cases the extension uses mermaid-cli (mmdc), so you still need:
24.14.0 recommended for local development)mermaid-clinpm install -g @mermaid-js/mermaid-cli
Browser resolution order for compatible rendering is:
PUPPETEER_EXECUTABLE_PATHCHROME_PATHSafari is not supported for compatible rendering. The mmdc / Puppeteer path requires a Chromium-based browser such as Google Chrome, Chromium, Chrome Canary, or the managed chrome-headless-shell downloaded by the extension.
If no browser is available and your current request needs mmdc or browser-backed SVG rasterization, the manual command will show a setup screen and offer Download Browser. The managed browser stays local to the extension and is reused for future compatible renders and high-fidelity SVG preview/copy cases.
beautiful-mermaidIf you want the extension to prefer your local installation instead of the bundled version:
npm install -g beautiful-mermaid
24.14.0.nvmrc and package.json.engines to make the supported Node range explicit.23.x can trigger install-time engine warnings from the toolchain even when the extension code itself is fine.docs/ is intentionally local-only and excluded from git tracking; it is not part of extension publish artifacts.nvm use
npm install
npm run dev
Mermaid to Image in Raycast.Copy ImageCopy SVG Code for SVG outputSave ImageOpen in Default AppImage and ASCII in the left sidebar when the Mermaid syntax is supported by beautiful-mermaidQuick Look with cmd+y for wide diagramsUse @mermaid-to-image in Raycast AI to generate a diagram from a description.
Current AI tool behavior:
beautiful-mermaid for supported Mermaid syntax and saves an SVGCompatible (mmdc) and saves a PNG when the syntax is unsupported~/Downloads/MermaidDiagrams/Download BrowserThe AI tool returns a short success message with a Preview link. It does not embed the image inline in chat.
Successful AI responses also include the actual renderer used: Renderer: beautiful or Renderer: mmdc.
Output Format
SVG is the default and works best with Auto (Hybrid)PNGRender Engine
Auto (Hybrid): uses beautiful-mermaid for supported SVG diagrams and falls back to mmdc when neededBeautiful: forces beautiful-mermaidCompatible: forces mmdcCompatible Theme: theme for mmdc rendering only
PNG, Compatible mode, AI tool fallback output, and Auto fallbackBeautiful Theme: theme for beautiful-mermaid
beautiful-mermaid is the actual renderer, typically Auto + SVG + supported syntax or Beautifulbeautiful-mermaid versionCustom beautiful-mermaid Path: optional package root or direct ESM entry file to prefer over global/bundled resolutionGeneration Timeout: timeout for compatible renderingCompatible Scale: raster scale for mmdc
4PNG, AI tool fallback output, and Auto fallbackbeautiful-mermaid SVG outputSave Path: default save locationCustom mmdc Path: custom executable path if Raycast cannot find mmdcPNG always uses mmdcAI tool uses beautiful-mermaid for supported syntax and falls back to mmdc for unsupported syntaxAuto + SVG + supported syntax tries beautiful-mermaid firstbeautiful-mermaid fails in Auto, the extension falls back to mmdcBeautiful mode does not auto-fallback for unsupported syntaxmmdc always uses a resolved browser path, preferring the user environment and otherwise a managed local browserCopy Image, based on the final SVG structure rather than Mermaid syntax alonebeautiful-mermaid Syntaxbeautiful-mermaid is currently used for these Mermaid entry points:
graphflowchartstateDiagramstateDiagram-v2sequenceDiagramclassDiagramerDiagramxychart-betaEverything else is routed to compatible mode in Auto.
Copy Image for SVG copies a high-resolution image representation, not raw SVG text.sequenceDiagram, use a browser-backed raster path because the macOS rasterizers drop arrowheads or other fidelity details.linkStyle arrow markers also use browser-backed rasterization because the macOS SVG rasterizers can drop the colored arrowheads while keeping the edge lines.xychart-beta line charts also use browser-backed rasterization because the macOS SVG rasterizers can drop the connecting lines while keeping the dots.Copy SVG Code is available when you need the original markup.Quick Look (cmd+y).beautiful-mermaid.Image or ASCII from the left sidebar.beautiful-mermaid or mmdc.beautiful-mermaid install is found, the extension falls back to the bundled version and shows a one-time notice with the bundled version number.beautiful-mermaid supports classDiagram, but some complex or legacy class member forms may render differently than mmdc.
If you need the most compatible class diagram rendering, use:
Render Engine = Compatible, orRender Engine = Auto with PNG~/Downloads/MermaidDiagrams/SVG for supported hybrid output and PNG for compatibility fallbackBefore publishing to the Raycast Store:
README.md, CHANGELOG.md, and package.json metadata aligned on hybrid rendering, browser-backed rasterization, and Download Browser wording.{PR_MERGE_DATE} until the PR is merged.npm run verify
Auto + SVG + flowchartAuto + SVG + flowchart with custom linkStyle arrow colorsAuto + SVG + xychart-beta line chartsequenceDiagram browser setup prompt and retry flowRenderer: beautiful)Renderer: mmdc)flowchart TD
A[Start] --> B{Continue?}
B -->|Yes| C[Do Work]
C --> D[Done]
B -->|No| E[Stop]
sequenceDiagram
participant User
participant API
participant DB
User->>API: Request profile
API->>DB: Query user
DB-->>API: User data
API-->>User: Response
classDiagram
class Animal {
+String species
+speak() void
}
class Dog {
+bark() void
}
Animal <|-- Dog
No input found
mermaid-cli not found
npm install -g @mermaid-js/mermaid-cli, or set Custom mmdc Path.Chrome/Chromium not found
Mermaid to Image, then choose Download Browser from the setup screen.mmdc requires a Chromium-based browser.Sequence diagram preview or copy is missing arrows
Download Browser once from the manual command.Flowchart linkStyle colors are present but arrowheads are missing
Download Browser once from the manual command.xychart-beta line charts show only dots without connecting lines
Download Browser once from the manual command.Beautiful mode failed
beautiful-mermaid. Switch to Auto or Compatible.Selection failed
MIT