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...
zcutlip
4 years agoDedicated Contributor
Hi, I came here looking for something similar. Currently in pyonepassword, I need to know if it's an error if the caller to OP() didn't provide a password.
I'm using the following heuristic:
- op account list --format json
- if the dictionaries include the shorthand key, biometric is NOT enabled
- If no shorthands are present, biometric is enabled
This works reasonably well since op account list doesn't itself require authentication and is local only (doesn't touch 1Password in the cloud).
No idea if that's a reliable heuristic or not. Also it clearly won't work if no accounts have had initial sign-in
Here's the code for what I'm doing:
https://github.com/zcutlip/pyonepassword/blob/3642c63123283b563b2edf79b2f721757ec14b04/pyonepassword/_py_op_commands.py#L168