SOPS wrapper that automatically sets AWS_PROFILE based on KMS keys. Stop remembering which profile to use.
brew install jhubbardsf/sopsx/sopsx
# Which profile was it again?
AWS_PROFILE=dev-admin sops -d dev/secrets.enc.yaml
AWS_PROFILE=staging-admin sops -d staging/secrets.enc.yaml
AWS_PROFILE=prod-readonly sops -d prod/secrets.enc.yaml
# Wrong profile? Start over...
# Profile auto-detected from KMS ARN
sopsx -d dev/secrets.enc.yaml
sopsx -d staging/secrets.enc.yaml
sopsx -d prod/secrets.enc.yaml
# It just works.
Configure sopsx as a git textconv and see actual changes instead of encrypted noise.
$ git diff secrets.enc.yaml
diff --git a/secrets.enc.yaml
-api_key: ENC[AES256_GCM,data:x8kP...
-db_pass: ENC[AES256_GCM,data:9mNq...
+api_key: ENC[AES256_GCM,data:7jLw...
+db_pass: ENC[AES256_GCM,data:4xRt...
# What actually changed? No idea.
$ git diff secrets.enc.yaml
diff --git a/secrets.enc.yaml
-api_key: sk-live-old-key-abc123
-db_pass: hunter2
+api_key: sk-live-new-key-xyz789
+db_pass: correct-horse-battery
# Ah, API key rotated. Makes sense.
~/.gitconfig: [diff "sopsdiffer"] textconv = sopsx -d
Extracts KMS ARN from encrypted files or .sops.yaml config automatically
Prioritizes higher-privilege roles when multiple profiles match the account
Works as a textconv for git diff, showing decrypted content in diffs