flux-topology
A CLI + agent skill that builds a dependency and topology graph of a Kubernetes/FluxCD GitOps repository by static analysis, so AI agents can reason about service relationships without cluster access.
Install
pip install flux-topology
Optional — install the agent skill from skills.sh:
npx skills add seppaleinen/flux-topology-mcp
No MCP server is required. Run the CLI from your GitOps repo root; it reads
from flux/ in the working directory.
Subcommands
| Command | Description |
|---|---|
build [dir] [--force] |
Build the topology cache (.fluxtop/) |
map [dir] [--json] |
Top-level view: domains, hub apps by edge count, warnings |
trace <app> [dir] [--direction out|in|both] [--depth N] [--json] |
BFS blast radius from any app with typed edges |
find-refs <pattern> [dir] [--json] |
Regex search for references across all apps |
app-card <app> [dir] [--json] |
Full card for one app: workloads, services, edges |
check-freshness [dir] [--json] |
Check if the topology cache is up to date (never rebuilds) |
[dir] defaults to .. A directory is resolved to its flux/ subdirectory
when present; otherwise the directory itself is treated as the flux root.
Exit codes
| Code | Meaning |
|---|---|
0 |
Found / fresh |
1 |
Stale, corrupt, not-found, or invalid input |
2 |
Usage error (argparse) |
3 |
No cache (check-freshness only) |
CLI examples
# Build the topology cache (.fluxtop/)
flux-topology build
# Rebuild even when the cache is fresh
flux-topology build --force
# Human-readable overview
flux-topology map
# Machine-readable output
flux-topology map --json
# Blast radius: what depends on this app? (depth 5)
flux-topology trace apps/backend --direction in
# Find every app referencing a shared resource
flux-topology find-refs "postgres-rw\.postgres\.svc\."
# Full card for one app
flux-topology app-card apps/radarr
# Freshness check (exit codes 0/1/3)
flux-topology check-freshness
How it works
- Discovers apps by walking
flux/and finding ownership signals (HelmReleases, Kustomizations, Deployments, Services) - Extracts workloads, services, ingress hosts, and refs per app
- Resolves edges between apps from cross-references
- Caches everything in
.fluxtop/— rebuilt only when source files change
Hybrid freshness
The cache is checked against a fingerprint of all YAML files on every query:
- No cache —
map/trace/find-refs/app-cardauto-build once and then answer normally.check-freshnessinstead reportsNO CACHE(exit 3) and never rebuilds. - Fresh — the cache matches the working tree; queries answer from it.
- Stale / corrupt — queries surface a notice and exit 1 without
rebuilding, so results are never silently outdated. Rebuild explicitly with
flux-topology build --force, or justbuild(which also rebuilds when the fingerprint no longer matches).
Deployment note (dotfiles env)
The always-on flux-topology MCP server was removed from the shared MCP list
in the user's dotfiles environment (Stow-managed). The tool is now used
on-demand via the CLI + skill. Re-push the rewritten skill via skills.sh.
Development
git clone https://github.com/seppaleinen/flux-topology-mcp.git
cd flux-topology-mcp
pip install -e ".[dev]"
pytest
License
MIT
Release files for flux-topology 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flux_topology-0.3.3.tar.gz | 45.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flux_topology-0.3.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 70.2 kB
Release files / flux_topology-0.3.3.tar.gz
| Download URL | flux_topology-0.3.3.tar.gz |
|---|---|
| Size | 45.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c7443d1fb70907a57649e222e3939623c911757b3dff633f506e9b919ae5f3b7
|
|
BLAKE2b-256 checksum How to use checksums |
79427925d68fb2064826505fbd8e2450b70d1095f1faad7d5f7d0a773ad01cd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / flux_topology-0.3.3-py3-none-any.whl
| Download URL | flux_topology-0.3.3-py3-none-any.whl |
|---|---|
| Size | 25.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e2c12e745dafa0554abddee477d47bc370d5bb4e76f9eb14419e44cb3c6bc4a
|
|
BLAKE2b-256 checksum How to use checksums |
fafcff2bb59b76268001aa4fdf6b3f5ddc8186aad3cfa1dc97a9d0da11d17228
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency log