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, with mermaid-cli (mmdc) for 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-mermaidThe mmdc path handles compatible output, default PNG generation, and Auto fallback. It requires:
24.14.0 recommended for local development)mermaid-clinpm install -g @mermaid-js/mermaid-cli
Browser-backed SVG preview and Copy Image use Chrome/Chromium directly; they do not themselves require a global mmdc or Node.js installation. Ondine is bundled and compiles SVG locally, but its preview/copy and opt-in Auto PNG still require a browser. Install the compatible requirements above as well to keep Auto's mmdc fallback available.
Browser resolution order 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; supported development versions are Node 24.14+ or 22.14+ within those major versions. Node 20 is no longer supported by the current toolchain..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.scripts/ondine-spike/..gitignore controls Git tracking, not the contents copied by every publishing CLI. Inspect a separate submission directory with an explicit file inventory; never publish directly from a development directory containing ignored working data.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 unsupportedUse Ondine in Auto is enabled~/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): preserves Beautiful SVG routing and compatible fallback; the optional Ondine route is described belowBeautiful: forces beautiful-mermaid SVG outputCompatible: forces mmdcOndine Experimental (SVG Only): forces Ondine SVG output, with no automatic fallback; PNG is rejectedUse Ondine in Auto: default off; applies to the manual command only
mmdc; source with embedded configuration bypasses OndineCompatible Theme: theme for mmdc rendering only
mmdc is the actual renderer, including compatible PNG and Auto/AI fallbackBeautiful Theme: theme for Beautiful and Ondine
Custom beautiful-mermaid Path: optional package root or direct ESM entry file to prefer over global/bundled resolutionGeneration Timeout: timeout for compatible rendering and the Ondine PNG browser subprocess
Compatible Scale: raster scale for mmdc
4mmdc is the actual rendererSave Path: default save locationCustom mmdc Path: custom executable path if Raycast cannot find mmdcUse Ondine in Auto off or unset, PNG uses mmdc and the existing Auto routes are unchangedmmdc; existing Beautiful families still use mmdc for PNGAI 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-betaWith the Ondine opt-in off, other families use compatible mode in Auto.
Ondine is pinned to 0.0.3. The manual command's Auto opt-in considers these additional entry points:
mindmap, timeline, journey, gantt, pie, gitGraphquadrantChart, sankey-beta, block-beta, packet-betakanban, architecture-beta, requirementDiagram, C4Contextradar-beta, treemap-beta, infoThis is an entry-point allowlist, not a promise of full Mermaid feature parity. Unsupported syntax or render failures fall back to mmdc in Auto. Use Compatible for the closest Mermaid CLI behavior.
Explicit Ondine also accepts supported Beautiful-family entry points, but always produces SVG and never falls back. Embedded theme settings may not be honored in explicit mode; the result warns about detected theme directives. Auto bypasses embedded configuration instead.
Ondine preview and Copy Image use browser-backed rasterization. Auto PNG uses the same browser path at 3×, capped at 4096 px on the longest edge. Very large diagrams are scaled down. Result metadata shows the actual renderer, package version, and theme. ASCII preview remains a separate Beautiful feature.
mmdc SVG output use browser-backed preview/copy to avoid missing Chinese labels, incorrect fills, or missing lines in native SVG rasterization. The saved SVG and Copy SVG Code retain the SVG output.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:
Review and commit the intended source changes yourself, then prepare a clean submission directory without development evidence, local worktrees, dependency folders, or .DS_Store files. Do not rely on .gitignore as a publishing filter.
Follow Raycast's preparation requirements, including the latest API requirement. Review API upgrades explicitly and regenerate package-lock.json with npm rather than editing it by hand.
Keep README.md, CHANGELOG.md, and manifest preferences aligned. Keep the newest changelog heading on {PR_MERGE_DATE} until merge. Keep the Ondine opt-in default off and the AI route unchanged.
Retain the Ondine and Pele MIT notices when distributing their bundled code.
Replace outdated Store screenshots using Raycast Window Capture: 2000 × 1250 px PNG, one consistent background, no personal data or unrelated apps/commands. Put Store screenshots in metadata/, runtime files in assets/, and any README-linked images in top-level media/.
Run the checks below. A build validates distribution but does not publish:
npm run verify
node --test scripts/ondine-spike/phase-2-*.test.mjs
Test the distribution build in Raycast and record actual results:
linkStyle arrows, sequence, and xychart-beta linesReview the actual archive size and independently installed execution. Publishing is a separate action: npm run publish authenticates with GitHub and creates or updates a Store pull request. Do not use it as a local validation command.
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
beautiful-mermaid@mermaid-js/mermaid-cliMIT