Codex (Unofficial) is a community-driven IntelliJ Platform plugin that talks to the Codex CLI, opening a dedicated ToolWindow so you can review messages, approvals, and applied diffs without leaving the IDE. The codebase targets IntelliJ IDEA 2025.2 and relies on JDK 21 for builds and runtime (per 252 branch requirements).
This repository is under active construction. Follow day-to-day progress in
TODO_JetBrains.md.
- Launch the Codex ToolWindow and wire it to a long-lived Codex CLI session.
 - Correlate Codex protocol events, retries, and telemetry for troubleshooting.
 - Preview turn diffs and apply them through IntelliJ write actions with telemetry hooks.
 - Surface CLI approval requests, status-bar indicators, and diagnostics helpers.
 - Stream exec output with ANSI coloring while exposing cancel and copy affordances.
 
Several chat UI tasks remain in progress; see the TODO tracker for the exact breakdown.
- Java Development Kit 21 (
JAVA_HOMEshould point to it before running Gradle; the build also configures toolchains to provision 21 automatically). - Codex CLI available on your PATH or configured in the plugin settings.
 - IntelliJ-based IDE 2025.2 or newer for installation and sandbox testing.
 
- Clone the repository and open it in IntelliJ IDEA or another JetBrains IDE.
 - Run 
./gradlew buildPluginto compile sources, execute tests, and produce a ZIP underbuild/distributions. - Install the ZIP inside your IDE via Settings > Plugins > Gear Icon > Install Plugin from Disk.
 - Launch a sandbox for manual testing with 
./gradlew runIde. 
- Windows: 
powershell -ExecutionPolicy Bypass -File scripts/dev/windows-smoke.ps1 - Linux: 
bash scripts/dev/linux-smoke.sh - macOS: 
bash scripts/dev/macos-smoke.sh 
Each script builds the plugin, launches a sandbox IDE, and prints the recent sandbox log. In the IDE, open the Codex (Unofficial) tool window and verify CLI detection and a simple chat turn.
For reproducible troubleshooting and CI artifacts, capture Gradle stdout/stderr to files. Use
--console=plain for cleaner logs and add --info or --stacktrace if you need more detail.
First, create a logs directory:
- PowerShell: 
New-Item -Force -ItemType Directory -Path .\build\logs | Out-Null - Bash/zsh: 
mkdir -p build/logs 
- Build/test/package:
.\gradlew.bat --no-daemon --console=plain test verifyPlugin buildPlugin *>&1 | Tee-Object -FilePath .\build\logs\gradle-build.log
 - Launch sandbox:
.\gradlew.bat --no-daemon --console=plain runIde *>&1 | Tee-Object -FilePath .\build\logs\runIde.log
 - Optional, record entire PS session:
Start-Transcript -Path .\build\logs\session.log -Append; .\gradlew.bat --no-daemon --console=plain runIde; Stop-Transcript
 
- Build/test/package:
./gradlew --no-daemon --console=plain test verifyPlugin buildPlugin 2>&1 | tee build/logs/gradle-build.log
 - Launch sandbox:
./gradlew --no-daemon --console=plain runIde 2>&1 | tee build/logs/runIde.log
 
- Build/test/package:
gradlew.bat --no-daemon --console=plain test verifyPlugin buildPlugin > build\logs\gradle-build.log 2>&1
 - Launch sandbox:
gradlew.bat --no-daemon --console=plain runIde > build\logs\runIde.log 2>&1
 
- Windows PowerShell
- Build/test/package with logging: 
powershell -ExecutionPolicy Bypass -File scripts/dev/win-build.ps1 - Run sandbox with logging: 
powershell -ExecutionPolicy Bypass -File scripts/dev/win-run-ide.ps1 - Verify pipeline (test, verifyPlugin, build): 
powershell -ExecutionPolicy Bypass -File scripts/dev/verify.ps1 - Tail recent sandbox logs: 
powershell -ExecutionPolicy Bypass -File scripts/dev/tail-ide-logs.ps1 
 - Build/test/package with logging: 
 - Linux/macOS (Bash/zsh)
- Build/test/package with logging: 
bash scripts/dev/unix-build.sh - Run sandbox with logging: 
bash scripts/dev/unix-run-ide.sh - Verify pipeline (test, verifyPlugin, build): 
bash scripts/dev/verify.sh - Clean sandbox paths: 
bash scripts/dev/clean-sandbox.sh - Tail recent sandbox logs: 
bash scripts/dev/tail-ide-logs.sh 
 - Build/test/package with logging: 
 
- 
Windows PowerShell
- Build, test, verify, package:
\.\gradlew.bat test verifyPlugin buildPlugin
 - Launch sandbox (recommended):
\.\gradlew.bat runIde
 - Launch sandbox with explicit sandbox paths (quote each -D as one arg):
\.\gradlew.bat "-Didea.system.path=$env:USERPROFILE\.codex-idea-sandbox\system" "-Didea.config.path=$env:USERPROFILE\.codex-idea-sandbox\config" "-Didea.plugins.path=$env:USERPROFILE\.codex-idea-sandbox\plugins" runIde
 
 - Build, test, verify, package:
 - 
Ubuntu/macOS (Bash/zsh)
- Build, test, verify, package:
./gradlew test verifyPlugin buildPlugin
 - Launch sandbox:
./gradlew runIde
 - Launch sandbox with explicit sandbox paths:
./gradlew "-Didea.system.path=$HOME/.codex-idea-sandbox/system" "-Didea.config.path=$HOME/.codex-idea-sandbox/config" "-Didea.plugins.path=$HOME/.codex-idea-sandbox/plugins" runIde
 
 - Build, test, verify, package:
 - 
Windows WSL (Ubuntu)
- Run from your Linux home (avoid 
/mnt/cto prevent socket issues):./gradlew test verifyPlugin buildPlugin
 - Launch sandbox with explicit sandbox paths:
./gradlew "-Didea.system.path=$HOME/.codex-idea-sandbox/system" "-Didea.config.path=$HOME/.codex-idea-sandbox/config" "-Didea.plugins.path=$HOME/.codex-idea-sandbox/plugins" runIde
 
 - Run from your Linux home (avoid 
 
In addition to console capture, the IDE writes rotating logs you can inspect after reproducing an issue:
- Default Gradle sandbox: 
build/idea-sandbox/system/log/idea.log - Explicit sandbox paths (as shown above):
- Windows: 
%USERPROFILE%\.codex-idea-sandbox\system\log\idea.log - Linux/macOS: 
$HOME/.codex-idea-sandbox/system/log/idea.log 
 - Windows: 
 
The Windows smoke script will print the recent sandbox log lines automatically. You can also tail the last lines manually, for example on Windows PowerShell:
Get-Content $env:USERPROFILE\.codex-idea-sandbox\system\log\idea.log -Tail 200
- Open Settings > Tools > Codex to verify the CLI path, WSL preference, and default session options. Per-project overrides are available in the same panel.
 - Use the Diagnostics tab in the Codex tool window to stream stderr output from the CLI. The copy button exports the buffer, and the clear button resets it (a log file with rotation is written under the IDE log directory).
 - If Codex becomes unresponsive, the plugin auto-restarts the CLI and marks the status bar health indicator as Stale or Restarting. Persistent errors surface as Error; collect diagnostics and the issue snapshot if this happens.
 - Run Codex (Unofficial): Report Issue from the Tools menu to copy a full environment snapshot (global/project settings, recent diagnostics, and health metrics) to your clipboard for GitHub issue reports.
 
If the sandbox IDE cannot find or retain your configured Codex CLI path:
- Set an absolute path in Settings > Tools > Codex > CLI path (e.g., 
/usr/local/bin/codexor/home/<you>/.local/bin/codex). - Ensure the binary is executable: 
chmod +x /path/to/codex. - Avoid shell aliases/functions; the plugin launches the executable directly.
 - Verify with the Test connection button (runs 
codex whoami). - For per-project differences, use the Project Overrides section in the same settings page.
 
Notes for WSL and multiple shells:
- On Windows + WSL, enable Prefer WSL when discovering Codex CLI or set a concrete path.
 - On Linux, the IDE's sandbox PATH may differ from your login shell. Provide a full path to be explicit.
 
To help diagnose IDE-level crashes:
- Reproduce the issue, then open Help > Show Log in Explorer/Finder and inspect 
idea.log. - Include the stack trace in the GitHub issue along with Diagnostics output from the Codex tool window.
 - From a terminal, confirm the CLI works independently: 
codex --versionandcodex whoami. 
- Keep 
JAVA_HOMEaligned with JDK 17; runscripts/dev/check-java.ps1(Windows) orscripts/dev/check-java.sh(Unix) if you are unsure. - Execute 
./gradlew testbefore committing; add focused tests when touching UI or protocol logic. - Track feature status in 
TODO_JetBrains.mdand update the checkboxes as you move tasks from "Not started" to "In progress" or "Completed". - Follow the commit format 
[T<task>.<sub>] <summary>; post-test=<pass>; compare=<stdout>as documented inAGENTS.md. 
- Versioning follows semver. See 
RELEASING.mdfor tagging policy and step-by-step instructions. - Draft release notes using 
RELEASE_NOTES_TEMPLATE.mdand attach artifacts from CI. 
src/main/kotlin- plugin sources grouped by feature packages (core,proto,ui).src/main/resources- plugin metadata, icons, and descriptors (META-INF/plugin.xml).src/test/kotlin- unit and UI tests mirroring the production package structure.scripts- helper scripts for environment setup and diagnostics.TODO_JetBrains.md- authoritative backlog and per-task status log.
Please read CONTRIBUTING.md for coding style, testing expectations, and pull request
etiquette. External contributions are welcome while the project is still stabilizing.
The project is distributed under the Apache License 2.0. See LICENSE for details.