Turn any directed graph into colored ASCII art for your terminal
Maintained. Last release 9 months ago, commits in 1 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install graphttygraphtty
Turn any directed graph into colored ASCII art for your terminal. Pure Python, zero external dependencies.
Installation
pip install graphtty
Deep Agent (ocean theme)
Supervisor Agent (dracula theme)
More examples available in the
screenshots/directory.
Quick start
from graphtty import render
graph = {
"nodes": [
{"id": "start", "name": "User Input", "type": "entry"},
{"id": "router", "name": "Router", "type": "condition"},
{"id": "search", "name": "Web Search", "type": "tool"},
{"id": "calc", "name": "Calculator", "type": "tool"},
{"id": "respond", "name": "Respond", "type": "model"},
],
"edges": [
{"source": "start", "target": "router"},
{"source": "router", "target": "search", "label": "search"},
{"source": "router", "target": "calc", "label": "calc"},
{"source": "search", "target": "respond"},
{"source": "calc", "target": "respond"},
],
}
print(render(graph))
┌ entry ─────┐
│ User Input │
└─────┬──────┘
│
▼
┌ condition ──┐
│ Router │
└──────┬──────┘
┌search─└──calc───┐
▼ ▼
┌ tool ──────┐ ┌ tool ──────┐
│ Web Search │ │ Calculator │
└──────┬─────┘ └──────┬─────┘
└───────┌─────────┘
▼
┌ model ──┐
│ Respond │
└─────────┘
Nodes support descriptions and nested subgraphs:
# Descriptions appear as extra lines inside the box
{"id": "a", "name": "LLM", "type": "model", "description": "gpt-4o"}
# Nested subgraphs render as boxes within boxes
{"id": "b", "name": "Pipeline", "type": "subgraph", "subgraph": {"nodes": [...], "edges": [...]}}