@tifan/pi-mermaid-open
extensionmaintainedFind skipped Mermaid diagrams and show them in a terminal image viewer.
by — · v0.2.1 · published 1w ago
$ pi install npm:@tifan/pi-mermaid-opendownloads/mo
0
stars
22
last push
1w ago
open issues
2
Signals
license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0
Download trend
No downloads in the last 12 weeks.
README
@tifan/pi-mermaid-open
Find Mermaid diagrams that Pi left unrendered and show one in a terminal image viewer.
https://github.com/user-attachments/assets/8be5b7cf-fc21-4979-a245-4ba0984360de
How it works
- Scans assistant messages in the current branch for
```mermaidand```mmdfences. - Hides diagrams that Pi already rendered and labels skipped diagrams by reason.
- Renders diagrams as 4x PNGs with
@mermaid-js/mermaid-cli. - Uses a non-blocking Herdr overlay with Kitty graphics when available.
- Uses Pi's image viewer in other TUI sessions.
- Saves PNGs under
<agent-dir>/artifacts/mermaid/outside TUI mode. - In Herdr, use
+/=and-to zoom,h/j/k/lor the arrow keys to pan,0to reset, and Enter or Escape to close.
Install
pi install npm:@tifan/pi-mermaid-open
Requirements
- Bun is optional. The extension uses
bunx -y @mermaid-js/mermaid-cliwhen Bun is available and falls back tonpx -y @mermaid-js/mermaid-cli. - Herdr with Kitty graphics support is optional. In a compatible Herdr TUI session,
/mermaid-openautomatically links the bundled Herdr plugin, so you do not need to install it separately. Other TUI sessions use Pi's image viewer. - Network access on first use unless Mermaid CLI is already cached.
- A Chromium browser available to Puppeteer. The extension skips Puppeteer's automatic browser download, so Puppeteer must find an existing cache or configured browser executable.
Commands
/mermaid-open: Pick a Mermaid diagram from recent assistant messages, render it, and open the PNG.
Release notes
See CHANGELOG.md