Skip to main content

Local Claude Code and Codex bridge for RelayAI sessions

Project description

RelayAI Local Bridge

This package lets a local machine claim a RelayAI bridge session and process incoming app messages using a local Claude or Codex runtime.

Prerequisites

Before starting the RelayAI bridge on a machine, install and authenticate any local runtimes you want that bridge to support.

Claude Code

RelayAI does not install Claude Code for you. Install Claude Code locally first, then make sure it can start successfully from your terminal.

Official setup docs:

Typical install:

npm install -g @anthropic-ai/claude-code
claude

Notes:

  • Anthropic's current docs list Node.js 18+ as a prerequisite.
  • Run claude once and complete authentication before using Claude-backed bridge sessions.

Codex CLI

RelayAI does not install Codex for you. Install the Codex CLI locally first, then make sure it is authenticated and runnable from your terminal.

Official sources:

Typical install:

# npm
npm install -g @openai/codex

# or Homebrew on macOS
brew install --cask codex

# then start Codex and complete sign-in
codex

Notes:

  • The current Codex README documents npm install -g @openai/codex and brew install --cask codex.
  • Run codex once and complete either ChatGPT sign-in or API-key setup before using Codex-backed bridge sessions.
  • RelayAI uses the local codex CLI and codex app-server; the bridge will report Codex as unavailable until the CLI is installed and authenticated.

What it does

  1. Authenticates as a paired bridge device
  2. Waits for a RelayAI bridge-session announcement from the app
  3. Subscribes to /api/sessions/{id}/events/stream
  4. Watches for new user messages
  5. Runs Claude or Codex locally on your machine
  6. Streams assistant deltas back to RelayAI
  7. Returns to idle when a session is stopped in the app

Install

Recommended install for users:

python3 -m pip install --upgrade relayai-local-bridge

That installs the published RelayAI bridge package from PyPI. It does not install Claude Code or Codex CLI for you.

If you are working from a local RelayAI checkout and want the unreleased repo version instead:

cd local-bridge
python3 -m pip install .

Update an existing bridge

For most users:

python3 -m pip install --upgrade relayai-local-bridge

If you are updating from a local RelayAI checkout after pulling new repo changes:

cd /Users/alexnuccio/Documents/projects/RelayAI/local-bridge
python3 -m pip install --upgrade .

You do not need to pair again after a normal bridge update. Re-pair only if you intentionally switch to a different RelayAI account or want to clear the saved bridge credentials.

First run

Preferred launch command:

relayai-local-bridge \
  --base-url https://relay.nrsoftware.ai \
  --cwd /path/to/local/repo \
  --claude-cli-path "$(command -v claude)" \
  --codex-cli-path "$(command -v codex)"

Those CLI-path flags are optional. The bridge can still run without them, but passing the explicit local executable paths is the preferred setup because it makes the runtime choice unambiguous and avoids depending on whatever binary the SDK or shell happens to resolve by default.

Minimal launch command:

relayai-local-bridge \
  --base-url https://relay.nrsoftware.ai \
  --cwd /path/to/local/repo

If the bridge is not paired yet, it prints a one-time pairing code. Approve that code in the app under Settings -> Bridge Pairing.

After approval, the bridge stores its own credentials locally and reuses them automatically.

Re-pair to a new account or phone

If you sign into RelayAI with a different account, or you want this machine to pair again from scratch, clear the stored bridge credentials and rerun the bridge:

relayai-local-bridge \
  --base-url https://relay.nrsoftware.ai \
  --cwd /path/to/local/repo \
  --reset-auth

That removes the saved bridge authentication for this machine and starts a fresh pairing flow. Approve the new one-time pairing code in the app under Settings -> Bridge Pairing.

Optional flags

  • --session-id to attach to an existing RelayAI session
  • --ca-bundle to point Python at a specific trusted CA bundle if your local OpenSSL trust store cannot validate the RelayAI certificate chain
  • --reset-auth to clear stored bridge credentials and force a new pairing flow
  • --credentials-file to override the default credential storage location
  • --claude-cli-path to override the Claude CLI path for bridge-backed Claude sessions
  • --codex-cli-path to override the Codex CLI path for bridge-backed Codex sessions
  • --verbose to enable debug-level bridge, Claude, and Codex runtime logs
  • --log-level DEBUG|INFO|WARNING|ERROR to set the bridge log level explicitly

Debugging

For verbose bridge logs while debugging a stuck session:

relayai-local-bridge \
  --base-url https://relay.nrsoftware.ai \
  --cwd /path/to/local/repo \
  --verbose

You can also set RELAYAI_VERBOSE=1 or RELAYAI_LOG_LEVEL=DEBUG.

Verbose logs include:

  • RelayAI event receipt for each bridge session
  • Claude and Codex turn start/completion details
  • first runtime text delta timing
  • approval request and resolution flow
  • watchdog checks and recovery reasons
  • Codex app-server request/notification and stderr tracing

Notes

  • --cwd should point at the local repo you want Claude or Codex to work in.
  • The published bridge package version is tracked in pyproject.toml and init.py.
  • Your local Claude CLI/login must already be working on that machine before you start Claude bridge sessions.
  • Your local Codex CLI/login must already be working on that machine before you start Codex bridge sessions.
  • The bridge updates the session cwd so RelayAI reflects the local execution path.
  • On startup the bridge reports which integrations are available on the machine so the iPhone app can offer only supported bridge runtimes.
  • If you omit --session-id, the bridge stays idle until you press Refresh on the app home page and the app announces active bridge sessions.
  • The bridge logs when it starts, when it claims a session, and when a session is stopped/released.

Project details


Download files

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

Source Distribution

relayai_local_bridge-0.1.1.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

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

relayai_local_bridge-0.1.1-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

Details for the file relayai_local_bridge-0.1.1.tar.gz.

File metadata

  • Download URL: relayai_local_bridge-0.1.1.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for relayai_local_bridge-0.1.1.tar.gz
Algorithm Hash digest
SHA256 046cf1433951297ba514e556f108c15ca697d87b8e4b8250721b48b3cfc595a1
MD5 cef11b63c329052eb9933fee84a12b20
BLAKE2b-256 f6be2d2f4ca39840f6a6a6567d6baf6e5f356a49d16e6510a0524d89a8d470db

See more details on using hashes here.

File details

Details for the file relayai_local_bridge-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for relayai_local_bridge-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d69f667b5b3f5008c6bc3e47f283464318b604af55bd9b2d2c7a5566172899a
MD5 4fe9c2aaaf35b20a782b2b920c0470a1
BLAKE2b-256 40f31771a8f93f010e21bb1d901b84e688cd1ade5daa3d2782111f8e576d4983

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page