Dyagram now ships as a standalone Python CLI that scans a Google Cloud project and renders an architecture diagram. There is no web UI.
- Authenticates to GCP with a read-only service account key (Cloud Asset Viewer).
- Discovers resources via Cloud Asset Inventory, builds a graph, and renders PNG/SVG diagrams with the
diagramslibrary. - Saves everything locally under
./tmp/dyagram/<project-id>by default.
- Python 3.10+
- Graphviz installed and on your
PATH(required by thediagramslibrary)- macOS:
brew install graphviz - Debian/Ubuntu:
sudo apt-get install graphviz
- macOS:
- Service account JSON key with Cloud Asset Viewer (and any other read-only scopes you need for Asset Inventory).
cd apps/backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtpython -m src.cli --project-id YOUR_PROJECT_ID --sa-key-file /path/to/key.json --output-dir ./tmp/dyagramArguments:
--project-id(required): GCP project ID to scan.--sa-key-file(required): Path to the service account JSON key.--output-dir(optional): Directory for generated files. Defaults to./tmp/dyagram.
Outputs (per project):
graph.json— discovered resources and relationshipsdiagram.png— rendered architecture PNGdiagram.svg— rendered architecture SVG
- Authenticates with the provided service account key (
src/google_auth.py). - Scans resources via Cloud Asset Inventory (
src/scanner.py). - Builds a graph and renders diagrams via the
diagramslibrary (src/renderer.py). - Writes all artifacts under the chosen
output-dir.
- Ensure Graphviz binaries are installed and on
PATH(required bydiagrams). - Verify the service account has Cloud Asset Viewer on the target project.
- If Asset Inventory APIs are disabled, enable them in the project and retry.
- No frontend is included; interaction is via the CLI.
- You can change the output directory with
--output-diror by moving the generated files as needed.