How to use .env or .envrc files to pull env vars for run/debug configurations?

Answered

I think this is a topic in general for Jetbrains IDEs (I use Webstorm and Goland). I have projects in either those using .env files with 20 variables. Then if I want to create a run/debug configuration, I need to add these 20 variables in the "Environment variables" section with their values. Isn't there a way to tell the run/debug configuration to obtain the env vars from my .env or .envrc instead? If I want to update a variable I have to do it in both places, as sometimes I run the code outside of the IDE.

1
5 comments

Hello,

Please try out EnvFile plugin.

1

I installed EnvFile in IntelliJ Ultimate, but now I cannot find in IntelliJ Settings where to configure the plugin. They only provide a screen shot for PyCharm on the plugin homepage.

0

John Bonfardeci, you can find it via Run | Edit Configurations | [Created Configuration] | EnvFile tab.

1

Hi,

Has JetBrans team to implement use .env be default and/or without any plugins?

Thank you.

1

Hi Ildar,

I'm afraid not supported yet. Please follow this task to track any updates on the matter, should some come up - IDEA-289940

0

Please sign in to leave a comment.