Skip to content

Conversation

@johncoopertr
Copy link

@johncoopertr johncoopertr commented Nov 11, 2025

Humbly submitting this for review for #1071 as a possible solution, thanks for taking a look!

Global updatekeys feature

The --global flag lets you synchronize key groups (and Shamir threshold, if set) across all SOPS‑managed files in a repository based on .sops.yaml creation rules.

What it does

  • Walks from the directory containing the config (or .) and inspects files.
  • Considers a file only if:
    • It contains SOPS metadata (sops section), and
    • A creation rule matches its path.
  • Silently ignores files without metadata or without a matching rule.
  • Compares the file’s current key groups (and effective Shamir threshold) to the rule.
  • Updates only those files where a difference exists.

Dry run

Use --dry-run with --global to list files that would change without modifying them.

sops updatekeys --global --dry-run

Sample output:

Files that would be updated:
  secrets/app.yaml
  prod/creds.enc.json

Typical usage

# Preview changes
sops updatekeys --global --dry-run

# Apply changes non-interactively
sops updatekeys --global -y

Flags

  • --global scan and update all managed files
  • --dry-run show pending updates only
  • -y / --yes skip per‑file confirmation

Notes

  • Errors reading individual files are summarized at the end.
  • Unchanged files are skipped quietly.

@johncoopertr johncoopertr changed the title possible solution for #1071 [feature] possible solution for #1071 Nov 11, 2025
@johncoopertr johncoopertr changed the title [feature] possible solution for #1071 [Feature] possible solution for #1071 Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant