Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
jgawrych
4 years agoNew Contributor
Check if Biometrics are enabled on CLI 2?
Hello! I am writing a script that uses the 1Password CLI 2. I would like this script to only run when connected to the desktop app using biometrics, and if it was not enabled, tell the user to enable...
Former Member
4 years agoHey jgawrych, currently we have no specific command that would return whether the biometrics are enabled or not, in the CLI. I'm going to be opening an internal ticket tracking this.
In the meantime, here are some workarounds that might work for you:
* starting with 2.6.0-beta.05, the op account use command is a simpler way to select your biometric account. This will once again return an error if biometrics are not enabled. This is, maybe, more convenient than running a full op account add command.
* Running basically any command, if not signed in, will be triggering an error, if the user is not using biometrics. If you want to enforce this, you can sign out all accounts with op signout --all before running another command, such that you'd make sure that the script would fail if biometrics are not enabled.
* What I personally do in my own scripts making use of the CLI, in order to enforce the use of biometrics, is exporting the OP_BIOMETRIC_UNLOCK_ENABLED environment variable. When this variable is set to true, this forces the CLI to try to connect to 1Password 8. If the CLI integration is not enabled in the application, you would get a message similar to:
connecting to desktop app: connecting to desktop app timed out, make sure it is installed, running and CLI integration is enabled
which by itself is a way to tell the user to enable the biometrics integration.
Let us know if any of this helps. Otherwise, we'll make sure to keep you updated with any developments related to being able to retrieve the biometrics' state from the CLI.
Best,
Horia