It’s Cybersecurity Awareness Month! Join our interactive training session, or learn about security and AI from 1Password experts.
Forum Discussion
Former Member
3 years agoAdding/Sign-in to an account via bash script
I am trying to add an account through a bash script to do further operations but op account add doesn't have --password flag as an option.
How do I specify the password so that there's no interv...
Jack_P_1P
1Password Team
3 years agoHi @rollsdevoted:
Great question. To use 1Password CLI non-interactively, like in a script, you'll need to pipe the password into it.
For example:
```
add the account
eval $(echo "$PASSWORD" | op account add --address my.1password.com --email "$EMAIL" --secret-key "$SECRET_KEY")
sign in to the account
eval $(echo "$PASSWORD" | op signin)
```
This example uses a very basic way of adding the password, however, and shouldn't be stored directly in the bash script.
Let me know how you get on with that.
Jack