{"id":13593093,"url":"https://github.com/ashald/EnvFile","last_synced_at":"2025-04-09T02:32:24.485Z","repository":{"id":35048063,"uuid":"39175817","full_name":"ashald/EnvFile","owner":"ashald","description":"EnvFile 3.x is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.","archived":false,"fork":false,"pushed_at":"2024-06-01T18:57:15.000Z","size":1809,"stargazers_count":548,"open_issues_count":78,"forks_count":129,"subscribers_count":11,"default_branch":"develop","last_synced_at":"2024-11-05T01:11:33.728Z","etag":null,"topics":["envfile","idea","jetbrains","json","plugin","pycharm","rubymine","yaml"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashald.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ashald"],"custom":["paypal.me/xashald"]}},"created_at":"2015-07-16T04:06:24.000Z","updated_at":"2024-10-28T12:04:52.000Z","dependencies_parsed_at":"2024-06-18T20:00:18.951Z","dependency_job_id":"9bb893a0-4f7f-474c-acca-0b7cd7d45dd8","html_url":"https://github.com/ashald/EnvFile","commit_stats":{"total_commits":112,"total_committers":22,"mean_commits":5.090909090909091,"dds":0.3214285714285714,"last_synced_commit":"19a832f223fc5233aa274618a3ce35a0d866a2f1"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashald%2FEnvFile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashald%2FEnvFile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashald%2FEnvFile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashald%2FEnvFile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashald","download_url":"https://codeload.github.com/ashald/EnvFile/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223356565,"owners_count":17132162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["envfile","idea","jetbrains","json","plugin","pycharm","rubymine","yaml"],"created_at":"2024-08-01T16:01:16.518Z","updated_at":"2024-11-06T14:31:11.776Z","avatar_url":"https://github.com/ashald.png","language":"Java","funding_links":["https://github.com/sponsors/ashald","paypal.me/xashald"],"categories":["Java"],"sub_categories":[],"readme":"# EnvFile\n\n## Description\n\n**Env File** is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations\nfrom one or multiple files.\n\n### Supported Formats\n\n- **.env**\n- **YAML** dictionary\n- **JSON** dictionary *(parsed with YAML parser since [JSON is subset of YAML][json-is-yaml])*\n\n**All formats assume that both keys and values are strings.**\n\n### Supported Platforms\n\n\u003cem\u003e\nExpand to see supported run configuration types. Italic means that run configuration is only available in paid\nversion of the product.\n\u003c/em\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cdetails\u003e\n    \u003csummary\u003e\u003cstrong\u003ePyCharm\u003c/strong\u003e\u003c/summary\u003e\n    \u003cul\u003e\n        \u003cli\u003e\u003cem\u003eApp Engine server\u003c/em\u003e\u003c/li\u003e\n        \u003cli\u003e\u003cem\u003eBehave\u003c/em\u003e\u003c/li\u003e\n        \u003cli\u003e\u003cem\u003eDjango server\u003c/em\u003e\u003c/li\u003e\n        \u003cli\u003e\u003cem\u003eDjango tests\u003c/em\u003e\u003c/li\u003e\n        \u003cli\u003eLettuce\u003c/li\u003e\n        \u003cli\u003ePyramid server\u003c/li\u003e\n        \u003cli\u003ePython\u003c/li\u003e\n        \u003cli\u003e\n            Python docs\n            \u003cul\u003e\n                \u003cli\u003eDocutils task\u003c/li\u003e\n                \u003cli\u003eSphinx task\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\n            Python test\n            \u003cul\u003e\n                \u003cli\u003eUnittests\u003c/li\u003e\n                \u003cli\u003eDoctests\u003c/li\u003e\n                \u003cli\u003eNosetests\u003c/li\u003e\n                \u003cli\u003epy.test\u003c/li\u003e\n                \u003cli\u003eAttests\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e        \n        \u003cli\u003eTox\u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003e\u003cstrong\u003eIDEA\u003c/strong\u003e\u003c/summary\u003e\n    \u003cul\u003e\n        \u003cli\u003eApplication\u003c/li\u003e\n        \u003cli\u003e\u003cem\u003eArquillian JUnit\u003c/em\u003e\u003c/li\u003e\n        \u003cli\u003e\u003cem\u003eArquillian TestNG\u003c/em\u003e\u003c/li\u003e\n        \u003cli\u003e\u003cem\u003eCloudBees Server\u003c/em\u003e\u003c/li\u003e\n        \u003cli\u003e\u003cem\u003eCucumber Java\u003c/em\u003e\u003c/li\u003e\n        \u003cli\u003eGradle (requires \"Enable Experimental Integrations\")\u003c/li\u003e\n        \u003cli\u003e\u003cem\u003eGWT Configuration\u003c/em\u003e\u003c/li\u003e\n        \u003cli\u003e\n            \u003cem\u003eGeronimo Server\u003c/em\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003cem\u003eLocal\u003c/em\u003e\u003c/li\u003e\n                \u003cli\u003e\u003cem\u003eRemote\u003c/em\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\n            \u003cem\u003eGlassFish Server\u003c/em\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003cem\u003eLocal\u003c/em\u003e\u003c/li\u003e\n                \u003cli\u003e\u003cem\u003eRemote\u003c/em\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e        \n        \u003cli\u003e\u003cem\u003eGoogle AppEngine Dev Server\u003c/em\u003e\u003c/li\u003e\n        \u003cli\u003e\u003cem\u003eGrails\u003c/em\u003e\u003c/li\u003e\n        \u003cli\u003eJAR Application\u003c/li\u003e\n        \u003cli\u003e\n            \u003cem\u003eJBoss Server\u003c/em\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003cem\u003eLocal\u003c/em\u003e\u003c/li\u003e\n                \u003cli\u003e\u003cem\u003eRemote\u003c/em\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\n            \u003cem\u003eJSR45 Compatible Server\u003c/em\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003cem\u003eLocal\u003c/em\u003e\u003c/li\u003e\n                \u003cli\u003e\u003cem\u003eRemote\u003c/em\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\n            \u003cem\u003eJetty Server\u003c/em\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003cem\u003eLocal\u003c/em\u003e\u003c/li\u003e\n                \u003cli\u003e\u003cem\u003eRemote\u003c/em\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e\n        \u003cli\u003eJUnit\u003c/li\u003e\n        \u003cli\u003eKotlin\u003c/li\u003e\n        \u003cli\u003eKotlin script\u003c/li\u003e\n        \u003cli\u003e\n            \u003cem\u003eResin\u003c/em\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003cem\u003eLocal\u003c/em\u003e\u003c/li\u003e\n                \u003cli\u003e\u003cem\u003eRemote\u003c/em\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\u003cem\u003eSpring Boot\u003c/em\u003e\u003c/li\u003e\n        \u003cli\u003e\n            \u003cem\u003eSpring dmServer\u003c/em\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003cem\u003eSpring dmServer (Local)\u003c/em\u003e\u003c/li\u003e\n                \u003cli\u003e\u003cem\u003eSpring dmServer (Remote)\u003c/em\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e\n        \u003cli\u003eTestNG\u003c/li\u003e\n        \u003cli\u003e\n            \u003cem\u003eTomEE Server\u003c/em\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003cem\u003eLocal\u003c/em\u003e\u003c/li\u003e\n                \u003cli\u003e\u003cem\u003eRemote\u003c/em\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\n            \u003cem\u003eTomCat Server\u003c/em\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003cem\u003eLocal\u003c/em\u003e\u003c/li\u003e\n                \u003cli\u003e\u003cem\u003eRemote\u003c/em\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\n            \u003cem\u003eWebLogic Server\u003c/em\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003cem\u003eLocal\u003c/em\u003e\u003c/li\u003e\n                \u003cli\u003e\u003cem\u003eRemote\u003c/em\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\n            \u003cem\u003eWebSphere Server\u003c/em\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003cem\u003eLocal\u003c/em\u003e\u003c/li\u003e\n                \u003cli\u003e\u003cem\u003eRemote\u003c/em\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003e\u003cstrong\u003eRubyMine\u003c/strong\u003e\u003c/summary\u003e\n        \u003cul\u003e\n            \u003cli\u003eCapistrano\u003c/li\u003e\n            \u003cli\u003eCucumber\u003c/li\u003e\n            \u003cli\u003eGem Command\u003c/li\u003e\n            \u003cli\u003eIRB Console\u003c/li\u003e\n            \u003cli\u003eRSpec\u003c/li\u003e\n            \u003cli\u003eRack\u003c/li\u003e\n            \u003cli\u003eRails\u003c/li\u003e\n            \u003cli\u003eRake\u003c/li\u003e\n            \u003cli\u003eRuby\u003c/li\u003e\n            \u003cli\u003eSpork DRb\u003c/li\u003e\n            \u003cli\u003eTest::Unit/Shoulda/Minitest\u003c/li\u003e\n            \u003cli\u003eZeus Server\u003c/li\u003e  \n        \u003c/ul\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003e\u003cstrong\u003eGoLand\u003c/strong\u003e\u003c/summary\u003e\n        \u003cul\u003e\n            \u003cli\u003eGo App Engine\u003c/li\u003e\n            \u003cli\u003eGo Build\u003c/li\u003e\n            \u003cli\u003eGo Test\u003c/li\u003e  \n        \u003c/ul\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003e\u003cstrong\u003eCursive\u003c/strong\u003e (\u003e=1.8.2)\u003c/summary\u003e\n        \u003cul\u003e\n            \u003cli\u003eLocal Clojure REPL\u003c/li\u003e\n            \u003cli\u003eClojure Application\u003c/li\u003e\n            \u003cli\u003eLeiningen\u003c/li\u003e\n        \u003c/ul\u003e\n\u003c/details\u003e\n\n## Installation\n\n- Using IDE built-in plugin system:\n  - \u003ckbd\u003ePreferences\u003c/kbd\u003e \u003e \u003ckbd\u003ePlugins\u003c/kbd\u003e \u003e \u003ckbd\u003eBrowse repositories...\u003c/kbd\u003e \u003e \u003ckbd\u003eSearch for \"Env File\"\u003c/kbd\u003e \u003e \u003ckbd\u003eInstall Plugin\u003c/kbd\u003e\n\n- Manually:\n  - Download the [latest release][latest-release] and install it manually using \u003ckbd\u003ePreferences\u003c/kbd\u003e \u003e\n  \u003ckbd\u003ePlugins\u003c/kbd\u003e \u003e \u003ckbd\u003eInstall plugin from disk...\u003c/kbd\u003e\n\nRestart IDE.\n\n## Usage\n\n0) Add new *Run/Debug configuration*: \u003ckbd\u003e+\u003c/kbd\u003e \u003ckbd\u003eAdd new configuration\u003c/kbd\u003e \u003e \u003ckbd\u003e...\u003c/kbd\u003e\n1) Switch to \u003ckbd\u003eEnvFile\u003c/kbd\u003e tab\n2) Select \u003ckbd\u003eEnable EnvFile\u003c/kbd\u003e checkbox\n3) Select \u003ckbd\u003eSubstitute Environment Variables\u003c/kbd\u003e checkbox (if needed)\n4) Select \u003ckbd\u003eProcess JetBrains path macro references\u003c/kbd\u003e checkbox (if needed)\n5) Select \u003ckbd\u003eIgnore missing files\u003c/kbd\u003e checkbox (if needed)\n6) Select \u003ckbd\u003eEnable experimental integrations\u003c/kbd\u003e checkbox (if needed)\n7) Click on \u003ckbd\u003e+\u003c/kbd\u003e to add a file\n8) Adjust order as needed\n6) Even variables defined within run configuration can be processed, ordered and substituted \n\n![Read from file](./docs/example.png)\n\n### Caveats\n\n#### Hidden files \nHidden files (starting with a dot) are not displayed in Finder on `macOS` by default. To toggle\nhidden files in the Open dialog, press \u003ckbd\u003eCOMMAND\u003c/kbd\u003e + \u003ckbd\u003eSHIFT\u003c/kbd\u003e + \u003ckbd\u003e.\u003c/kbd\u003e.\nAlternatively, one can either tweak `macOS` to show hidden files or select any file using\nstandard Finder dialog and then manually edit path by double-clicking on the entry in the table.\n\n#### Experimental Integrations\nNot all run configurations available in IDEA-based IDEs are implemented similarly. Some of them differ significantly.\nIn certain cases (so far, only `Gradle` has been confirmed) the implementation exposes interfaces to integrate the EnvFile UI\nbut doesn't provide interfaces for it to actually make its work. Luckily, it was possible to make few assumptions about\nIDEA's internal implementation and make it work. Such integration is very fragile and it's not immediately clear if it\nwill affect any existing integrations and when it will break. For that reason there is a special option to\n`Enable Experimental Integrations` that can be enabled when desired and should prevent other integrations from breaking. \n\n### Examples\n\n#### .env\n\n```ini\n# This line is ignored since it's a comment\nSECRET_KEY=hip-hip-env-files\nVERSION=1.0\n```\n\nor\n\n```ini\n# This line is ignored since it's a comment\nSECRET_KEY hip-hip-env-files\nVERSION 1.0\n```\n\n#### JSON\n\n```yaml\n{\n    # JSON doesn't have comments but since JSON is subset of YAML\n    # We parse it with YAML parser and therefore have comments\n    # And even trialling commas in objects :)\n    \"SECRET_KEY\": \"hip-hip-env-files\",\n    \"VERSION\": \"1.0\", # All non-string literals should be enclosed in quotes; btw this is ignored too\n}\n```\n\n#### YAML\n\n```yaml\n# This line is ignored since it's a comment\nSECRET_KEY: hip-hip-env-files\nVERSION: \"1.0\" # All non-string literals should be enclosed in quotes; btw this is ignored too\n```\n\n#### Bash (workaround)\n\nThere was a number of requests to support extracting environment variables from bash scripts like:\n\n```bash\nexport SECRET_KEY=\"hip-hip-env-files\"\nexport VERSION=\"1.0\"\n```\n\nThe feasible way to do that is yet to be discovered (if any at all) so the plugin does not support that at the moment.\nOn the other hand there is a simple workaround that can be used for the time being. The example bash script from above\ncan be split into an `.env` file and a generic script that can be used to set environment variables on a command line:\n\n**.env**\n```ini\nSECRET_KEY=\"hip-hip-env-files\"\nVERSION=\"1.0\"\n```\n\n**set-env.sh**\n```bash\nwhile read -r line; do export $line; done \u003c .env\n```\n**usage**\n```\n$ . set-env.sh\n$ echo $VERSION\n1.0\n```\n\n### Variable Expansion\n\n`EnvFile` also supports environment variable substitution. It's optional and disabled by default.\nImplementation is based on [StringSubstitutor] so it's the best reference for how it works.\n\n#### Examples\n\nSyntax is *_derived_* from Bash but is way more primitive:\n```\nA=${FOO}            # A=\"\"        \u003c- unknown variables replaced by empty strings\nB=${FOO:-default}   # B=\"default\" \u003c- default values can be set as in Bash\nC=${B}              # C=\"default\" \u003c- it's possible to refer to other variables that were previously evaluated\nD=$${C}             # D=\"$${C}\"   \u003c- double dollar serves as an escape character\nE=$C                $ E=\"$C\"      \u003c- curly brackets are required\n```\n\n#### Precedence\n\nEnvironment variables are evaluated in the order they are defined in files.\nFiles are evaluated in the order defined in EnvFile UI.\nEnvironment variables defined in run configuration can be ordered relatively to files.\nOrder between environment variables defined in run configuration is not defined.  \n\nIt is possible to refer to any environment variables that were evaluated previously - within same file or from other sources.\n\n### Path Macro Substitution\n\n`EnvFile` can substitute JetBrains path macro references such as `$PROJECT_DIR$` etc. It's optional and disabled by default.\nFor details - see [\"Working with $PROJECT_DIR$ in plugin configuration options\"][Working with $PROJECT_DIR$ in plugin configuration options].  \n\n# Further Development\n\n- Add more formats (upon requests)\n- Add support for other JetBrains products/plugins (upon requests)\n- Add more tests (¯\\\\\\_(ツ)_/¯)\n\n# Building\n\nEnvFile uses Gradle for building.\n\n```bash\n$ ./gradlew clean test build\n  \n  BUILD SUCCESSFUL in 22s\n  59 actionable tasks: 59 executed\n  \n$ ls -1 build/distributions\n  Env File-2.1.1-SNAPSHOT.zip\n```\n\nIn order to open plugin's project in IDE, just open it as a Gradle project.\nThen use `intelij:runId` on the root of the project to launch an IDEA instance.\nYou can set `IDE` env var for the run configuration pointing at IDE folder (`IDE Folder/Content` on macOS) to test\nplugin with different versions.\n\n# Feedback\n\nAny feedback, bug reports and feature requests are highly appreciated!\n\nFeel free to create an issue, contact me using `Github` or just drop me an email to the address specified in\n[plugin.xml](./META-INF/plugin.xml)`/idea-plugin/vendor@email`.\n\n# License\n\nCopyright (c) 2017 Borys Pierov. See the [LICENSE](./LICENSE) file for license rights and limitations (MIT).\n\n[json-is-yaml]:                                               https://en.wikipedia.org/wiki/YAML#Comparison_with_JSON\n[latest-release]:                                             https://github.com/Ashald/EnvFile/releases/latest\n[StringSubstitutor]:                                          https://commons.apache.org/proper/commons-text/javadocs/api-release/org/apache/commons/text/StringSubstitutor.html\n[Working with $PROJECT_DIR$ in plugin configuration options]: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206781805-Working-with-PROJECT-DIR-in-plugin-configuration-options\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashald%2FEnvFile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashald%2FEnvFile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashald%2FEnvFile/lists"}