Your code reads STRIPE_KEY. Your .env.example forgot it, and so did the repo's GitHub Secrets. You find out when the deploy fails at 2 a.m.
keyparity checks that every environment variable your code uses is listed in .env.example and set as a GitHub Secret, and flags the ones nobody uses any more. It reads secret names only, never values.
With Node 20 or later, run it without installing:
npx keyparity auditOr download a single-file binary for your system from the latest release. On an Apple Silicon Mac:
curl -fsSLo keyparity https://github.com/keyparity/keyparity/releases/download/v0.1.2/keyparity-darwin-arm64
gh attestation verify keyparity --repo keyparity/keyparity
chmod +x keyparity && mv keyparity /usr/local/bin/There are also builds for Intel Macs, Linux (x64 and arm64) and Windows. Each file is listed in SHA256SUMS and has a build attestation. Checking secrets needs the GitHub CLI, signed in.
keyparity audit # check this repo against .env.example and its GitHub secrets
keyparity audit --strict # exit 1 if anything is missing: put this in CI
keyparity generate-template # print a .env.example built from your codeHere's keyparity audit --skip-secrets on a small example project:
Local missing (1)
API_KEY src/index.ts:2 missing from .env.example
Unused (1)
OLD_FLAG not referenced
Synced, as far as checked (2)
DB_URL src/index.ts:1
DEPLOY_TOKEN .github/workflows/deploy.yml:5
2 synced, 0 CI missing, 1 local missing, 1 unused
GitHub secrets weren't checked.
It reads env vars from JavaScript and TypeScript (process.env, Bun.env, import.meta.env), Python (os.environ, os.getenv), Go (os.Getenv, os.LookupEnv), Rust (env::var), Ruby (ENV[], ENV.fetch) and GitHub Actions workflows (${{ secrets.NAME }}). Test files and fixtures are skipped unless you pass --include-tests. Run keyparity audit --help for every flag.
Issues and ideas are welcome. See CONTRIBUTING.md. To work on it locally, you need Bun:
bun install
bun test