Skip to main content
March 17, 2022
Question

CLI: Multiple Accounts at the Same Time?

  • March 17, 2022
  • 4 replies
  • 345 views

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

March 18, 2022

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

March 18, 2022

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

March 18, 2022

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.

April 5, 2022

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