potto compares .env against .env.example, points at the keys you forgot, and fixes them on the way out. Run it locally, in CI, or as a pre-commit hook.
$ potto check โ missing in .env โโ DATABASE_URL (declared in .env.example:3) โโ STRIPE_WEBHOOK_SECRET (declared in .env.example:7) โฐโ SENTRY_DSN (declared in .env.example:12) # 3 keys drifted. your teammate will thank you. $ potto sync โ .env.example updated (+3 keys, atomic write) $ echo "exit $?" exit 0
real output ยท captured on a 47-key project
01 ยท the drift problem
A teammate adds STRIPE_WEBHOOK_SECRET locally, ships the feature, forgets to document it. Three days later, your CI is green and your staging is on fire. potto catches that drift before the commit lands.
DATABASE_URL=postgres://localhost/app PORT=3000 # three keys quietly missing...
DATABASE_URL=postgres://localhost/app PORT=3000 STRIPE_WEBHOOK_SECRET= SENTRY_DSN= REDIS_URL=
02 ยท why potto
Four things potto is good at โ and nothing else.
03 ยท three commands
Reports keys in .env.example missing from .env. Exit 1 on drift โ CI-friendly.
$ potto check โ 3 missing
Appends missing keys to .env.example atomically. Preserves comments and order.
$ potto sync โ +3 keys
Shows keys in either file that are missing from the other. Read-only, no writes.
$ potto compare # 2โ 1โ
04 ยท install
Static binary, no runtime, no surprises. Works on Linux, macOS, and Windows.
cargo install potto
rust
brew install iamkorun/tap/potto
macos
curl -fsSL https://iamkorun.github.io/potto/install.sh | sh
linux
docker run --rm -v $PWD:/w ghcr.io/iamkorun/potto check
ci
name: env-drift on: [pull_request] jobs: check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: cargo install potto - run: potto check --quiet
repos: - repo: local hooks: - id: potto name: sync .env.example entry: potto check language: system pass_filenames: false
05 ยท ship it
Put potto in your pre-commit hook. Forget about .env.example forever.