op run command doesn't have environmental variables

JeroenVdb
JeroenVdb
Community Member
edited March 25 in CLI

I created a simple case where I have an .env file that should provide an env. variable to the provided command with as value the 1Password secret + run the command with the env. variable available. But the value is just empty.

When I read the value it works perfectly.

$ op --version                                                                                                                                    
2.26.1

$ cat prod.env
TESTING_VAR="op://Development/Foo/credential"

$ op read "op://Development/Foo/credential"
Bar

$ op run --env-file=prod.env -- echo "Output: $TESTING_VAR"
Output: 

1Password Version: 8.10.28
Extension Version: Not Provided
OS Version: Not Provided
Browser: Not Provided

This discussion has been closed.