Infrastructure diagrams from Compose, Kubernetes and Terraform, kept current in CI
flowgraph scan draws diagrams from the configuration you already have, and flowgraph sync keeps them in your README. What each one shows, and what it can't know.
Most repositories already describe their infrastructure: a Compose file for local development, Kubernetes manifests for the cluster, Terraform for the cloud. Those files are precise, reviewed and kept current, because the system breaks when they aren't. They're just hard to read as a picture.
flowgraph scan turns them into one, on your machine or in CI, and flowgraph sync keeps the picture in your README.

What it draws
| From | You get |
|---|---|
| Docker Compose | A node for each service with an icon from its image and its published ports. depends_on and links are arrows, named volumes are cylinders, and networks are groups. |
| Kubernetes manifests | Ingresses and their routes to Services, Services to the workloads they select, and the ConfigMaps, Secrets (names only, never values) and volume claims each workload uses. |
| Terraform | Each folder of .tf files, with a node for each resource and module and an arrow wherever one refers to another. |
| OpenAPI | The endpoints, grouped by tag, with a badge for each method. |
| CI pipelines | GitHub Actions, GitLab CI, Bitbucket Pipelines and Azure Pipelines: triggers, jobs and the order they run in. |
| SQL and Prisma | The data model as an ER diagram, from a schema or from the migrations replayed in order. |
Run it in a checkout to see what it finds:
npx flowgraph-cli@0.3.0 scan
npx flowgraph-cli@0.3.0 scan --only kubernetes --out docs/k8s.mmd
It needs no API key and makes no network request, and the same files always give the same diagram, byte for byte what the app's repository import draws.
Keep it in the README
List the diagrams in flowgraph.yml, mark where each goes in the README, and run flowgraph sync in CI after every push:
diagrams:
services: compose
cluster: kubernetes
cloud:
draw: terraform
folder: infra
When someone adds a service or a resource, the next push redraws that diagram and commits it. When nothing changed, nothing is rendered or committed.
What a configuration diagram can't know
These diagrams show what the files declare, which isn't always what runs:
- Compose often describes local development. A production setup may look different.
- A call over HTTP without a
depends_online has no arrow. The configuration doesn't mention it, so neither does the diagram. - Terraform is drawn from the code, not the state. The diagram shows your
.tffiles, not what exists in your cloud account today. - Kustomize overlays and Helm charts aren't drawn. Plain manifests are.
That makes them a reliable "what we declared" view. For the "why", pair them with a diagram you draw by hand, which sync can keep in the README too: see Diagrams you draw in Flowgraph Studio, now in your README.
The full setup for GitHub, GitLab, Bitbucket and Azure DevOps is in Keep README architecture diagrams up to date in CI.
More from the blog
- Edit Mermaid diagrams visually, inside VS CodeThe Flowgraph Studio extension now opens diagrams on the website's canvas inside VS Code. Drag, connect and restyle, and every change lands in your file as plain code.
- Your diagram's style now travels with its codeA new %% flowgraph-theme line keeps a Mermaid diagram's Flowgraph theme inside the file, so it looks the same in a repository, in VS Code, in CI and through the API.
- Connect Claude to Flowgraph Studio by signing inClaude, Claude Code, Cursor and VS Code can now connect to Flowgraph Studio's MCP server with its address alone. Approve the app once, revoke it whenever you like, and no API key changes hands.