<h1 align="center"termaid</h1
<p align="center"Render Mermaid diagrams in your terminal or Python app.</p
<p align="center" <img src="termaid-demo.gif" alt="termaid demo" width="800" </p
Try it online at termaid.com
Features
- 18 diagram types: flowcharts, sequence, class, ER, state, block, git, gantt, architecture, pie, treemap, mindmap, timeline, kanban, quadrant, XY chart, user journey, and packet
- Zero dependencies: pure Python, nothing to install beyond the package itself
- Terminal-aware: auto-fits diagrams to terminal width with progressive compaction
- Rich and Textual integration: colored output and TUI widgets with optional extras
- 6 color themes: default, terra, neon, mono, amber, phosphor
- ASCII fallback: works on any terminal, even the most basic ones
- Pipe-friendly CLI: cat diagram.mmd | termaid just works
Why?
Mermaid is great for documentation, but rendering it usually means spinning up a browser or calling an external service. termaid lets you render diagrams over SSH, in CI logs, inside TUI apps, or anywhere you have a Python environment. It was built because the existing tools in this space, like mermaid-ascii (Go) and beautiful-mermaid (TypeScript), don't offer a native Python library you can import and call directly.
Install
pip install termaidOr try it without installing:
uvx termaid diagram.mmdQuick start
CLI
termaid diagram.mmd
echo "graph LR; A-->B-->C" | termaid
termaid diagram.mmd --theme neon
termaid diagram.mmd --asciiPython
from termaid import render
print(render("graph LR\n A --> B --> C"))