pi-mermaid-viewer
v1.0.1
Published
Render Mermaid diagrams from Pi user and assistant messages in the TUI
Downloads
370
Maintainers
Readme
pi-mermaid-viewer
Render Mermaid fenced code blocks from Pi user input and assistant output as ASCII diagrams in the TUI.
Install
pi install npm:pi-mermaid-viewerThen restart Pi or run:
/reloadUsage
Write or ask for a Mermaid fenced block:
```mermaid
flowchart TD
A[User input] --> B{Contains Mermaid?}
B -->|Yes| C[Render ASCII diagram]
B -->|No| D[Continue normally]
```The extension automatically renders diagrams from:
- user input
- assistant output
No slash command is registered.
Supported diagram types
graph/flowchartsequenceDiagramclassDiagramerDiagramstateDiagram/stateDiagram-v2
Behavior
- Shows full diagrams by default.
- Chooses tighter ASCII layouts for narrow terminals.
- Clips lines that still exceed terminal width.
- Expanding the rendered message shows the original Mermaid source.
- Large inputs are guarded with block, line, and character limits.
Dependencies
beautiful-mermaidfor ASCII renderingmermaidfor syntax validation when available
License
MIT
