op cli does not work in subshell

cvo
cvo
Community Member

Hey,

I noticed an issue with op-cli when I want to retrieve data from within a subshell like so:

echo $(op read "op://Private/ixtzwc5y3kolu44vohmleo3xha/username")

[ERROR] 2024/06/16 20:18:53 could not read secret 'op://Private/ixtzwc5y3kolu44vohmleo3xha/username': error initializing client: connecting to desktop app: connection reset, make sure 1Password CLI is installed correctly, then open the 1Password app, select 1Password > Settings > Developer and make sure the 'Integrate with 1Password CLI' setting is turned on. If you're still having trouble connecting, restart the app.

Interestingly I don't experience any issues as long as I stay in the current shell (see screenshot).

Any idea/hints?

It is probably worth noting, that I installed 1Password as well as op-cli via distrobox. While I expect that the issue relies somewhere in the setup, I still don't understand how the behaviour in a normal shell is as expected, but subshell doesn't work.


1Password Version: 8.10.34
Extension Version: Not Provided
OS Version: bluefin 2.9.0
Browser: Not Provided