22
33[ English] ( #english ) | [ 中文] ( #中文 )
44
5- ## English
6- Zero-configuration remote control for Codex (` Desktop App + Relay + local Codex execution ` ).
7-
8- Goal: users download the app, complete setup in the wizard, and control Codex from Telegram without command-line steps.
9-
10- ### Monorepo
11- - ` packages/bridge-core ` : execution orchestration, health checks, config, launchd manager.
12- - ` apps/desktop ` : Electron + React desktop app (wizard + advanced settings + menu bar entry).
13- - ` services/cloud-relay ` : Fastify + WebSocket relay service.
14- - ` src ` (legacy): previous bridge implementation kept for compatibility.
15-
16- ### Current capabilities
17- - Desktop setup wizard + app home (Current Status / Advanced Settings / Logs & Feedback).
18- - Telegram bot pairing via QR code.
19- - Bound-thread remote turns with status + final response.
20- - Telegram usage query (` /usage ` , alias ` /limits ` ).
21- - Thread list with live per-thread task state in ` /threads ` .
22- - Approval routing (` /approve ` / ` /deny ` ).
23- - Menu bar control (status, remote on/off, open settings).
24- - i18n support for ** English + Chinese** (` en ` /` zh ` ) across desktop UI, tray, and Telegram responses.
25-
26- ### Dev quick start
5+ ## 中文
6+
7+ 把 Codex 从“只能坐在电脑前用”,变成“手机 Telegram 随时远程用”。
8+
9+ ### 这个项目解决什么痛点
10+ - 你离开电脑后,Codex 对话无法继续跟进。
11+ - 你在手机上只能看消息,不能像在 Codex 里那样继续驱动任务。
12+ - 需要远程审批、查看状态、切换线程时,缺少统一入口。
13+
14+ Codex Bridge Desktop 的目标是:** 让你用 Telegram 像远程控制台一样操作本机 Codex** ,并尽量保持与 Codex 线程一致。
15+
16+ ### 你现在可以做到什么
17+ - 在 Telegram 中发送文本/图片,转给已绑定的 Codex thread 执行。
18+ - 在 Telegram 中查看最近线程、绑定线程、查看当前对话快照。
19+ - 在 Telegram 中处理审批(` /approve ` / ` /deny ` )。
20+ - 查询 Codex 用量(` /usage ` 或 ` /limits ` )。
21+ - 使用 macOS 菜单栏快速查看状态、启停远程能力。
22+ - 使用桌面 App 完成首次引导、机器人配置、日志排查。
23+
24+ ## 2-3 分钟上手(普通用户)
25+
26+ ### 1) 下载并打开 App
27+ 1 . 打开 Releases 页面下载最新版:
28+ ` https://github.com/tonyHu08/CodeX_Bridge/releases `
29+ 2 . 安装并打开 ` Codex Bridge Desktop ` 。
30+ 3 . 保证本机已安装并登录 Codex App。
31+
32+ ### 2) 配置 Telegram 机器人
33+ 1 . 在 Telegram 打开 ` @BotFather ` 。
34+ 2 . 用 ` /newbot ` 创建机器人,拿到 Bot Token。
35+ 3 . 在桌面 App 中粘贴 Token,保存并启用。
36+
37+ ### 3) 手机配对
38+ 1 . 在桌面 App 点击“开始配对”。
39+ 2 . 用 Telegram 打开配对链接(或扫码)。
40+ 3 . 配对成功后,机器人会回复已绑定。
41+
42+ ### 4) 绑定要操作的 Codex 会话
43+ 1 . 在 Telegram 里发送 ` /threads ` 。
44+ 2 . 选择线程按钮,或用 ` /bind <编号> ` 、` /bind latest ` 。
45+ 3 . 之后直接发消息即可远程驱动该线程。
46+
47+ ### 5) 日常使用
48+ - 直接发送文本任务(可附图)。
49+ - 随时用 ` /status ` 、` /current ` 、` /usage ` 查看状态。
50+ - 需要停止当前任务时用 ` /cancel ` 。
51+
52+ ## 常用 Telegram 命令
53+ - ` /threads ` :查看最近线程并快速绑定
54+ - ` /bind latest ` :绑定最新线程
55+ - ` /bind <index|threadId> ` :绑定指定线程
56+ - ` /current ` :查看当前绑定线程快照
57+ - ` /detail <index|threadId> ` :查看线程详细信息
58+ - ` /usage ` / ` /limits ` :查询 Codex 用量
59+ - ` /status ` :查看桥接状态
60+ - ` /cancel ` :终止当前运行并清空排队
61+ - ` /unbind ` :解绑当前线程
62+ - ` /help ` :帮助
63+
64+ ## 技术实现(面向开发者)
65+
66+ ### Monorepo 结构
67+ - ` apps/desktop ` : Electron + React 桌面端(引导、主页、菜单栏)
68+ - ` packages/bridge-core ` : 线程编排、审批、状态管理、Codex App Server 客户端
69+ - ` services/cloud-relay ` : Relay 服务(可选,自托管场景)
70+ - ` src ` (legacy): 历史实现
71+
72+ ### 核心机制
73+ - 使用 ` codex app-server ` (JSON-RPC)控制本机 thread:
74+ - ` thread/list ` 、` thread/read ` 、` thread/resume ` 、` turn/start `
75+ - Telegram 侧做消息接入、命令路由、审批回传。
76+ - SQLite 持久化绑定、去重和审批状态。
77+ - macOS 菜单栏常驻,桌面窗口用于配置与诊断。
78+
79+ ### 本地开发
2780``` bash
28- cd /Users/junweihu/clawd /codex-remote-bridge
81+ cd /path/to /codex-remote-bridge
2982npm install
3083npm run setup
3184npm run dev:relay
3285npm run build:desktop
3386npm run start:desktop
3487```
3588
36- ### Quality checks
89+ ### 构建校验
3790``` bash
3891npm run typecheck
3992npm run build
4093```
4194
42- ### Key environment variables
43- - ` HOST ` (default ` 127.0.0.1 ` )
44- - ` PORT ` (default ` 8787 ` )
45- - ` RELAY_PUBLIC_BASE_URL ` (default ` http://127.0.0.1:8787 ` )
95+ ### 关键环境变量
96+ - ` HOST ` (默认 ` 127.0.0.1 ` )
97+ - ` PORT ` (默认 ` 8787 ` )
98+ - ` RELAY_PUBLIC_BASE_URL ` (默认 ` http://127.0.0.1:8787 ` )
4699- ` RELAY_BOT_USERNAME `
47100- ` TELEGRAM_BOT_TOKEN `
48- - ` BRIDGE_LOCALE ` (` zh ` or ` en ` )
49-
50- ### Local data paths
51- - ` $HOME/.codex-bridge/config.json `
52- - ` $HOME/.codex-bridge/data/codex_bridge.db `
53- - ` $HOME/.codex-bridge/logs/agent.log `
101+ - ` BRIDGE_LOCALE ` (` zh ` 或 ` en ` )
54102
55- ### Documents
103+ ### 文档
56104- [ Configuration] ( ./docs/CONFIG.md )
57105- [ Commands] ( ./docs/COMMANDS.md )
58106- [ Architecture] ( ./docs/ARCHITECTURE.md )
@@ -61,59 +109,42 @@ npm run build
61109- [ Privacy] ( ./docs/PRIVACY.md )
62110- [ Self-hosting] ( ./docs/SELF_HOSTING.md )
63111- [ Threat model] ( ./docs/THREAT_MODEL.md )
64- - [ Contributing] ( ./CONTRIBUTING.md )
65- - [ Security] ( ./SECURITY.md )
66- - [ Code of Conduct] ( ./CODE_OF_CONDUCT.md )
67- - [ Open Source Checklist] ( ./OPEN_SOURCE_CHECKLIST.md )
68112
69113---
70114
71- ## 中文
72- 零配置远程控制能力(` 桌面 App + Relay + 本地 Codex 执行 ` )。
115+ ## English
73116
74- 目标体验:用户下载安装后,通过向导完成配对,即可用 Telegram 远程操作 Codex,无需命令行。
117+ Turn Codex from a desktop-only experience into a Telegram-based remote workflow.
75118
76- ### Monorepo 结构
77- - ` packages/bridge-core ` :执行编排、健康检测、配置与 launchd 管理。
78- - ` apps/desktop ` :Electron + React 桌面端(向导、设置、菜单栏入口)。
79- - ` services/cloud-relay ` :Fastify + WebSocket Relay 服务。
80- - ` src ` (legacy):历史桥接实现,保留兼容用途。
81-
82- ### 当前能力
83- - 桌面端向导 + 应用主页(当前状态 / 高级设置 / 日志与反馈)。
84- - Telegram 二维码配对。
85- - 绑定线程后的远程执行(状态 + 最终回包)。
86- - Telegram 用量查询(` /usage ` ,兼容 ` /limits ` )。
87- - ` /threads ` 中展示每个会话的实时任务状态。
88- - 审批流转(` /approve ` / ` /deny ` )。
89- - 菜单栏控制(状态、远程开关、打开设置)。
90- - 国际化:桌面 UI、菜单栏、Telegram 回包支持 ** 中英文** (` zh ` /` en ` )。
91-
92- ### 开发快速开始
119+ ### What this project solves
120+ - You cannot continue Codex tasks when you are away from your computer.
121+ - You need a mobile control surface for thread operations, status, and approvals.
122+ - You want a practical remote bridge without changing your existing Codex workflow.
123+
124+ Codex Bridge Desktop lets you control local Codex threads from Telegram, with thread binding, status, approvals, and usage visibility.
125+
126+ ### What you can do
127+ - Send text/image messages from Telegram to a bound Codex thread.
128+ - List and bind recent threads from Telegram.
129+ - Handle approvals remotely (` /approve ` , ` /deny ` ).
130+ - Check Codex rate limits (` /usage ` , ` /limits ` ).
131+ - Use macOS tray/menu bar for quick status and remote on/off.
132+
133+ ### Quick start (2-3 minutes)
134+ 1 . Download the desktop app from Releases:
135+ ` https://github.com/tonyHu08/CodeX_Bridge/releases `
136+ 2 . Open the app and complete the onboarding wizard.
137+ 3 . Create a Telegram bot via ` @BotFather ` and paste the Bot Token.
138+ 4 . Start pairing in the app, then open the pairing link in Telegram.
139+ 5 . In Telegram, run ` /threads ` and bind a thread.
140+ 6 . Send your message to start remote Codex execution.
141+
142+ ### Development quick start
93143``` bash
94- cd /Users/junweihu/clawd /codex-remote-bridge
144+ cd /path/to /codex-remote-bridge
95145npm install
96146npm run setup
97147npm run dev:relay
98148npm run build:desktop
99149npm run start:desktop
100150```
101-
102- ### 质量检查
103- ``` bash
104- npm run typecheck
105- npm run build
106- ```
107-
108- ### 关键环境变量
109- - ` HOST ` (默认 ` 127.0.0.1 ` )
110- - ` PORT ` (默认 ` 8787 ` )
111- - ` RELAY_PUBLIC_BASE_URL ` (默认 ` http://127.0.0.1:8787 ` )
112- - ` RELAY_BOT_USERNAME `
113- - ` TELEGRAM_BOT_TOKEN `
114- - ` BRIDGE_LOCALE ` (` zh ` 或 ` en ` )
115-
116- ### 本地数据路径
117- - ` $HOME/.codex-bridge/config.json `
118- - ` $HOME/.codex-bridge/data/codex_bridge.db `
119- - ` $HOME/.codex-bridge/logs/agent.log `
0 commit comments