Skip to main content
Oct 29, 2022 8:35 PM UTC
Question

Feature request: support default values for env references in .env files used with op run

I like the idea of exporting the vault name to an environment variable when using the op:// protocol references in an .env file used with op run, but I would like to be able to have a default, as in ${APP_ENV:-dev}. It seems that this isn't supported since I get [ERROR] 2022/10/29 14:31:56 parsing Dotenv file: error at line 151 column 31: expected '}' but found ':' when I try this.

This is in CLI 2.6.2 at least.


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

3 replies

1Password Employee
Nov 15, 2022 3:21 PM UTC

Hi @jonb1 , this should be a feature we support in both op inject and op run parsers. I am not sure of the version of the CLI which start supporting this though. Could you please update to the latest version and check this again? Thanks!

All the best,
Andi

Nov 16, 2022 11:35 PM UTC

Yep - either it was an earlier version with a problem, or I just messed something up when I tried this. Thanks!

Jack_P_1P
1Password Employee
1Password Employee
Nov 30, 2022 10:11 PM UTC

On behalf of Andi, you're very welcome!

Jack