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
claudeonce 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/codexandbrew install --cask codex. - Run
codexonce and complete either ChatGPT sign-in or API-key setup before using Codex-backed bridge sessions. - RelayAI uses the local
codexCLI andcodex app-server; the bridge will report Codex as unavailable until the CLI is installed and authenticated.
What it does
- Authenticates as a paired bridge device
- Waits for a RelayAI bridge-session announcement from the app
- Subscribes to
/api/sessions/{id}/events/stream - Watches for new
usermessages - Runs Claude or Codex locally on your machine
- Streams assistant deltas back to RelayAI
- 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-idto attach to an existing RelayAI session--ca-bundleto point Python at a specific trusted CA bundle if your local OpenSSL trust store cannot validate the RelayAI certificate chain--reset-authto clear stored bridge credentials and force a new pairing flow--credentials-fileto override the default credential storage location--claude-cli-pathto override the Claude CLI path for bridge-backed Claude sessions--codex-cli-pathto override the Codex CLI path for bridge-backed Codex sessions--verboseto enable debug-level bridge, Claude, and Codex runtime logs--log-level DEBUG|INFO|WARNING|ERRORto 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
--cwdshould 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
cwdso 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 pressRefreshon 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
046cf1433951297ba514e556f108c15ca697d87b8e4b8250721b48b3cfc595a1
|
|
| MD5 |
cef11b63c329052eb9933fee84a12b20
|
|
| BLAKE2b-256 |
f6be2d2f4ca39840f6a6a6567d6baf6e5f356a49d16e6510a0524d89a8d470db
|
File details
Details for the file relayai_local_bridge-0.1.1-py3-none-any.whl.
File metadata
- Download URL: relayai_local_bridge-0.1.1-py3-none-any.whl
- Upload date:
- Size: 34.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d69f667b5b3f5008c6bc3e47f283464318b604af55bd9b2d2c7a5566172899a
|
|
| MD5 |
4fe9c2aaaf35b20a782b2b920c0470a1
|
|
| BLAKE2b-256 |
40f31771a8f93f010e21bb1d901b84e688cd1ade5daa3d2782111f8e576d4983
|