A lightweight file-based IPC bridge that lets external tools, coding agents, and test suites execute Lua commands inside a running BG:EE, SoD, BG2:EE, EET, or IWD:EE game with EEex and read structured JSON results back — no sockets, no FFI, no external dependencies.
Optional developer tool in Chriz Easy BG & Chriz Easy IWD · bg.chrizfader.org
- AI-assisted modding — let coding agents inspect and manipulate live game state (see CLAUDE.md.example)
- Automated testing — run test suites against a running game from CI or scripts (
tools/smoke-test.ps1) - Live debugging & diagnostics — query sprites, spells, effects, and variables without alt-tabbing to the in-game console
- A supported Infinity Engine EE game on Windows (runtime-tested on 2.7.3.0 and 2.6.6.0)
- EEex
0.10.xthrough1.3.xwith the LuaJIT component, which provides the Luaio/oslibraries this mod depends on:- EEex v1.2.x and v1.3.x: install component 1 (Main) and component 8 (LuaJIT)
- EEex v1.0.0: choose the Experimental quick-menu tier;
0.10.x/0.11.x: Experimental - Use LuaJIT
- Install EEex Remote Console after EEex — the installer verifies capabilities (
override/M___EEex.luaandLuaPatchMode=REPLACE_INTERNAL_WITH_EXTERNALinInfinityLoader.ini) rather than hardcoded component logs
| EEex version | Status | Verification |
|---|---|---|
| 0.9.x | Not supported | No LuaJIT component; installer refuses |
| 0.10.x | Supported | Not separately verified |
| 0.11.x | Supported | Runtime-tested: v0.11.0-alpha on BG2:EE, full 22-case suite passed |
| 1.0.x | Supported | Source-verified only: required EEex APIs confirmed in v1.0.0 source |
| 1.2.x | Supported | Runtime-tested: v1.2.0 on BG2:EE 2.6.6.0 (22/22) and EET 2.7.3.0 (pong) |
| 1.3.x | Supported | Runtime-tested: v1.3.1 on EET 2.7.3.0 (main menu & world screen 22/22) |
| Game | Status |
|---|---|
| BG:EE (incl. SoD) | Supported (GAME_IS ~bgee~ matches BG:EE + SoD) |
| BG2:EE | Supported — runtime-tested on 2.6.6.0 |
| EET | Supported — runtime-tested on 2.7.3.0 (v0.2.1 checklist passed) |
| IWD:EE | Supported — IWD:EE 2.7.3.0 + EEex v1.3.1 verified in Chriz Easy IWD labs |
- Install EEex v1.2.0 or later with component 1 (Main) and component 8 (LuaJIT).
- Copy the
eeexremotefolder andsetup-eeexremote.tp2into your game directory. - Run
setup-eeexremote.exe(or WeiDU) after EEex. - Launch via
InfinityLoader.exe— the console is live from the main menu onward.
Both reference clients write commands atomically, tag them with request IDs so stale results are rejected, and share exit codes (0 ok, 1 Lua runtime or parse error, 2 timeout, 3 usage error).
$override = "C:\Games\Baldur's Gate II Enhanced Edition\override"
.\tools\eeex-remote.ps1 $override 'return 2 + 2' # Inline Lua
.\tools\eeex-remote.ps1 $override '@tools/scripts/party.lua' # Quote @paths in PowerShell
.\tools\eeex-remote.ps1 $override -Api '^EEex_Sprite_' -TimeoutSec 10 # List live API globals
'return 2 + 2' | pwsh -File tools\eeex-remote.ps1 $override - # Piped stdin (pwsh -File)
.\tools\eeex-remote.ps1 $override 'return 2 + 2' 5 # Custom timeout (seconds)OVERRIDE="/path/to/Baldur's Gate II Enhanced Edition/override"
tools/eeex-remote.sh "$OVERRIDE" 'return 2 + 2'
tools/eeex-remote.sh "$OVERRIDE" 'print(EEex_Sprite_GetInPortrait(0):getName())'
tools/eeex-remote.sh "$OVERRIDE" @tools/scripts/party.lua
tools/eeex-remote.sh "$OVERRIDE" --api '^EEex_Sprite_'
tools/eeex-remote.sh "$OVERRIDE" - <<< 'return 2 + 2'External Tool Game Process
───────────── ────────────
write temp file, rename to EEexRemote.Poll() every render frame:
eeex_remote_cmd.lua ────────────> claims atomically, compiles ONE chunk,
runs under xpcall + watchdog, captures print()
poll & read
eeex_remote_result.json <──────────── writes temp file, renames atomically
An invisible 1×1 menu element (EEexRC.menu) hooks WORLD_ACTIONBAR and START via EEex_Menu_AddAfterMainFileLoadedListener, opening before each host's onOpen so START_SP redirects are never covered (v0.2.1). Polling is render-driven and continues while the game is paused. Every command compiles as one Lua chunk: locals are shared across all lines of the script, and globals persist across successive commands.
- Delete any stale
override/eeex_remote_result.json. - Write Lua atomically (temp file in
override/, then rename) tooverride/eeex_remote_cmd.lua. - Poll for
override/eeex_remote_result.json, checkidif sent, read JSON, and delete it.
Leading comment directives (must be the very first lines; ignored as comments by v0.1.0 servers):
| Directive | Effect |
|---|---|
--@id=<token> |
Echoed as id in the result so clients reject stale replies |
--@watchdog=<N> |
Overrides instruction limit (default 200000000, ~1–2 s runaway guard) |
--@nowatchdog |
Disables the watchdog for legitimately long scripts |
{
"protocol": "1.1",
"status": "ok | error | parse_error",
"id": "echo of --@id (only if sent)",
"error": "message (only on error / parse_error)",
"traceback": "Lua stack traceback (only on runtime error)",
"durationMs": 3,
"returnValue": "tostring of first return value (legacy; only if non-nil)",
"returnValues": ["every return value as structured JSON (depth <= 6, <= 256 KB each)"],
"output": ["captured print() lines"]
}On UI load and F5 reload, override/eeex_remote_ready.json logs {"protocol":"1.1","luajit":true,"screens":["WORLD_ACTIONBAR","START"],"disabled":false,"timestamp":"..."} — diagnostics only (not deleted on exit; send tools/scripts/ping.lua for liveness).
return EEexRemote.ListGlobals("^EEex_Sprite_") -- live global types & source:line
return EEexRemote.Info() -- protocol, luajit, io, screens, disabled, eeexActiveping.lua— liveness check + capability report ("pong",EEexRemote.Info())list-api.lua— overview of installed EEex globals grouped by prefixparty.lua— active party names in portrait order
| Step | File | Action |
|---|---|---|
| 1 | override/eeex_remote_result.json |
Delete any stale result first |
| 2 | Temp file inside override/ |
Write --@id=<unique> + Lua source |
| 3 | override/eeex_remote_cmd.lua |
Rename temp file onto this name (atomic on same volume) |
| 4 | override/eeex_remote_result.json |
Poll (~10 s timeout); if id differs, delete & keep polling, else read & delete |
Match the reference exit codes (0 ok, 1 Lua/parse error, 2 timeout, 3 usage).
- Security: Executes arbitrary Lua with full EEex engine and file I/O access; never install in directories writable by untrusted users or processes.
- Limitations: Forced dialogues, the spellbook (
MAGE), and Record (CHARACTER) screens suspendWORLD_ACTIONBARpolling until closed; serial one-command-at-a-time IPC (~200 ms round-trip); text/JSON only (keep returned tables andprint()output well under megabyte scale). - Patch 2.7 won't launch: Update EEex to v1.2.0+ (delete
[Auto-Generated]inInfinityLoader.iniif needed). - Timeouts / disabled notice: Verify the game is on the main menu or world screen,
InfinityLoader.inihasLuaPatchMode=REPLACE_INTERNAL_WITH_EXTERNAL, and Generalized Biffing never biffsM_EEexRC.luaorEEexRC.menu.
- Release verification checklist & lab evidence: docs/verification-checklist.md (
tests/static-compatibility.Tests.ps1) - Release history: CHANGELOG.md · EEex docs: https://eeex-docs.readthedocs.io/
Licensed under the MIT License.