Install
Be productive in under a minute
Install once, preview with dry-run, then apply only when you explicitly confirm.
gh extension install Nick2bad4u/gh-secret-sync
GitHub CLI extension
gh-secret-sync helps you safely
bulk-update GitHub secrets across repository,
environment, and organization targets with dry-run
previews, explicit confirmation, JSON summaries, and
plan-file support (JSON/CSV).
--dry-run safety model--secret-value-prompt and
stdin--jsonInstall
Install once, preview with dry-run, then apply only when you explicitly confirm.
gh extension install Nick2bad4u/gh-secret-sync
Requirements
gh installed and authenticated>= 22.18.0Features
No secret updates happen unless you opt in with
--confirm or --yes.
Apply to repository, environment, or organization secrets with simple CLI flags.
Use --plan-file with JSON or CSV
for predictable, reviewable batch updates.
Use prompt, stdin, env vars, or files instead of exposing inline values in command history.
Parse machine-readable summaries from
--json
for workflows, scripts, and tooling.
Exit code 2 indicates partial
failure so automation can detect and react.
Usage
gh secret-sync --repo owner/repo --secret-name API_KEY --secret-value-env API_KEY --confirm
gh secret-sync --repos owner/a,owner/b --secret-name API_KEY --secret-value-prompt --confirm
gh secret-sync --repo owner/repo --env production --secret-name API_KEY --secret-value-env API_KEY --confirm
gh secret-sync --org my-org --secret-name SHARED --secret-value-env SHARED --org-visibility private --confirm
Plan files
| Plan type | Example |
|---|---|
| JSON plan file | --plan-file
./docs/examples/secret-plan.example.json |
| CSV plan file | --plan-file
./docs/examples/secret-plan.example.csv
--plan-format csv |
| Repo list + multiple secrets | --repo-file repos.txt --set
TOKEN=... --set-env
URL=DEPLOY_URL |
| Input safety | --secret-value-prompt,
--secret-value-stdin,
--secret-value-file |
JSON mode
gh secret-sync \
--plan-file ./docs/examples/secret-plan.example.json \
--confirm \
--json
{
"applied": 3,
"dryRun": false,
"durationMs": 168,
"failed": 0,
"results": [
{ "ok": true, "secretName": "API_KEY", "target": "repo:owner/repo-a" },
{ "ok": true, "secretName": "API_KEY", "target": "repo:owner/repo-b env:production" },
{ "ok": true, "secretName": "SHARED", "target": "org:my-org" }
],
"total": 3
}
Start with a dry run, confirm only what you intend, and automate the rest with JSON summaries and plan files.