https://github.com/fehnomenal/intellij-direnv
direnv integration for JetBrains IDEs
https://github.com/fehnomenal/intellij-direnv
direnv intellij intellij-direnv jetbrains jetbrains-ides
Last synced: 4 months ago
JSON representation
direnv integration for JetBrains IDEs
- Host: GitHub
- URL: https://github.com/fehnomenal/intellij-direnv
- Owner: fehnomenal
- License: mit
- Created: 2020-10-24T09:54:29.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-07-27T14:01:42.000Z (about 1 year ago)
- Last Synced: 2025-05-10T22:02:04.096Z (5 months ago)
- Topics: direnv, intellij, intellij-direnv, jetbrains, jetbrains-ides
- Language: Kotlin
- Homepage:
- Size: 486 KB
- Stars: 83
- Watchers: 3
- Forks: 23
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# direnv integration for JetBrains IDEs

[](https://plugins.jetbrains.com/plugin/15285)
[](https://plugins.jetbrains.com/plugin/15285)This plugin provides an action to import environment variables from [direnv](https://github.com/direnv/direnv) into the Java process that is running the IDE.
### Automatic Import before every Run/Debug
To automatically load the environment variables from a `/.envrc` file before each and every execution of a Run/Debug configuration, visit Settings > Tools > Direnv Settings and tick the relevant checkbox.On starting a Run/Debug job, a notification will show if the existing environment has been changed. The newly spawned process which executes the Run/Debug configuration will inherit the environment. If you often work with multiple project windows open in a single IDE instance, this is probably the best option for you.
### Automatic Import on Startup
To automatically load the environment variables from a `/.envrc` file when you open the project, visit Settings > Tools > Direnv Settings and tick the relevant checkbox.If "Automatic Import on Startup" is disabled, a popup notification will appear whenever a project with a `.envrc` file in the root is opened. You can load the `.envrc` file by clicking on the link in the notification.
### Manual Import
To manually load an `.envrc` file:
- If you have the main toolbar enabled (View > Appearance > Main Toolbar), a button next to the Reload All from Disk action will start the process.
- You can also right-click on any `.envrc` file and click Import Direnv to load its contents.
**Note**: This plugin handles only `.envrc` files in the project root automatically, but you can use the right click method to manually import any `.envrc` file that is in the project directory.
**Note**: You need `direnv` in your path, or you can specify the location of your direnv executable in Settings > Tools > Direnv Settings
## Installation
- Using IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "intellij-direnv" >
Install Plugin
- Manually:Download the [latest release](https://github.com/fehnomenal/intellij-direnv/releases/latest) and install it manually using
Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...## Building from source
```shell script
git clone https://github.com/fehnomenal/intellij-direnv
cd intellij-direnv
./gradlew buildPlugin
```The plugin is now in the folder `build/distributions/` and can be installed manually.
##### On NixOS
The gradle plugins downloads JetBrains' JRE and fails to execute it.
Add the following in `build.gradle.kts`:
```kotlin
tasks.withType {
projectExecutable.set(org.gradle.internal.jvm.Jvm.current().javaExecutable.absolutePath)
}
```---
Logo and icon source: https://github.com/direnv/direnv-logo/tree/0949c12bafa532da0b23482a1bb042cf41b654fc
---
Plugin based on the [IntelliJ Platform Plugin Template][template].[template]: https://github.com/JetBrains/intellij-platform-plugin-template