Level up your business security with free, on-demand training and certification. Explore 1Password Academy today →
Forum Discussion
greysave
2 years agoNew Contributor
Linux 1password CLI annot connect to the desktop app
The server is running Ubuntu 22.04 and I get the following error:
op vault list
[ERROR] 2024/04/05 09:54:38 connecting to desktop app: cannot connect to 1Password app, make sure it is running
I followed the directions on the 1Password developer site. I have tried uninstalling and reinstalling both 1password and 1passord cli.
1Password Version: 8.10.24
Extension Version: Not Provided
OS Version: Ubuntu 22.04
Browser: Not Provided
11 Replies
- thecatfixDedicated Contributor
hey 1P_Dave can you find someone who can answer Michael_Mercuri research. He did a **bleep** good job chasing down issues and is not getting any feedback.
- Michael_MercuriDedicated Contributor
I ended up submitting a support ticket on this and the 1Password engineering team was able to get me a work-around.
In my case, specifically, I was attempting to use 1Password CLI from a WezTerm plugin while WezTerm was launched from Pop!_OS COSMIC desktop launcher. When the plugin executes 1Password CLI, it’s not running in a PTY. Because there’s no PTY and because COSMIC desktop doesn’t populate the environment with typical GNOME session variables (e.g. SESSION_ID, INVOCATION_ID, and others) the desktop app refuses to allow the CLI to connect as a security measure because it can’t properly determine it was legitimately launched by the user.
So far, this has only been an issue for me with COSMIC. It does not occur with GNOME on Ubuntu 22 (X11) or Ubuntu 24 (Wayland). I intend on filing a bug against COSMIC related to this.
The work-around involves running the CLI in wrapper script that uses “script” command to temporarily create a PTY. It works but it’s not ideal. For me, I’d rather just launch WezTerm from another terminal session which also works.
I’ll follow-up if I get anywhere with a bug report against Pop!_OS COSMIC Desktop
- thecatfixDedicated Contributor
OMG....did you discover 1password not cross distro compatible. This changes everything. i am using arch and have had same issues
- Michael_MercuriDedicated Contributor
thecatfix, I'm curious, in your case are you using X11 or Wayland?
Are you able to use `op` command manually from your shell to interact with 1Password Desktop App (e.g. to read items)?
- thecatfixDedicated Contributor
Sorry for the late reply. I have the Omarchy mirror that uses Wayland. I am thinking about switching to ubuntu based on your posts. Great research.
- Michael_MercuriDedicated Contributor
There appears to be more going on than just setting the environment variable that impacts how the 1Password CLI is allowed to talk to the 1Password Desktop app.
Just setting the environment variable is not enough.
I have my Wayland GNOME desktop configured to set both of these environment variables using ~/.config/environment.d/00-env.conf:
OP_BIOMETRIC_UNLOCK_ENABLED=true OP_LOAD_DESKTOP_APP_SETTINGS=trueIf I launch WezTerm directly from the desktop launcher, WezTerm is unable to access the 1Password Desktop App using the 1Password CLI:
19:57:39.250 ERROR logging > lua: Failed to get password: [ERROR] 2026/03/24 19:57:39 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, visit https://developer.1password.com/docs/cli/app-integration#troubleshooting for more help.I'm able to verify that the WezTerm process does indeed have the environment variables set using `ps` or checking /proc/pid/environ.
However, if I first launch another terminal program and then launch WezTerm from there, WezTerm is able to use 1Password CLI to interact with 1Password Desktop App and read my vault.
What is the difference between launching `op` from an interactive shell in a terminal vs from another process launched directly by the desktop launcher?
And what do the `OP_BIOMETRIC_UNLOCK_ENABLED` and `OP_LOAD_DESKTOP_APP_SETTINGS` environment variables do?
And why would this behavior be different on Ubuntu 22 under X11 compared to Ubuntu 24 under Wayland?
- Michael_MercuriDedicated Contributor
Btw, for anyone reading this... my observation above was WRONG. Setting the OP_BIOMETRIC_UNLOCK_ENABLED had no impact. The CLI worked for me in these cases because I was executing it from my shell running in a terminal vs previously attempting to run it from a Lua-based plugin from within WezTerm where the CLI was not running inside a terminal (PTY).
- Michael_MercuriDedicated Contributor
So... after reading this suggestion in other similar posts I tried setting the environment variable:
OP_LOAD_DESKTOP_APP_SETTINGS=true
Now this is working. Why? What does this do? I found no reference to it in 1Password CLI documentation:
https://developer.1password.com/docs/cli/environment-variables/
- Michael_MercuriDedicated Contributor
Anyone? I'm also seeing errors like this on Pop!_OS 24.04 based on Ubuntu 24.04.
What's weird is that I regularly use `op` daily and it runs fine from the command line.
However, when attempting to use Wezterm https://github.com/dfaerch/passrelay.wezterm plugin that uses the 1Password CLI, when the plugin get a "connect reset" error:
[ERROR] 2026/03/19 16:54:50 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, visit https://developer.1password.com/docs/cli/app-integration#troubleshooting for more help.All of the `op` commands that the plugin uses such as `op item list` and `op item get` work fine when executed manually from my shell. But when run from the Wezterm plugin, it gets these error.
When I check the 1Password CLI activity log from the Developer Settings, it shows no activity from Wezterm, desite the error message obviously coming from `op` .
The only activity that ever shows up is when I manually invoke `op` from my shell.
Lastly... this all works flawlessly on macOS.
I'm using 1Password version 8.12.8 and op version 2.33.0.
- Michael_MercuriDedicated Contributor
Weird. I just tried this on my older Pop!_OS 22.04 laptop based on Ubuntu 22.04 and it works perfectly fine there. Same version of 1Password app and op installed. One other difference is that the older Ubuntu 22.04 is using X11 and the new Ubuntu 24.04 is using Wayland.