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)

[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

  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 cachemap/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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flux_topology-0.3.2.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flux_topology-0.3.2-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file flux_topology-0.3.2.tar.gz.

File metadata

  • Download URL: flux_topology-0.3.2.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for flux_topology-0.3.2.tar.gz
Algorithm Hash digest
SHA256 701a0c4958ce7383352bb5dcaf1a6ac9b66e710e6c966c780324019b9c24969d
MD5 bb7cb4c5e356ddb67c517821e0fe1b90
BLAKE2b-256 5e082a48cae215cc1b0920752c03ec4551a5e2e5bc38b366305617f55e9b00b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for flux_topology-0.3.2.tar.gz:

Publisher: release.yml on seppaleinen/flux-topology-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flux_topology-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: flux_topology-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for flux_topology-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 45aaefe9868d8c764dfc88a60edb7bf133c39745529085d28be2356a75d2875a
MD5 d35f82f34711858c814d6ab0f17e5d9e
BLAKE2b-256 8f55df90b04b16fb749e9aacb8c6da99fca38006c0693ae0bec131a2107b229a

See more details on using hashes here.

Provenance

The following attestation bundles were made for flux_topology-0.3.2-py3-none-any.whl:

Publisher: release.yml on seppaleinen/flux-topology-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 files

0.3.1

2 files

0.2.4

2 files

0.2.2

2 files

0.1.0

2 files

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