Render a Mermaid diagram from the CLI
Render Mermaid diagrams directly in your terminal with one npx command. No headless browser, no Chromium download, zero dependencies.
npx @crafter/mermaid-cli diagram.mmdThat renders the diagram in your terminal with ANSI colors and Unicode box drawing. No headless browser, no Chromium download: the whole engine is 30.5KB.
From stdin
echo "graph TD; A-->B-->C" | npx @crafter/mermaid-cliPick a theme
npx @crafter/mermaid-cli --theme tokyo-night diagram.mmd
npx @crafter/mermaid-cli --list-themes # 30 availableOptions
| Flag | Description |
|---|---|
--theme <name> | Theme name (default: one-hunter) |
--width <n> | Terminal width (default: auto-detect) |
--compact | Compact spacing |
--list-themes | List all 30 themes |
Install permanently
npm install -g @crafter/mermaid-cli
crafter-mermaid diagram.mmdHow is this different from @mermaid-js/mermaid-cli?
The official @mermaid-js/mermaid-cli renders by launching a headless Chromium via Puppeteer, a heavyweight install that doesn't work in many CI/sandbox environments. @crafter/mermaid-cli uses @crafter/mermaid, a from-scratch rendering engine with zero dependencies and a synchronous API, so it runs anywhere Node runs, instantly.
Need SVG output instead of terminal rendering? Use the library directly:
import { render } from "@crafter/mermaid"
const svg = render("graph TD; A-->B")skillkit: observability for AI agent skills
Local-first observability for AI agent skills. Track usage, measure cost, detect trigger conflicts, monitor context budget, and prune skills you don't use.
Transcribe a YouTube video from the command line
Download and transcribe any YouTube video (or local audio/video file) to text, SRT subtitles, and JSON with one command, using a local Whisper model. Free, private, no API key.