How to check if a session is active? (feature request)
In shell scripts I want to check that a session is active and valid and that it will still be active for the next x minutes.
The only output I need is an exit code: 0 or 1
AFAIK there is no built in command to do that so with CLI v1 I was using this:
if ! op list vault >/dev/null 2>&1; then
printf 'No 1Password session. Run \e[35meval $(op signin "$OP_ACCOUNT")\e[m.\n' >&2
exit 1
fi
With CLI v2, I'm transforming this as:
if ! op vault list >/dev/null 2>&1; then
printf 'No 1Password session. Run \e[35meval $(op signin)\e[m.\n' >&2
exit 1
fi
Is there a better way?
op whoami doesn't check the session.
op account get is slower than op vault list (mesured with time).
op user get --me is slow too.
Feature request: new command op signin --check or op session check
1Password Version: Not Provided
Extension Version: Not Provided
OS Version: macOS
Browser:_ Not Provided
