Generate sleek network topology diagrams with AI Agent and YAML
Use Claude Code or another AI Agent to read network configuration files (YAML) and drive a Python script to render styled SVG/PNG network topology diagrams. The AI iteratively refines the layout and design details to generate a sanitized architecture diagram ready for public sharing.
GitHubGoblinmine867GitHub stars
Claude CodePythonPyYAMLPillowlibrsvg (rsvg-convert)
Added 2026-11-12 · originally published 2026-11-07
Steps
- 1Set up the environment: Install Python 3 (with PyYAML and Pillow), rsvg-convert, and Fira Sans and Fira Code fonts.
- 2Run the icon download script to fetch service icons into the icons/ directory: python3 fetch_icons.py
- 3Clone the repository and open it with Claude Code, then input the prompt to rewrite inventory.yaml based on your network setup and adjust the layout coordinates in build.py.
- 4Run the rendering script to generate the sanitized network topology diagram: python3 build.py
- 5To view the private version containing real IPs and domains, run: python3 build.py --unredacted
Ideas for Chinese platforms
This approach can be adapted for tech and homelab content on platforms like Xiaohongshu or WeChat Official Accounts, using AI to quickly transform complex home server setups or private cloud topologies into visually stunning design diagrams for sharing.
Copy-ready prompt
Please help me create a network topology diagram in the style of r/homelab. My network settings are recorded in [my document path/Obsidian notes]. Please read these documents, combine them with the actual network data I provided (such as VLANs, devices, ports, link speeds, containers, etc.), and help me rewrite inventory.yaml and modify the Python rendering script. During the rendering and review loop, make sure link thicknesses represent link speeds, and handle data sanitization (hiding real domains and SSIDs) for me.
#AI Agent#Network Topology#Python#Claude Code
Related use cases
Summarized by AI from the original source - refer to the original post for details. Copyright belongs to the original author.