CLI tool to sync .env files with 1Password
pnpm add -g @kurechon/op-env-sync
op-env-sync push
op-env-sync pull
# Specify vault (default: "Private")
op-env-sync push --vault MyVault
# Specify item suffix
op-env-sync push --suffix ".local"
# Generate .env.example.generated file with keys only
op-env-sync push --example
op-env-sync pull --example
- 1Password CLI installed
- Signed in to 1Password CLI
eval $(op signin)
The .env file will be stored in 1Password with the following format:
- Item Type: Secure Note
- Item Name:
[current-directory-name].local .env
- With suffix option:
[current-directory-name] .env<suffix>
- With suffix option:
- Field Name:
env
MIT