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.
If an older installed bridge exits with Invalid refresh token., run the same command with --reset-auth once. Newer bridge versions clear expired bridge credentials automatically and start pairing again.
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.
Metadata
Release files for relayai-local-bridge 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| relayai_local_bridge-0.1.2.tar.gz | 32.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| relayai_local_bridge-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 66.3 kB
Release files / relayai_local_bridge-0.1.2.tar.gz
| Download URL | relayai_local_bridge-0.1.2.tar.gz |
|---|---|
| Size | 32.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b80cbb2fbab6c7ebd113b535438f79cf9a9a607703362c834718b2f5556bae07
|
|
BLAKE2b-256 checksum How to use checksums |
12d820e9805560785b314ee86608d6f6520b1711b997b456423bf271c3908d7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / relayai_local_bridge-0.1.2-py3-none-any.whl
| Download URL | relayai_local_bridge-0.1.2-py3-none-any.whl |
|---|---|
| Size | 34.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3125edf7782462f942ab4df22af35112b591f080a5d8b11efe4a21bec41b7fc3
|
|
BLAKE2b-256 checksum How to use checksums |
f7f00c98cf79e456b66136e3d36d1b0ab63a7691f4502b889e3026d651e40a98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|