The project has two main parts:
-
Unity package
- C# editor code that polls
.codex-unity-bridge/command.json - Dispatches actions to command handlers
- Writes
.codex-unity-bridge/response-{id}.json
- C# editor code that polls
-
Codex package and skill
- Python CLI:
codex-unity-bridge - Codex skill docs bundled with the Python package
- Handles atomic writes, polling, formatting, cleanup, and skill installation
- Python CLI:
package/
Editor/
CodexBridge.cs
ProdFact.CodexBridge.asmdef
Commands/
Models/
Tests/
skill/
pyproject.toml
src/codex_unity_bridge/
cli.py
skill/
SKILL.md
references/
tests/
Codex -> codex-unity-bridge -> .codex-unity-bridge/command.json
Unity Editor -> ProdFact.CodexBridge -> .codex-unity-bridge/response-{id}.json
codex-unity-bridge -> formatted terminal output
- no port management
- no firewall setup
- easy per-project isolation
- easy manual inspection when debugging
- works cleanly alongside the original Claude bridge when both are installed
Key types:
ProdFact.CodexBridge.CodexBridgeProdFact.CodexBridge.Commands.ICommandProdFact.CodexBridge.Models.CommandRequestProdFact.CodexBridge.Models.CommandResponse
The dispatcher keeps a command registry and only allows safe read-only commands during compilation or editor updates.
The CLI is responsible for:
- UUID generation
- atomic file writes
- exponential-backoff polling
- response validation
- cleanup of stale files
- Codex skill installation into
~/.codex/skills/unity-bridge/
- Python behavior is covered by
skill/tests/test_cli.py - Unity command and model behavior is covered by
package/Tests/Editor/