platform/eel/docs/README.md
Welcome to the Eel API documentation. This documentation provides comprehensive information about the EelApi, which is a unified interface for interacting with different execution environments in IntelliJ IDEA.
The Eel API provides a consistent way to interact with different execution environments, such as:
It abstracts away the differences between these environments, allowing you to write code that works consistently across them.
Understanding these two fundamental concepts is crucial for working effectively with the Eel API:
EelDescriptor - A specific path-based access to an environment:
\\wsl$\Ubuntu vs \\wsl.localhost\Ubuntu)EelMachine - The physical or logical host:
Example:
// Two different descriptors
val desc1 = Path.of("\\\\wsl$\\Ubuntu\\home").getEelDescriptor()
val desc2 = Path.of("\\\\wsl.localhost\\Ubuntu\\home").getEelDescriptor()
// But they point to the same machine
desc1.machine === desc2.machine // true
// Use machine for shared caching
val cache: Map<EelMachine, Data> = mutableMapOf()
cache[desc1.machine] = data // Accessible via desc2.machine as well
New to EelApi? Start with the EelApi Tutorial for a comprehensive introduction to core concepts and usage patterns.
This documentation is organized into the following tutorials and guides:
EelApi Tutorial - A comprehensive introduction to EelApi, covering core concepts, best practices, and common usage patterns.
EelApi LocalEelDescriptor - Explains LocalEelDescriptor and LocalEelMachine, their role in representing the local environment, and when it's appropriate to check for local environments.
EelApi Path Conversion - Explains how to convert between NIO and EEL paths for interoperability with standard Java APIs.
EelApi NIO Integration - Explains EelPathUtils, working with file systems through nio.Path, and JBR patches for io.File compatibility.
EelApi Real-World Examples - Provides concrete examples of how EelApi is used in actual IntelliJ IDEA plugins and features.
Opening Projects with EelApi - Explains how to open projects in WSL and Docker using EelApi, with configuration options and comparisons to traditional approaches.
EelApi as Run Targets 2.0 - Explains the relationship between EelApi and Run Targets, the technology behind IJent, and the architectural advantages.
The EelApi consists of several key components:
// From a path
val descriptor = Path.of("\\\\wsl.localhost\\Ubuntu\\home\\user").getEelDescriptor()
// From a project
val descriptor = project.getEelDescriptor()
// Suspending (preferred)
val eelApi = descriptor.toEelApi()
// Blocking
val eelApi = descriptor.toEelApiBlocking()
// For local environment (cached singleton)
val localApi = localEel
val process = eelApi.exec.spawnProcess("git")
.args("--version")
.eelIt()
val exitCode = process.exitCode.await()
val output = process.stdout.readAllBytes().toString(Charsets.UTF_8)
// NIO Path → EelPath
val eelPath = nioPath.asEelPath()
// EelPath → NIO Path
val nioPath = eelPath.asNioPath()
The EelApi is currently marked as @ApiStatus.Experimental, which means it's still under development and may change in future versions. Always check the latest documentation and be prepared to update your code as the API evolves.
If you find any issues or have suggestions for improving the EelApi or its documentation, please file an issue in the IntelliJ IDEA issue tracker or contact us in the Slack channel #ij-eel.
The Eel API is built on top of IJent (IntelliJ Agent), a Rust-based agent that runs in remote environments.