Flux CLI
$ flux Foundation High RiskFlux CLI (flux) operates Flux v2 GitOps controllers on Kubernetes, providing cluster pre-flight verification (flux check), dry-run diffing (flux diff kustomization), --export declarative YAML generation, and reconciliation controls.
brew install fluxcd/tap/flux flux diff and flux check inspect local manifests against live Kubernetes clusters directly using ~/.kube/config.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports flux diff and --export cleanly, but flux get emits tabular text rather than native -o json.
- Supports
flux diffand--export; lacks universal-o jsononget
--export promotes pure declarative GitOps commits and flux diff performs safe server-side dry-run previews.
--exportavoids imperative cluster writes;flux diffis read-only
Single static Go binary via Homebrew tap or official releases across macOS, Linux, and Windows.
- Single Go binary via
brew install fluxcd/tap/flux
Streamlines Flux CRD authoring, diffing, and reconciliation triggers.
- Dedicated tooling for Flux v2 CRDs and reconciliation
CNCF graduated project (fluxcd/flux2) maintained under Apache-2.0.
- Official CNCF
fluxcd/flux2repository
Detailed fluxcd.io/flux/cmd/ reference and --help.
- Official docs at fluxcd.io/flux/cmd/
Security, Auth & Guardrails
Reads cluster access from ~/.kube/config (KUBECONFIG); bootstrap commands optionally read GITHUB_TOKEN or GITLAB_TOKEN.
100% open-source (Apache-2.0); reconciled workloads consume cluster resources.
# Flux CLI Agent Rules - Always pass `--context` and `-n <namespace>` explicitly on Flux commands. - Prefer `--export` to generate Git-tracked YAML rather than mutating clusters imperatively. - Run `flux diff kustomization` before committing or reconciling changes; pair with `kubectl get ... -o json` when JSON is needed.
Agent-Ready Command Recipes
Safe Read-Only Queries
flux check
Verifies Kubernetes version compatibility and Flux controller health without mutating state.
flux diff kustomization my-app --path=./clusters/prod
Previews server-side apply differences between local Git manifests and cluster resources.
Controlled Writes & Previews
--export flux create source git my-repo --url=https://github.com/org/repo --branch=main --export
Emits declarative YAML to stdout for Git commit instead of mutating the cluster directly.
Strengths for Agents
- +
--exportoutputs clean GitOps YAML instead of mutating live clusters. - +
flux diff kustomizationcomputes accurate server-side dry-run diffs. - + Fast single Go binary with explicit
--contextand--namespaceflags.
Caveats & Pitfalls
- ! Lacks
-o jsononflux get; usekubectl get kustomizations -o jsonfor JSON output. - !
flux bootstraprequiresGITHUB_TOKENor SSH keys and writes commits to Git.