Saw a few other discussions previously on both topics, wanted to add my 2¢ about looking for similar functionality.
I'm using fish shell and in order to keep my session available across terminals I have a function that currently does the following:
if test -z "$OP_SESSION_accountname" if test -e ~/.config/op/session set -gx OP_SESSION_accountname (cat ~/.config/op/session) op get account > /dev/null 2>&1 else if test $status -ne 0 set cmd (op signin | sed '/#/d; s/export/set -gx/; s/=/ /; s/"//g') eval $cmd echo "$OP_SESSION_accountname" > ~/.config/op/session end end
The idea being to store the token in a file so it can be retrieved to avoid re-auth per tab. The only thing is, it's pretty slow to open a new terminal because
op get account used to validate the session can take some time to return so it's not something I'm currently able to put in my
~/.config/fish/config.fish to run at each session start.
1Password Version: OP CLI 1.10.0
Extension Version: Not Provided
OS Version: macOS 11.4
Sync Type: Not Provided