Run OpenAI’s Codex CLI against any Mirage workspace by mounting it as a real filesystem via FUSE.
OpenAI Codex can use Mirage through either an installable TypeScript plugin or a FUSE mount. The Python integration FUSE-mounts a workspace as a normal host directory, so Codex’s built-in filesystem and shell tools operate on Mirage without a separate tool server.
from mirage import Mount, MountBackend, MountMode, Workspacefrom mirage.resource.ram import RAMResourcewith Workspace( {"/": Mount(RAMResource(), mode=MountMode.WRITE, backend=MountBackend.FUSE)}) as ws: print(f"cd {ws.fuse_mountpoint} && codex") input("Press Enter when done...")
The mountpoint behaves like a regular directory. Codex’s built-in file and shell tools all dispatch through Mirage’s ops layer. For the Codex app, open the mountpoint as the project folder instead of starting codex from it.
Use Python FUSE when you want Codex’s built-in filesystem tools to see Mirage as an ordinary directory. This works in the CLI and app, but requires an OS FUSE driver and does not add Mirage’s agent-level stale-write check.Use the TypeScript plugin when you want named Mirage tools, Pi-style stale-write protection, and plugin installation through Codex. The plugin uses Mirage’s standard MCP adapter internally.