# using the default config and default context, export all namespaces into ./setdrift-export
# Using kubeconfig foo, use context prod, export namespaces payments and checkout only, into ./out
setdrift export --kubeconfig ~/foo --context prod -n payments -n checkout -o ./out
# Choose where the snapshot goes: a named file, or a directory
# default format: ./setdrift-export/snapshots/<time>-<cluster>.pb and .json --no-snapshot for none)
setdrift export --snapshot ~/snapshots/ --snapshot-json prod.json
# Only export the resources that are not identified as being managed, e.g. no helm indicators
# Resolve false positives from CI/CD pipelines by stamping the setdrift.io/source-*
# annotations on what each pipeline deploys: see
# https://setdrift.io/docs/cli/source-annotations/, e.g. setdrift.io/source-repo: github.com/setdrift/setdrift-engine
setdrift export -o ./out --unmanaged-only
# Choose the secret manager the ExternalSecrets read from (auto, generic, aws-secrets-manager, aws-parameter-store or none), the store's name and the remote key names: see https://setdrift.io/docs/cli/secrets/#secret-managers. On Azure Key Vault or Google Secret Manager, set a key template without slashes
setdrift export -o ./out --external-secrets aws-parameter-store \
--secret-store params --secret-key-template '/prod/{{.Namespace}}/{{.Name}}'
# On EKS, also read the settings held in AWS (Pod Identity, IRSA role trust, access entries, add-ons, EBS volume details) for RESTORE.md; read-only
setdrift export -o ./out --aws
# Offline Mode: read manifests from a directory instead of a cluster
setdrift export --from-dir ./manifests --cluster-name test -o ./out
# Check the export: its platform set on a cluster of the same platform, else
# the generic set (--set generic|platform to choose). Writes a Markdown and
# JSON report to ./out/verify/ (-o for another directory, --no-report for none)
setdrift verify ./out -o ./verify-reports --threshold 100
# Compare two clusters, can be two context names for default kubeconfig. two directories
# ./staging ./prod, or two snapshots *-prod.pb *-staging.pb
setdrift diff staging prod
# Compare a cluster with an earlier snapshot of itself
setdrift diff ./out/snapshots/2026-11-16T090000Z-prod.pb prod # what changed since Monday
# what differs, who manages it on each side
setdrift diff staging prod --map-namespace shop-staging=shop --exit-code
# differences in a cluster's own values
setdrift diff prod prod --map-namespace shop=shop-canary # two namespaces of one cluster
# Inspect a snapshot (the .json beside each .pb is the same, written by export)
setdrift snapshot json ./out/snapshots/2026-11-16T090000Z-prod.pb