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.

Metadata

Release files for open-codex-bridge 0.1.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for open-codex-bridge 0.1.13
File Size Uploaded Provenance Actions
open_codex_bridge-0.1.13.tar.gz 181.6 kB With provenance Details for open_codex_bridge-0.1.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for open-codex-bridge 0.1.13
File Interpreter ABI Platform Actions
open_codex_bridge-0.1.13-py3-none-any.whl Python 3 none any Details for open_codex_bridge-0.1.13-py3-none-any.whl

Total release size: 243.3 kB

Release files / open_codex_bridge-0.1.13.tar.gz

Download URL open_codex_bridge-0.1.13.tar.gz
Size 181.6 kB
Tags Source
SHA-256 checksum
How to use checksums
71cdafd9d5d059d7cb374039ee53ee0919a1231b21fb6f0ee6331aee4509bea7
BLAKE2b-256 checksum
How to use checksums
35257afbded4ab1b5d99c981d3c7f0ef6d19072ccd790000ff7074e52e50972e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.

Transparency log

Release files / open_codex_bridge-0.1.13-py3-none-any.whl

Download URL open_codex_bridge-0.1.13-py3-none-any.whl
Size 61.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
947efcab7d41d7246f05280e905f73990d16718cd26e21c033c081dfe6ba5cba
BLAKE2b-256 checksum
How to use checksums
d80b3c976694f7e8d73696a60e2e9fd692b6d7d98245a4a812214350f7586038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.

Transparency log

Security for open-codex-bridge 0.1.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for open_codex_bridge-0.1.13.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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