Forum Discussion

threebytesfull's avatar
threebytesfull
New Member
1 hour ago

Multiple account support in op run

At present, op run supports injecting secrets into environment variables using the op://vault/item/field syntax. Where multiple accounts are in use, this means the vault needs to be in the account matching OP_ACCOUNT.

I'm trying to remove reliance on any secrets on disk and it would be useful it supported multiple accounts. I'm wondering if adding an optional account to the URI syntax would be a good idea? It would look like op://account@vault/item/field and when no account is specified, it would use the existing logic for determining the account. I can see there may be issues when @ symbols exist in the vault names but perhaps it can fall back to current behaviour if the part before the first @ symbol doesn't match an account name in that case?

Anyway, raising this as a suggestion because I see the request to support multiple accounts has come up several times before and of course breaking existing URI handling would be a blocker.

As a workaround in the meantime, I just nest multiple invocations:

op run --account Account1 --env-file account1.env -- op run --account Account2 --env-file account2.env -- the_real_command

but it's a bit ugly!

No RepliesBe the first to reply