Termaid
Mermaid diagrams in your terminal
I was building a source code examination tool: it would read your codebase with AI and generate Mermaid diagrams of it, so you could zoom around different codebases and actually build a mental model of the code. I needed it to show those diagrams without leaving the terminal, and Mermaid is everywhere, but every renderer needs a browser and there was no native Python library you could just import. So I wrote one.
I never finished the examination tool. But we still had Termaid, and it grew more than I expected: it now renders 18 diagram types, from flowcharts and sequence diagrams to git graphs and mindmaps, all as Unicode text art.
The fun part was doing graph layout without a browser. Termaid parses the Mermaid syntax, places nodes on a grid using a barycenter heuristic (each node drifts toward the average position of its neighbors until the graph untangles itself), then routes every arrow with A* pathfinding so edges take clean right-angle turns instead of crashing through boxes. It also auto-fits diagrams to your terminal width, compacting them progressively when space gets tight.
It’s pure Python with zero dependencies. If you have Rich installed you get colors and themes, and there’s a Textual widget if you’re building a TUI, but plain print() works fine too.

The playground at termaid.com runs the actual package in your browser through Pyodide, a full CPython interpreter compiled to WebAssembly. Your browser downloads Python, imports termaid, and prints boxes made of text. We live in the future. Here’s the pipeline, drawn by termaid itself:
┌───────────────────────┐
│ Mermaid source │
└───────────┬───────────┘
▼
┌───────────────────────┐
│ Pyodide (CPython on │
│ WebAssembly) │
└───────────┬───────────┘
▼
┌───────────────────────┐
│ termaid layout │
│ engine │
└───────────┬───────────┘
▼
┌───────────────────────┐
│ Unicode art in your │
│ browser │
└───────────────────────┘No mockups involved: what you see in the playground is exactly what your terminal will print.
Try it with pip install termaid or uvx termaid. Source on GitHub.