This is a CLI for syncing environment variables using 1password and provisioning files. Each environment (e.g staging or production) is stored in a separate section of an item in the 1password vault. Uses .provision files as templates for the environment files.
brew install alexanderflink/envop/envop
To install locally in a project:
npm install envop --save-dev
Or globally:
npm install envop -g
cargo install envop
Download the latest release, unpack the appropriate binary for your system and point to it in your $PATH.
- Fill out your environment file with your secrets (envop looks for .env as default).
- Run
envop up
, if your environment file is named something other than .env, you can pass it as an argument:--env FILE_PATH
- Select appropriate 1password vault, item and section (or use the prompt to create a new item and section)
- Select which variables you want to upload. Only new or updated variables will show up.
- You will be asked if you also want to write to a provision file. The provision file will be named whatever the name of the section you chose was.
- Make sure you have at least one .provision file
- Run
envop down
, if your environment file is named something other than .env, you can pass it as an argument:--env FILE_PATH
- Select the provision file you'd like to use.