Comments (23)
This issue is still ongoing and we don't yet have a solution, so I'm going to open this up to Hacktoberfest submissions if anyone is brave enough or has any wild ideas. Good luck!
from op-vscode.
Having same issue with various CLI versions (including 2.4,x and 2.5.x) on Windows 10 and Windows 11. Definitely have installed the 1Password CLI in a custom location (for other development environment & business-case reasons.)
Would be nice to have an extension setting to specify a custom CLI binary path and still use the current 'lookpath' resolution method if this setting is undefined (likely would be for most users) or an invalid path.
from op-vscode.
Well, right after posting this, I found the problem (at least on my machine).
It appears that when installing via homebrew, VSCode does not get nor prompt for full disk access.
Without it, lookpath
can only access /usr/local/bin
when the extension starts up. Other directories on $PATH seem to be forbidden.
Creating a symlink from /opt/homebrew/bin/op=>
/usr/local/bin/op' or providing full disk access to VSCode solves the issue.
from op-vscode.
It happens sometimes, but definitely not most of the times. I don't know why.
It seems it's when I open a project from the terminal at the required folder, work on it, quit VS Code, and say the next day I reopen VS Code, the window of the project (will all the open tabs/files, etc) is already opened. If I ever get the "Unable to resolve…" message, it's then. But a simple reload (from the menu, "Developer: Reload Window") solves the issue.
(I think the documentation says we should always open projects from their relevant folder in the terminal anyway)
Whereas I get the "CLI is not installed. …" error message each time at startup, or when I open a new window, or reload it
from op-vscode.
So far, these ordered steps seem to have corrected the issue for me on macOS 13.1. I had already installed 1Password 8 and CLI 2 previously, so it was only a matter of removing the extension and making sure 1Password 8 and CLI 2 were configured correctly before re-installing the VS Code Extension:
- Remove 1Password for VS Code extension if installed.
- Make sure 1Password 8 for Desktop and 1Password CLI 2 are installed. I installed using Homebrew, and followed along with this page: Get started with 1Password CLI 2
. The binary was installed under/usr/bin/local/op
- The above link with instruct you to configure 1Password 8's Settings to configure Touch ID and CLI:
- Open 1Password.
- Click the account or collection at the top of the sidebar and choose Preferences > Security.
- Select Touch ID.
- Click Developer in the sidebar.
- Select "Connect with 1Password CLI".
- You can also unlock 1Password CLI with your Apple Watch.
- In Terminal/iTerm I verified 1Password CLI was installed:
op --version
a.2.13.0
- Then I attempted to signin via 1Password CLI:
op signin
, but received this error:
[ERROR] 2023/01/26 05:27:38 Lock the 1Password app to finish setting up Touch ID, then try again.
- I again executed
op signin
and received a different instruction:
[ERROR] 2023/01/26 05:27:57 1Password app is locked. Please open 1Password, unlock it with your password, and then try again
- After unlocking 1Password 8 app with my password, I ran
op signin
command a third time, and was finally presented with the Touch ID prompt within iTerm, and successfully connected my 1Password account with the CLI. You can executeop whoami
to verify the correct account is signed into the CLI. - Now, go back to VS Code and install the 1Password Extension. You may need to Reload VS Code. The error did not re-appear.
Hope this helps others! I also added the following to my .zshrc
file (I believe all are also mentioned on the aforementioned site:
# 1Password CLI
eval "$(op completion zsh)"; compdef _op op # Adds shell completion commands for `op`
source ~/.config/op/plugins.sh # Adds aliases for `op` plugins to interface with various hosts like GitHub and Homebrew
from op-vscode.
Thanks for this detailed information, @cbserra!
I'm just checking in on this. We haven't seen it come up consistently, and so @remitbri @kitpierce @alexclst I just wanted to check if you were still regularly experiencing this issue.
I'll note that, as requested above, we'll eventually be adding the ability to specify a custom CLI path, so if you continue to experience issues that could be a possible fix.
from op-vscode.
@jodyheavener They aren't happening together. I very rarely get the warning about shell environment, but almost always the 1Password warning.
from op-vscode.
I'm currently getting this on Windows 11. 1Password CLI installed through winget. VSCode plugin version 1.0.4.
PS C:\Users\legowerewolf> $PSVersionTable
Name Value
---- -----
PSVersion 7.3.9
PSEdition Core
GitCommitId 7.3.9
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS C:\Users\legowerewolf> get-command op
CommandType Name Version Source
----------- ---- ------- ------
Application op.exe 0.0.0.0 C:\Users\legowerewolf\AppData\Local\Microsoft\WinGet\Links\op.exe
PS C:\Users\legowerewolf> op --version
2.22.0
EDIT: And just to make sure this isn't just Powershell being interesting, because god knows I'm doing weird crap in my Powershell profile, I checked in cmd.exe as well. Same result; op --version
returns 2.22.0.
Perhaps it would help to add more diagnostic messaging in the extension's output? Right now, it just shows this:
from op-vscode.
Hey @remitbri, thanks for filing and sorry you're experiencing this issue. From the details you provided it sure seems like everything should be functioning correctly.
You didn't install the CLI binary to a non-standard location by chance, did you? I don't think that should have an impact, but it would be worth ruling out. We're using lookpath to figure out if you have the CLI installed.
Finally, I'd recommend restarting VS Code if you haven't already, just to make sure it's a persistent issue. If restarting does fix it I'd still consider that a bug, but at least it would be working for you.
from op-vscode.
Hi @jodyheavener Thanks for your reply. I've just created a local repo with just lookpath installed. Launching node
> const p = await lookpath('op')
undefined
> p
'/usr/local/bin/op'
I installed op with homebrew, as per documentation.
from op-vscode.
Thanks for verifying this on your end! This looks correct to me. I'll see what I can find out on my end.
from op-vscode.
Hey @remitbri, while I haven't been able to uncover why the issue is occurring, someone else reported something similar and was able to resolve it by uninstalling and re-installing the extension. If you'd like to give that a try it could at least unblock you :)
from op-vscode.
Removing+reinstalling didn't do the trick, nor did disabling/unabling, I had to remove the extension + quit VS Code + start VS Code + install the extension. It seems to be working as expected now…
from op-vscode.
One workday later, the computer starts, VS Code starts and… the problem has come back, "CLI is not installed" etc
from op-vscode.
Darn! Sorry to hear that, and thanks for following up to report this.
It's odd that it would work one day and not that next, so I'm curious: does VS Code ever present you with the message "Unable to resolve your shell environment in a reasonable time. Please review your shell configuration."? If so, this could explain it; VS Code needs to establish your PATH through your shell in order to use the extension.
from op-vscode.
I've had the same problem across multiple versions of op
, VS Code, and macOS. I have op
installed via the brew cask, which installs the command into /usr/local/bin
despite me being on an Apple Silicon Mac.
from op-vscode.
Having same issue with various CLI versions (including 2.4,x and 2.5.x) on Windows 10 and Windows 11. Definitely have installed the 1Password CLI in a custom location (for other development environment & business-case reasons.)
Would be nice to have an extension setting to specify a custom CLI binary path and still use the current 'lookpath' resolution method if this setting is undefined (likely would be for most users) or an invalid path.
Agreed - I can't edit my PATH variables (restricted account on my work computer), so I've added them to the VS Code user settings, but that doesn't seem to be recognized by the extension. Hard coding it would be a fine solution for me as well.
from op-vscode.
I still see this fairly regularly.
from op-vscode.
Thanks @alexclst! And I see you're on macOS from your last comment. One followup question: does this ever happen in conjunction with a warning from VS Code along the lines of "Unable to resolve your shell environment in a reasonable time"?
from op-vscode.
@jodyheavener Hi! Running at the moment
op-vscode v1.0.4
VS Code 1.76.0
CLI 2.14.0
macOS 13.2.1
So: I haven't observed the issue for quite a while, I don't think I did anything in particular about it
Regarding my zsh config files, I just have eval "$(op completion zsh)"; compdef _op op
from op-vscode.
I use MacOS 14.1.1 with CLI 2.23.0 and VScode 1.84.2 and extension 1.0.4 and I get the same error; I tried to uninstall, leave viscose and then try install again but I still get the same error message.
Do we know what makes the extension think the CLI is not installed?
from op-vscode.
I'm experiencing the same issue: CLI is not installed. Please install it to use 1Password for VS Code.
Extension version 1.0.4
.
I'm using a MacBook Pro M1 with macOS 14.2.1.
Here's the output of the command op --version
: 2.24.0
. Installed it using homebrew. Both the standalone 1Password app and CLI function properly on their own.
from op-vscode.
I'm experiencing the same issue: CLI is not installed. Please install it to use 1Password for VS Code.
Extension version 1.0.4.
Macbook Pro M3 14.3
Also installed via homebrew. No amount of uninstalling / reinstalling seems to make this work.
❯ op --version
2.24.0
❯ which op
/opt/homebrew/bin/op
Everything else functions just finer. The VS Code extension just won't believe the CLI is installed
from op-vscode.
Related Issues (20)
- VSCode Feature "1Password: Save in 1Password" does not work HOT 15
- Cant sign in HOT 2
- Tilel bot
- Error executing CLI command when choosing account.
- Extension causes high cpu load HOT 5
- Use of op cli for vs-code devcontainer setup.sh script HOT 4
- Secret references do not open correctly in desktop app HOT 2
- VSC 1Password Debug HOT 10
- HIghlight key and value for "1Password: Save to 1Password" HOT 2
- Development: Build fails on fresh installations
- Example of build tasks that op inject before source files with secrets compiled HOT 6
- how to execute code having 1Password reference HOT 2
- List vault items in item selection prompt
- Auto-complete secret references inline
- Allow patterns for secret detection to be customized
- ErrorMessage: All configured authentication methods failed
- Error executing CLI command: invalid JSON in piped input. HOT 2
- VSCode: settings.json and REST client not supported HOT 2
- secret references not recognized inside of Jupyter notebook (.ipynb) HOT 5
- Add support for remote development HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from op-vscode.