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! 12
Generates a Password with a length of 12 character with lowercase UPPERCASE and symbols.
1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
7 Replies
- andi_t_1P
1Password Team
Glad I could help!
- gtirloniNew Contributor
Thank you, much appreciated.
- andi_t_1P
1Password Team
Hi gtirloni and thank you for following up on this! As we do not currently support a straight up alternative to
pwgenwe 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 - gtirloniNew Contributor
Hi, any updates on this? It would be nice to use a password generator blessed by 1Password.
- Former Member
Thanks for the follow-up! We'll make sure to update this thread once we have any developments on this front.
Best,
Horia - B0rgFrequent Contributor
@"Horia.Culea_1P" Thank you for your reply.
I just want to create a password not a item in 1P using the CLI. And make a Alfred workflow so the passwords i create are only made by 1P and not pwgen or other password creator sites/tools. - Former Member
Heya!
Thank you for reaching out to us!
Currently, the only way to generate such passwords with the 1Password CLI is withop item create.
Can you please let us know more about your use-case, that would make use of this feature?
For what it's worth, we do have an internal ticket that tracks adding such functionality.
Looking forward to hearing from you!Best,
Horia