Feature request: multiple accounts simultaneously


It looks like that when you auth in multiple teams or in a team and in a personal account simultaneously, only the last account on which you have authenticated have its session file kept in the temporary folder.

I guess this is related to the fact that the op doesn't seem to handle multi accounts at the same time.

That would be great if we could use multiple accounts simultaneously and choosing the one on which we want to interact by adding a shorthand or account-email parameter.


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


  • cohixcohix

    Team Member

    @mickael Absolutely! You can use the --account flag on any command to dictate which account gets used (the value you pass in should be the shorthand of the account that's listed in the config file). So using that you can indeed have multiple accounts active at once :)

  • Thanks @cohix, to explain the feature. Maybe you should add it to the --help argument to make it more visible?

    I also noticed that it looks like there is a session duration difference between my business account and my personal account. The file which holds the encrypted session key of my personal account is deleted before one of my business accounts.

    As I thought that the CLI didn't support multi accounts, I don't pay attention that much when and how these files are deleted.

    I will try to have a more detailed look at that and bring back further details. Unless you confirm, that the session durations are different on personal and business accounts ?

  • So, I can confirm the issue, don't know how to provide you useful debug informations.

    But so far:

    • Both sessions were open simultaneously using my oplogin script provided here
    • I have 2 OP_SESSION env variables
    • I have only one file in ${TMPDIR}/com.agilebits.op.501 the one related to my personal account
  • cohixcohix

    Team Member

    @mickael which one did you login to first?

  • mickaelmickael
    edited May 6

    @cohix Team session first, then personal account

  • mickaelmickael
    edited May 7

    Just to add that I just discovered that the option --account is documented inside the signin command.

    You can sign in to multiple accounts this way. Commands that you run will use
    the account you signed in to most recently. To run a command using a specific
    account, use '--account=<subdomain>':
    op list items --account=<subdomain>
  • cohixcohix

    Team Member

    @mickael hmm, the signin command does do some cleanup of old session files, but if it's only a few minutes/seconds old, then it should be left there. I'll take a look and see what's going on there.

  • cohixcohix

    Team Member


  • Just a small update, to say that my "issue" regarding session was, in fact, an issue on my own.

    I have created a small helper on my TouchBar to display if I am logged in or not in op cli.

    op get account --acount="my" > /dev/null
    op get account --account="team" > /dev/null
    echo "$(($MY+$TEAM))"

    If the result is 0, I am logged in.

    This helpers also keeps the session opened on all my accounts.

    So, I discovered that I had a typo in my team name my bad....

    Since yesterday, I have far more pleasure to use the op CLI and all the helpers I wrote around ;) No more unneeded session expiration ;)

    So, no investigations needed on that issue ;) Sorry for the false information ;)

  • graham_1Pgraham_1P

    Team Member

    Excellent! I'm glad to hear its all working well. :+1:

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file