eel

GitHub

EEL提供统一API,使代码在本地、WSL和Docker环境中透明运行。封装进程执行、文件路径处理和平台检测,替代分散的底层调用,确保跨环境兼容性。

.claude/skills/eel/SKILL.md DetachHead/rebased

触发场景

需要跨环境(WSL/Docker)执行进程 处理跨环境文件路径操作 检测目标环境操作系统类型

安装

npx skills add DetachHead/rebased --skill eel -g -y
更多选项

非标准路径

npx skills add https://github.com/DetachHead/rebased/tree/master/.claude/skills/eel -g -y

不安装直接使用

npx skills use DetachHead/rebased@eel

指定 Agent (Claude Code)

npx skills add DetachHead/rebased --skill eel -a claude-code -g -y

安装 repo 全部 skill

npx skills add DetachHead/rebased --all -g -y

预览 repo 内 skill

npx skills add DetachHead/rebased --list

SKILL.md

Frontmatter
{
    "name": "eel",
    "description": "EEL (Execution Environment Layer) API for local, WSL, and Docker environments. Use when working with process execution (ProcessBuilder, GeneralCommandLine), file paths (java.io.File, nio.Path across environments), OS\/platform detection (SystemInfo), or environment variables in code that must support WSL or Docker."
}

EEL (Execution Environment Layer) Skill

EEL is a unified API that makes IntelliJ code work transparently across local, WSL, and Docker environments. It replaces scattered WSL checks, java.io.File, System.getenv, ProcessBuilder, and SystemInfo with a single abstraction.

Full documentation: community/platform/eel/docs/ (start with README.md)

Key Rules

  • Use nio.Path, not java.io.File. nio.Path integrates with EEL under the hood — NIO file operations are transparently routed through EEL file system providers, so Files.readString(path), Files.walk(path), etc. work correctly in remote environments (WSL, Docker) without any extra code. java.io.File has JBR compatibility patches but nio.Path is the proper API.
  • Use EelApi.exec for process execution, not ProcessBuilder. This ensures processes run in the correct environment.
  • Use EelPlatform for OS detection, not SystemInfo. SystemInfo reflects the IDE host machine, not the target environment.
  • localEel is a singleton that always represents the IDE host machine (where the IDE process runs). Use it only when you specifically need the local environment. For project-relative work, get the descriptor from the project or path instead.

Getting an EelDescriptor

// From a project (most common)
val descriptor = project.getEelDescriptor()

// From a path
val descriptor = Path.of("\\\\wsl.localhost\\Ubuntu\\home\\user").getEelDescriptor()

// Local environment singleton
val localApi: LocalEelApi = localEel

Running Processes

val eelApi = descriptor.toEelApi()

val process = eelApi.exec.spawnProcess("git")
    .args("--version")
    .eelIt()

val exitCode = process.exitCode.await()
val output = process.stdout.readAllBytes().toString(Charsets.UTF_8)

Path Conversion

// NIO Path → EelPath
val eelPath = nioPath.asEelPath()

// EelPath → NIO Path
val nioPath = eelPath.asNioPath()

// Use asEelPath() for environment-aware conversion (instead of EelPath.parse())
val eelPath = descriptor.asEelPath(project.basePath)

Platform Detection

val eelApi = descriptor.toEelApi()
when {
    eelApi.platform.isPosix -> // Linux, macOS, FreeBSD
    eelApi.platform.isWindows -> // Windows
    eelApi.platform.isMac -> // macOS specifically
}

Core Concepts

EelDescriptor vs EelMachine

  • EelDescriptor: lightweight, durable marker for a path-based access to an environment. Use for most operations.
  • EelMachine: physical host instance. Use as cache key when managing shared resources (connection pools, etc.). Multiple descriptors can resolve to the same machine (e.g., \\wsl$\Ubuntu and \\wsl.localhost\Ubuntu).

EelApi Subsystems

interface EelApi {
  val exec: EelExecApi           // Process execution
  val tunnels: EelTunnelsApi     // Network operations
  val archive: EelArchiveApi     // Archive/tar operations
  val platform: EelPlatformApi   // Platform detection
  val userInfo: EelUserInfoApi   // User information
}

Best Practices

  1. Write environment-agnostic code — avoid checking for LocalEelDescriptor; use EEL API uniformly
  2. Prefer toEelApi() over toEelApiBlocking() — use the suspending version to avoid blocking threads
  3. Use asEelPath() helpers — avoid manual WSL path conversion
  4. Cache by EelMachine when managing shared resources across descriptors
  5. Close resources — properly close tunnels, archive operations, and long-lived connections

Documentation

  • EEL Architecture: community/platform/eel/docs/README.md
  • EEL Tutorial: community/platform/eel/docs/EelApi_Tutorial.md
  • NIO Integration: community/platform/eel/docs/EelApi_NIO_Integration.md
  • Path Conversion: community/platform/eel/docs/EelApi_Path_Conversion.md
  • Real-World Examples: community/platform/eel/docs/EelApi_Real_World_Examples.md

版本历史

  • 1f8708d 当前 2026-08-16 15:39

同 Skill 集合

.agents/skills/actions/SKILL.md
.agents/skills/code-style/SKILL.md
.agents/skills/commits/SKILL.md
.agents/skills/debugging/SKILL.md
.agents/skills/driver-ui-tests/SKILL.md
.agents/skills/eel/SKILL.md
.agents/skills/extract-module/SKILL.md
.agents/skills/module-dependencies/SKILL.md
.agents/skills/module-set-pluginization/SKILL.md
.agents/skills/notebook-for-experiment/SKILL.md
.agents/skills/pseudo-kmp/SKILL.md
.agents/skills/registry/SKILL.md
.agents/skills/remote-dev/SKILL.md
.agents/skills/safe-push/SKILL.md
.agents/skills/ssr/SKILL.md
.agents/skills/testing-internals/SKILL.md
.agents/skills/testing/SKILL.md
.agents/skills/ui-accessibility/SKILL.md
.agents/skills/writing-tests/SKILL.md
.claude/skills/actions/SKILL.md
.claude/skills/code-style/SKILL.md
.claude/skills/commits/SKILL.md
.claude/skills/debugging/SKILL.md
.claude/skills/driver-ui-tests/SKILL.md
.claude/skills/extract-module/SKILL.md
.claude/skills/jewel-pr-preparer/SKILL.md
.claude/skills/jewel-release-helper/SKILL.md
.claude/skills/managing-youtrack/SKILL.md
.claude/skills/module-dependencies/SKILL.md
.claude/skills/module-set-pluginization/SKILL.md
.claude/skills/notebook-for-experiment/SKILL.md
.claude/skills/pseudo-kmp/SKILL.md
.claude/skills/registry/SKILL.md
.claude/skills/remote-dev/SKILL.md
.claude/skills/safe-push/SKILL.md
.claude/skills/ssr/SKILL.md
.claude/skills/testing-internals/SKILL.md
.claude/skills/testing/SKILL.md
.claude/skills/ui-accessibility/SKILL.md
.claude/skills/writing-tests/SKILL.md

元信息

文件数
0
版本
1f8708d
Hash
ea0275a0
收录时间
2026-08-16 15:39

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-17 06:19
浙ICP备14020137号-1 $访客地图$