Skip to main content
Mar 17, 2022 8:39 PM UTC
Question

CLI: Multiple Accounts at the Same Time?

Can the CLI be logged into multiple accounts at the same time? The only way I have been able to access items in two different accounts is to login to one at a time.


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided

4 replies

Mar 18, 2022 8:37 AM UTC

Hello there, can you specify your use case? Aren't you able to switch accounts in between?

Mar 18, 2022 12:49 PM UTC

Hey @markdorison, thank you for reaching out to us.
Do you mean retrieving items of different accounts with the same command, or without having to sign-in every time before retrieving items? I think both use-cases are achievable configuring an account filter, i.e. setting the --account flag or the $OP_ACCOUNT environment variables. Retrieving items of different accounts with the same command can be done with a command such as op item get item1 --account account1 && op item get item2 --account account2.
Let me know if this page of our developer documentation helps: https://developer.1password.com/docs/cli/use-multiple-accounts/#use-multiple-accounts-at-the-same-time
I am looking forward to hearing from you!

Best,
Horia

Mar 18, 2022 1:47 PM UTC

Hey @"Horia.Culea_1P"!
I think these two items from the docs answer the question for my use case. Thank you!

By default, all commands will be run from the account that signed in last (agilebits in the above example).

To switch between accounts, use the --account flag to specify the shorthand of the signin address for the account you want to use.

Apr 5, 2022 12:55 PM UTC

No worries, don't hesitate to let us know if we can help with anything else!