Is it possible for 1Password CLI running on WSL to connect with 1Password hosted on Windows?
Right now I can access 1Password on my WSL Debian installation using the CLI. But I have to enter my master password even when Windows is authenticated. I was just curious if it's possible to connect the two (a-la the SSH agent forwarding magic outlined here - https://1password.community/discussion/128023/ssh-agent-on-windows-subsystem-for-linux)
1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser:_ Not Provided
Comments
-
Hi @anishlr:
There currently isn't any way of connecting 1Password CLI running in Windows Subsystem for Linux to 1Password for Windows running on the host. With that said, it's something I'd love to see too, so I'll share your feedback on an internal discussion we have about this. While I can't promise anything specifically, we use feedback like yours to help inform the future of 1Password.
Jack
ref: IDEA-I-1662
1 -
I would be very interested in this feature as well! Especially with the shell plugins recently introduced, that would be a great combination of being able to connect to GitLab from my WSL shell using Hello authentication.
0 -
Just to add to the list of people, that is something I wish for as well.
1 -
0
-
+1 name for the list if it helps. :)
0 -
Another +1 here
0 -
You can use the Windows cli binary, which is already connected to the host's 1Password instance, to access the data.
alias op="op.exe"
Obviously, op.exe needs to be accessible via the host's PATH or the WSL's PATH, or you'll have to specify the full path to the binary in /mnt/c/.../.
Autocomplete works as well.
eval "$(op completion zsh)"; compdef _op op.exe
Unfortunately, this will only work for your own scripts because the binary's plugins still run on Windows and don't recognize the Linux shell, unless the plugin supports both platforms.
Here's a sudo alias:
alias sudo="sudo -S <<< $(op item get YOUR_ROOT_PASS_ID --fields label=password)"
Or, as a separate command, since
sudo -S
removes its interactivity.alias sudoauth="op item get YOUR_ROOT_PASS_ID --fields label=password | sudo -Sv"
0 -
Also very interested by that! Trying the alias to op.exe for now.
0 -
With the current lack of support for Windows side plugins (official and otherwise) it would be extremely useful to be able to get this working.
0 -
Hey folks,
Thanks for sharing your interest! I know it's something I'd love to see as well, so I'll add your feedback. ๐
Jack
0 -
I'm also interested. Using AWS CLI with 1Pass would be great.
Thanks0 -
+1 Would love to see this as well. Seeing that 1Pass has other developer friendly features i.e the VSCode extension, secrets and ssh-agent (while unofficially supported, can be utilised in WSL) to name what first comes to mind, I think this would be a fantastic addition to the toolkit! ๐
0 -
0
-
+1
I have been using the hackish solution for ssh agent and it's a breeze. Would love seeing the full 1Password CLI working on WSL.
0 -
Btw, here's a new solution that doesn't depend on a separate
sudoauth
alias.Github Gist: Sudo authentication with Windows 1Password CLI on Ubuntu WSL
The howto script is not meant for automatic execution, just as a guideline. It's best if you just edit the respective files manually, and don't forget substituting your own item identity.
0 -
Thanks for sharing!
Jack
0 -
+1
0 -
+1
0 -
+1
0 -
+1
0 -
Thank you everyone for chiming in!
We'll let you know once we have more details here.
0 -
Would love to see this as well
0 -
+1
0 -
+1
0 -
What I found is that it works if you create a symlink in your WSL machine, pointing to op.exe on your Windows host:
ln -s /mnt/c/Users/user/AppData/Local/Microsoft/WinGet/Links/op.exe /home/user/.local/bin/op
It works with other Linux commands (in opposite to alias), and in particular with ansible.
0 -
I also would love to see this released ! Windows co-workers wait for this !
0 -
has there been any progress since then? has any kind of roadmap been prepared?
it would be very nice to be able to use the 1password CLI via WSL2, especially the shell plugins
0 -
bump. +1 for me. we all expect this to "just work". for me, the ability to have a real shell vis a vi WSL is the only reason this programmer is using Windows. To my understanding, there's a pipeline btwn the WSL environment and Windows (be it ports or binary compatibility), but having op cli available in WSL, connecting to the Windows 1p app is a critical piece.
0