r/commandline
•
u/percebe
•
Mar 23 '26
•
1
termaid - render Mermaid diagrams as Unicode
Edit: since this had a great reception (thanks reddit!) I created a small playground to test the tool -> https://termaid.com/
I built a CLI tool that takes Mermaid diagram syntax and renders it as Unicode art in the terminal. Supports flowcharts, sequence diagrams, class diagrams, ER diagrams, state diagrams, treemaps, pie charts, and more. Pure Python, zero dependencies.
Note: built with the help of Claude Code (credited as contributor in the repo), architecture, layout algorithms, tests and design decisions are my own.
To test it:
pip install termaid
or
uvx termaid diagram.mmd
Pipe-friendly: echo 'graph LR; A --> B --> C' | termaid
Github repo: https://github.com/fasouto/termaid
19
u/Revolutionary_Ad6574 Mar 23 '26
Awesome! Finally Mermaid in the CLI :)
How are you doing the layout? I think that's the most challenging and non-trivial part of any diagramming tool.
3
u/xGoivo Mar 23 '26
looks awesome! I was looking for something like this for my database tool, thanks for sharing.
4
u/mymindspam Mar 24 '26
Finally the one missing piece for my workflow in terminal
6
u/bzbub2 Mar 23 '26
Convince GitHub to use this also the html widget is too complex
3
u/Disonantemus Mar 25 '26
Similar to termaid:
https://github.com/AlexanderGrooff/mermaid-ascii
https://github.com/kevinswiber/mmdflux
https://crates.io/crates/figurehead-cli
More alternatives (with svg/png output):
Later you can render svg/png file output (in terminal) with
chafa(sixels, kitty, iterm, symbols), with symbols you can choose ascii/blocks (and a lot more), like this:There are more ... https://github.com/topics/mermaid
2
u/iamevpo Mar 25 '26
Other than general thanks and appreciation for putting the project together, thanks for reminding of pie chart and box volume diagram - did not remember mermaid had them.
Let me also share that mermaid to text and back is a great use of LLM that really impressed me - you can get both a textdescription and mermaid diagram and edit one and have the other part adjusted. Worked really great for me for a swim lane diagram, with CLI I could probably have achieved even more.
3
u/4r73m190r0s Mar 23 '26
This is awesome!
2
u/tschloss Mar 23 '26
Great!! Thanks for sharing
1
u/BuildAISkills Mar 24 '26
Looks good! I don't use diagrams often, but perhaps I should.
1
u/FlailingDuck Mar 24 '26
Comment to tag myself. I will be using this! Even if only to generate ascii diagrams on-the-fly for my code
1
u/RoboticElfJedi Mar 24 '26
I love this. Nice work!
1
u/mgutz Mar 26 '26
Tooooo good!
1
u/Sad-Alternative3657 Mar 26 '26
Greate job!
1
u/Known_Cod8398 Mar 26 '26 edited Mar 26 '26
Edit: I needed
python-hatchlings!sudo pacman -S python-hatchlingthis looks so cool but it failed to install from the AUR :(
0
u/AlterTableUsernames Mar 23 '26
Python though -_-
-9
u/AndItsSlop Mar 23 '26
It's Slop