Signing back into the Community for the first time? You'll need to reset your password to access your account. Find out more.
Forum Discussion
Former Member
3 years agoHow can I use CLI in a GNU Makefile?
I'd like to set a GNU Make variable as an OP CLI session so that make commands can use 1Password. Any ideas? I know that I can set it as an environment variable before using make. I'm curious if ther...
MrC
3 years agoSuper Contributor
Alternatively, you can set a Make variable, set as an export, and it will be available for use in sub-shells created by Make. Pass the --session option to your commands to refer to it.
```
export OPTOKEN := $(shell op signin --raw --account https://my.1password.com)
all:
op --session $$OPTOKEN item list --format json
```