Back to JetBrains

EelApi: Taking Your Plugin From Local to WSL and Dev Containers

JetBrainsNovember 17, 202647m
In a Nutshell

EelApi solves the problem of plugin code needing to access files and run tools across different project environments (local, WSL, dev containers) without each plugin maintaining separate integration paths. Instead of plugins branching on environment type, they call a single EelApi interface obtained from a project descriptor, which routes file operations and process execution through a small native agent deployed beside the project files. The API handles path conversion between NIO and environment-specific formats, manages process lifecycle with proper ownership scopes, and abstracts away the complexity of WSL's 9P protocol limitations and Docker container access.

AI-Generated Notes

These notes were generated by AI and may contain inaccuracies.

Project environment refers to where project files live and where tools run for that project. The question of why EelApi is needed when file and process APIs already exist is addressed through examples showing different environments.

For a local project with LaunchQL (a TypeScript app for planning team launches), the IDE plugin reads package.json and runs checks using pnpm. In this local case, IDEA, the project, and its tools are all on the user's laptop, making JDK's file and process APIs reach the same environment straightforwardly.

When a company provides Windows laptops but LaunchQL deploys to Linux services, developers check out projects inside Ubuntu in WSL. Windows exposes Linux files through a UNC path like \wsl.localhost\Ubuntu\home\user\LaunchQL. Windows file access historically went through a Windows 9P client to a server started by WSL init.

The Windows view is not equivalent to Linux file system access. When pnpm dependencies are symlinks, Linux tools can follow them and read package sources, but accessing via UNC path can fail. This breaks model resolution, navigation, and completion in IDEA. Metadata boundaries exist because 9P servers support Linux metadata including permissions, but Windows file APIs don't provide the full POSIX view with numeric user/group IDs and mode bits.

Starting tools requires WSL execution, and network connections inside WSL virtual machines need separate integration. The host process builder from JDK doesn't start Linux tools just because project files are in WSL.

For developing LaunchQL in a dev container without bind mounts or published application ports, Docker engine manages the container on the Docker host. IDE needs to list children, read attributes, follow links, and edit individual files, but docker cp has limitations. Starting processes like pnpm and reaching services inside the container requires separate integration for every operation.

Remote development runs an IDE backend in WSL or container and connects the IDE client to it, but the backend brings its runtime and plugins, consuming memory. The client session manages connection to the backend, with costs mattering for new local environments. Two processes run: JetBrains IDE client and the backend.

The question arises whether the full IDE can stay on the laptop while only a small native binary runs beside project files to execute tools and access files. Instead of asking Windows to interpret Linux files, requests go to a binary agent inside Linux to get attributes, resolve links, and read file content.

Requirements include a small native binary, efficient RPC protocol with optimized transport, and a new file system provider for transparency in file operations. Fleet IDE provided such a binary as a starting point. The intelligent platform agent accesses files and starts processes.

For WSL scenarios, the IDE copies the agent binary into Ubuntu inside WSL and starts it. The launcher uses wsl.exe to start only the agent process. After starting, an RPC channel runs on top of stdin/stdout transport. Hyper-V sockets optimize bulk file operations on Windows for WSL.

Platform and plugin code inside the IDE can use JDK NIO file operations through the agent NIO provider, which directs operations to the agent API. Direct agent API calls are possible for starting processes. Two methods exist for accessing the agent: standard input/output as default, and Hyper-V sockets.

File operations begin with a string containing the double-cell UNC path. The IDE runtime creates a new path through the file system. When reading files, operations route to the correct NIO provider by matching path prefixes to registered providers. RPC methods call the agent, which makes Linux kernel syscalls and returns results.

Legacy code using java.io.File calls is supported through conversion to NIO. The agent starts pnpm in the environment and returns process identity and output. The IDE stays on the host while files and tools remain with the project in WSL.

The same arrangement works in dev containers by deploying and running the agent inside the Docker container, connecting through standard input/output for RPC calls. Process starting requires obtaining the agent and executing commands for WSL, starting local processes for local environments, or obtaining the agent from Docker for dev containers.

Environment variables and platform information need the same branching logic. This creates a plugin developer problem where users choose project environments, requiring every plugin to maintain multiple integrations.

The solution eliminates branching through a common API including local environments. The project exists somewhere, and a chain of methods executes get descriptor to EelApi, returning the API for the specific project environment. The caller sees the EelApi interface and uses the returned instance.

For WSL projects, the returned API is backed by the distribution's agent. For dev containers, it's backed by the agent inside the container. The same implementation classes work with different sessions and descriptors. Environment selection happens during API acquisition from the descriptor, not as local/remote branching inside each operation.

For LaunchQL project checks, Kotlin code runs inside the IDE JVM, reads package.json, finds the check script, runs pnpm run check, and shows output and exit status. The plugin calls the IntelliJ platform's EelApi to work in the project environment, whether local, WSL, or dev container.

Implementation starts by getting the API through delegation to a project-level service. The platform supplies a coroutine scope for work ownership. The constructor receives the coroutine scope. Getting the project descriptor identifies access through a particular namespace without performing IO yet. The descriptor can exist after a container stops before recreation.

Calling getEelApi obtains access for that namespace, suspending and potentially connecting, deploying an agent, and possibly failing. For local projects, it returns local implementations based on JDK calls without failure.

EelMachine identifies the machine behind the namespace, useful when sharing resources. Multiple descriptors can refer to one machine. Preparing paths for file reads and launches requires handling the project absolute NIO path in Ubuntu format like \wsl.localhost\Ubuntu\home\alex\launchql. On Windows, strings include the WSL prefix as UNC paths.

Package.json resolves and reads through NIO using eel files helpers with the same behavior as Files calls. The path requires conversion because tools running inside WSL see absolute Linux paths like /home/alex/launchql. EelPath converts roots into EelPath for working directories, while asNioPath converts back preserving the descriptor namespace for NIO operations and serialization.

For dev containers opened from Linux IDEs, paths have different prefixes registered for IDE use. EelPath gives the tool path without the root prefix, while asNioPath restores the representation. Working directory setup requires understanding where to use absolute paths versus NIO paths.

Finding tools to start in the project environment requires configuration offerings when tools aren't found. Language servers provide their own discovery and launchers, and Windows command scripts need proper launchers. Environment variables like NODE_OPTIONS set inside WSL are received using EelApi for logging or other purposes.

The launch job creates a coroutine job. The launch builder prepares EelPath environment values. The executable launches with run and check as separate arguments. Working directory uses the target path, supplying target variables while overriding inheritance values. The scope method on the launch builder sets the coroutine scope for the process about to start.

The tech closes stdin immediately when no input is needed. Collection helpers treat stdout and stderr as concurrent file holders. The tool returns byte arrays and exit codes, buffering output in memory and potentially returning partial output after stream copy errors. Streaming readers are available for larger outputs when complete diagnostics matter.

Multiple lifetimes exist: the platform supplies the project service's coroutine scope, cancelled when closing the project or unloading the plugin. Each check is a child operation on its process and output reading work. The scope method belongs to the launch builder, not the returned process. Binding processes to the whole service would let cancelled checks continue running until service end.

Process binding waits for exit, invoking process cleanup when scope cancels. Stream collectors must finish or cancel. Awaiting exit code alone doesn't establish ownership. The environment session has separate lifetime for other IDE features needing access after checks finish.

Run methods return launch jobs. Successful completion shows output and status. Non-zero exit codes indicate expected tool problems. Cancel action cancels the check's job. Project closing or plugin unloading cancels the owner scope. Process cleanup invokes because of binding to the job.

When dev containers stop or WSL stops responding, plugins report check completion failure and connection failure to the project environment. Owned work requires execution context on the IO dispatcher for blocking operations like EelApi calls. Results switch to UI dispatcher for reporting.

Existing local features evolve into EelApi execution with larger code requiring lifetime management, but the API prevents errors. Migration kits help transition to EelApi, adding warnings for incorrect path usage in wrong environments. ProcessBuilder running only local processes with EelPath from different environments triggers warnings.

EelApi accesses files, tools, and resources in project environments. Targets API runs local projects in different environments orthogonally to EelApi. Split mode for remote development may require EelApi usage on backend parts to access project files as previously done with JDK calls.

Plugin developers should check how plugins work with EelApi by selecting one feature that runs tools or accesses files. Start by getting the project environment, checking tools used and required environment variables. Consider operation ownership including test completion, cancellation, project close, and lost access. Test the feature with local projects, WSL, and dev containers for practical migration.

EelApi was discovered by community members using it in the Bash support plugin. Questions about storing paths led to finding internal usage like EelMachine.internalName in PyCharm plugins. The API is currently experimental with plans for stabilization, documentation writing, and inclusion in IntelliJ Platform SDK. Plugin developers need stable APIs without migration concerns.

The platform uses EelApi widely, with IDEA 2026.1 providing native dev container support using EelApi for build tools, Git, and other integrations including Spring. The API won't be modified significantly. It is public with experimental annotations indicating potential changes, but not internal. Internal parts exist but aren't needed for typical use cases. NIO paths handle serialization without internal APIs.

Remote development and EelApi are orthogonal approaches. Local development remains viable with increasingly efficient laptops handling large repository compilation in tens of minutes. Dev containers provide important isolation layers, especially in AI eras, allowing multiple containers with worktrees to run independently without laptop restrictions. Isolation encapsulates everything so container failures don't affect host systems.

The current situation represents a real worst-case scenario that will continue evolving. Two distinct worlds exist for remote development, where different tasks require different approaches.

Question: Which of these is not an environment that Eel API abstracts away?

  • Local machine
  • WSL
  • Dev container
  • Game Boy

The correct answer is Game Boy, as Eel API does not abstract this environment.

Question: IJent is faster than WSL's built-in file access. Which protocol does that file access use?

  • FTP
  • SMB
  • 9P
  • NFS

The correct answer is 9P.

About the 9P Protocol

9P is quite an old protocol that Windows reanimated for file synchronization between the WSL file system and the Windows one. It is not widely used by other utilities.

Important Clarification on Performance Claims

The statement that IJent is faster than 9P is not entirely true. IJent is faster only in batch operations where multiple files need to be processed. 9P provides only file access, while IJent's agent provides an RPC protocol that allows getting flow files, which speeds up indexing operations.

Alexander was thanked for providing the presentation.

Keep JetBrains in your library

Save the videos and channels worth coming back to, and find them again in one place.