@tifan/pi-mermaid-open
Extract and open Mermaid diagrams from pi agent responses.
Package details
Install @tifan/pi-mermaid-open from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@tifan/pi-mermaid-open- Package
@tifan/pi-mermaid-open- Version
0.1.1- Published
- May 17, 2026
- Downloads
- not available
- Author
- tifan
- License
- MIT
- Types
- extension
- Size
- 10 KB
- Dependencies
- 0 dependencies · 0 peers
Pi manifest JSON
{
"extensions": [
"./mermaid-open.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@tifan/pi-mermaid-open
Extract Mermaid diagrams from recent pi assistant messages, render them to SVG, and open them in the system viewer.
Scans the last 50 assistant messages for ```mermaid (or mmd) fences. If more than one diagram is found, a picker shows the message offset, diagram type, and title. Rendering uses @mermaid-js/mermaid-cli via bunx. SVGs are written under <agent-dir>/artifacts/mermaid/ and opened with open (macOS), xdg-open (Linux), or start (Windows).
Install
pi install npm:@tifan/pi-mermaid-open
Commands
/mermaid-open: Pick a Mermaid diagram from recent assistant messages, render it, and open the SVG.