Skip to main content

open-codex-bridge

Python facade for running Codex app-server sessions and sharing their live conversation state over the Codex IPC owner/follower protocol.

On macOS and Linux, the bridge first joins the current desktop router at $CODEX_HOME/ipc/ipc.sock. It falls back to the older $TMPDIR/codex-ipc/ipc-{uid}.sock endpoint only when that compatibility socket is already active and passes the desktop ownership checks.

Library usage

from pathlib import Path

from codex_bridge import CodexIpcConfig, CodexIpcSession


async def main() -> None:
    config = CodexIpcConfig(
        codex_bin=Path("/opt/homebrew/bin/codex"),
        host_id="local",
        model="gpt-5.4",
        reasoning_effort="high",
    )

    async with CodexIpcSession(config) as session:
        thread = await session.start_new_thread()
        print(f"started {thread.id}")

        async for state in session.watch_state():
            # Forward this raw conversation state to a browser over WebSocket.
            print(state)


async def resume_existing(thread_id: str) -> None:
    async with CodexIpcSession(CodexIpcConfig(thread_id=thread_id)) as session:
        await session.hydrate_initial_state()
        await session.run_prompt("Summarize the current repo", wait_for_completion=True)

If codex_bin is omitted, the Codex SDK uses its pinned runtime resolver. Pass an openai_codex.CodexConfig as codex_config when you need full control over app-server launch arguments.

SSH app-server

SSH websocket transport is an open-codex-bridge extension, not part of the official openai-codex SDK:

from codex_bridge import (
    AppServerConfig,
    CodexIpcConfig,
    SshConnectionConfig,
    SshWebsocketAppServerConfig,
)

config = CodexIpcConfig(
    codex_config=AppServerConfig(
        ssh_websocket=SshWebsocketAppServerConfig(
            connection=SshConnectionConfig(host="builder.example.com"),
            remote_cwd="/srv/project",
        )
    )
)

The older app_server_config argument remains available as a compatibility alias for existing consumers.

TUI demo

The TUI is a development tool and is kept out of the core dependency set:

uv run --extra tui python examples/demo.py --codex-bin /opt/homebrew/bin/codex

Core imports such as import codex_bridge do not require textual, rich, or pillow.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_codex_bridge-0.1.12.tar.gz (179.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_codex_bridge-0.1.12-py3-none-any.whl (61.2 kB view details)

Uploaded Python 3

File details

Details for the file open_codex_bridge-0.1.12.tar.gz.

File metadata

  • Download URL: open_codex_bridge-0.1.12.tar.gz
  • Upload date:
  • Size: 179.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for open_codex_bridge-0.1.12.tar.gz
Algorithm Hash digest
SHA256 af3ac61cb4f03f3d170dfc877dffc94b747a4f9b7f4ae8cbd1b4accfdf648e62
MD5 0b482bbfe11c614580382b77c718bf9e
BLAKE2b-256 55fb4201eb76753e5f868c580707e7e8bcba5a5c5911f26a35d28ab011e5889e

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_codex_bridge-0.1.12.tar.gz:

Publisher: publish.yml on Sube-py/open-codex-bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file open_codex_bridge-0.1.12-py3-none-any.whl.

File metadata

File hashes

Hashes for open_codex_bridge-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 00a6058168e7af37ca4fbd1cb44109176852c8847ef5d3b045e5a4a9e43cb018
MD5 db0b09f77cfa61db217b90ae4936854d
BLAKE2b-256 3647e55e4fb647e3d2351037fd0424d157ef49de68ab5ec37aa2f26b0e14f7fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_codex_bridge-0.1.12-py3-none-any.whl:

Publisher: publish.yml on Sube-py/open-codex-bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.13

2 files

This release

0.1.12 This release

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page