Utility to manage dotenv files on 1Password
- A 1Password account
- 1Password CLI (https://support.1password.com/command-line-getting-started/)
- Change the following script variables according to your situation:
export DOTENVOP_VAULT=<VAULT_NAME>
export DOTENVOP_ACCOUNT=<1P Account name | default "my">
export DOTENVOP_EMAIL=<EMAIL>
- Place the script in:
/usr/local/bin/dotenv-op
cp dotenv-op.sh /usr/local/bin/dotenv-op
dotenv-op get -p project-name -e production
dotenv-op create -p project-name -e production -f .env.production
dotenv-op edit -p project-name -e production -f .env.production
This will download the existing document on 1Password and open your favorite editor to edit it
dotenv-op edit-inline -p project-name -e production
This will download the existing document on 1Password and compare it with your local version
dotenv-op compare -p project-name -e production -f .env.production