Skip to main content

flux-topology

skills.sh

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)
viz [dir] [--out FILE] [--domain NAME] [--app ID] [--type TYPE] [--open] [--json] Interactive HTML visualization of the topology graph

[dir] defaults to .. A directory is resolved to its flux/ subdirectory when present; otherwise the directory itself is treated as the flux root.

Optional visualization dependency

The viz subcommand requires the visualization extra:

pip install "flux-topology[render]"

This includes vendored vis-network JavaScript for rendering interactive graphs. All other commands work without this extra.

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

# Interactive visualization (requires render extra)
flux-topology viz
flux-topology viz --domain apps
flux-topology viz --app apps/backend --open
flux-topology viz --type dns-ref --json

How it works

  1. Discovers apps by walking flux/ and finding ownership signals (HelmReleases, Kustomizations, Deployments, Services)
  2. Extracts workloads, services, ingress hosts, and refs per app
  3. Resolves edges between apps from cross-references
  4. 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-card auto-build once and then answer normally. check-freshness instead reports NO 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 just build (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

Metadata

Release files for flux-topology 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flux-topology 0.3.6
File Size Uploaded Provenance Actions
flux_topology-0.3.6.tar.gz 249.7 kB With provenance Details for flux_topology-0.3.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flux-topology 0.3.6
File Interpreter ABI Platform Actions
flux_topology-0.3.6-py3-none-any.whl Python 3 none any Details for flux_topology-0.3.6-py3-none-any.whl

Total release size: 472.1 kB

Release files / flux_topology-0.3.6.tar.gz

Download URL flux_topology-0.3.6.tar.gz
Size 249.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c9f8ef335eaf4b9af6e3b88ffac430d46562462b1e9ef6e4b4330c4886318ff4
BLAKE2b-256 checksum
How to use checksums
09f3d154a060840bb79e09aab46edb9443c949dc1ca72d0ef3efe1434d146541
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 2, 2026.

Transparency log

Release files / flux_topology-0.3.6-py3-none-any.whl

Download URL flux_topology-0.3.6-py3-none-any.whl
Size 222.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b54ceb18281b9d7d2a1877849358fe68a444c474d012b41899d16e2a72712d96
BLAKE2b-256 checksum
How to use checksums
de9a6004726e45f337953b0e5390e51d47ee9da719aa6c9c951b871086d7fc3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 2, 2026.

Transparency log

Security for flux-topology 0.3.6

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for flux_topology-0.3.6.tar.gz

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 Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page