Make sure you have the op
command line tool installed:
brew install 1password-cli
Create a .env
file that includes your environment variables and the op
commands to retrieve them:
export BIG_VARIABLE=$(op item get "<Item name>" --fields <Field name> --vault <Vault name>)
Where <Item name>
, <Field name>
, and <Vault name>
correspond the the appropriate values in 1Password.
Source the file to load the variables into your environment:
source .env
Validate that everything worked:
echo $BIG_VARIABLE