Signing back into the Community for the first time? You'll need to reset your password to access your account.  Find out more.

Forum Discussion

anishlr's avatar
anishlr
New Contributor
3 years ago

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

  • kajojo's avatar
    kajojo
    New Contributor

    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.

  • Former Member's avatar
    Former Member

    Also very interested by that! Trying the alias to op.exe for now.

  • Former Member's avatar
    Former Member

    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"

  • Former Member's avatar
    Former Member

    +1 name for the list if it helps. :)

  • Jack_P_1P's avatar
    Jack_P_1P
    Icon for 1Password Team rank1Password Team

    Hey @thisdevdane:

    I've added you as well! 🙂

    Jack

  • Former Member's avatar
    Former Member

    Just to add to the list of people, that is something I wish for as well.

  • Jack_P_1P's avatar
    Jack_P_1P
    Icon for 1Password Team rank1Password Team

    Hey @FWest98:

    I've noted your interest as well. Thanks for reaching out!

    Jack

  • Former Member's avatar
    Former Member

    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.

  • Jack_P_1P's avatar
    Jack_P_1P
    Icon for 1Password Team rank1Password Team

    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