This guide is the fastest path to set up git-env-vault and start using it safely.
Read this first. Then continue with:
- Workflows for real team/CI scenarios
- CLI Reference for full command options
If you only need to pull local .env files and start working:
- Install package
npm i -D git-env-vault- Initialize repo (once)
envvault init- Pull secrets
envvault pull --env devIf system sops is not installed, pull can use the JS backend fallback in many cases.
npm i -D git-env-vaultnpx git-env-vault@latest doctor
bunx git-env-vault@latest doctornpm i -g git-env-vault
envvault --versionInstall system sops + age if you need:
editsetgrantrevokeupdatekeysrotatepush
# macOS
brew install sops age
# Linux (Debian/Ubuntu)
sudo apt-get update && sudo apt-get install -y sops age
# Linux (Fedora/RHEL)
sudo dnf install -y sops age
# Linux (Arch)
sudo pacman -S --needed sops age# Windows
winget install --id Mozilla.SOPS -e
winget install --id FiloSottile.age -e# Linux/macOS
mkdir -p ~/.config/sops/age
age-keygen -o ~/.config/sops/age/keys.txt# Windows PowerShell
New-Item -ItemType Directory -Force "$env:APPDATA\\sops\\age" | Out-Null
age-keygen -o "$env:APPDATA\\sops\\age\\keys.txt"Use built-in checks:
envvault doctor
envvault setupenvvault initThis creates:
envvault.config.jsonenvvault.policy.json.sops.yamlsecrets/
Map each service to where decrypted .env should be written.
Example envvault.config.json:
{
"version": 1,
"secretsDir": "secrets",
"cryptoBackend": "auto",
"services": {
"api": { "envOutput": "apps/api/.env" },
"worker": { "envOutput": "apps/worker/.env" }
}
}envvault pull --env dev
envvault pull --env dev --service api --confirmPreview only:
envvault pull --env dev --service api --plan
envvault pull --env dev --service api --jsonenvvault diff --env dev --service apienvvault status --env devenvvault edit --env dev --service apienvvault set --env dev --service api DATABASE_URL=postgres://localhost:5432/appenvvault push --env dev --service api --dry-run
envvault push --env dev --service api --confirmIf .env files were changed directly and you want envvault config/schema to catch up:
envvault refresh --dry-run
envvault sync --dry-run
envvault refresh.gitignore helpers:
envvault gitignore check
envvault gitignore fixenvvault ci-verify --allow-unsignedci-verify also checks for uncommitted .env* changes in git status.
Use localProtection to preserve local-only keys (for example BOT_TOKEN) during pull and to prevent pushing them into encrypted secrets.
If schema generates a placeholder like __MISSING__, pull will not overwrite an existing local non-empty value with that placeholder.
This is useful when:
- new developers should see placeholders
- existing developers already have local working tokens
- CI receives real values from GitHub secrets
- Workflows for team/CI/admin examples
- CLI Reference for all flags
- Configuration for
localProtection,placeholderPolicy, and backend settings