Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
B0rg
4 years agoFrequent Contributor
Generate passwords from op 1P CLI?
Is it possible to add command to generate random passwords from the 1P CLI?
Add the https://1password.com/password-generator/ web version also to the "op" command.
Like:
~/home>op --genpass aB...
andi_t_1P
1Password Team
4 years agoHi gtirloni and thank you for following up on this! As we do not currently support a straight up alternative to pwgen we do provide a (slightly longer but more comprehensive) solution for generating a password AND saving it for future use:
Use the '--generate-password' option to generate and set a random
password for a Login or Password item. By default, it will create a
32-character password made up of letters, numbers, and symbols.
You can customize the password with a password recipe. Specify the
password length and which character types to use in a comma-separated
list. Ingredients are:
- 'letters' for uppercase and lowercase letters
- 'digits' for numbers
- 'symbols' for special characters ('!@.-_*')
- '1' - '64' for password length
Example for your use case:
op item create --title='retrievable generated password' --category=password --generate-password=20,letters,digits | op read op://Private/'retrievable generated password'/password
This should achieve your desired output and furthermore it will store your password for further retrieval at any later stage using the op read [secret_reference] command.
Hope this helps!
All the best,
Andi