remote-codex 0.11.22 → 0.11.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +211 -110
- package/apps/relay-server/dist/index.js +295 -51
- package/apps/supervisor-web/dist/assets/index-CtcCwgIc.js +5 -0
- package/apps/supervisor-web/dist/assets/index-PMKHoC-h.css +1 -0
- package/apps/supervisor-web/dist/assets/{thread-ui-CDgAOcDh.js → thread-ui-jJyFqIuV.js} +69 -35
- package/apps/supervisor-web/dist/index.html +3 -3
- package/package.json +2 -1
- package/packages/shared/src/index.ts +26 -0
- package/apps/supervisor-web/dist/assets/index-BfspE5mQ.js +0 -5
- package/apps/supervisor-web/dist/assets/index-BmBS1Wzk.css +0 -1
package/README.md
CHANGED
|
@@ -1,38 +1,109 @@
|
|
|
1
|
-
# Remote Codex
|
|
1
|
+
# Remote Codex
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](#english)
|
|
4
|
+
[](#中文)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
- `React + Vite` web shell with a single-user landing page, workspace list, add flow, and read-only tree
|
|
7
|
-
- `Drizzle + better-sqlite3` persistence with explicit SQL migrations
|
|
8
|
-
- Workspace browsing constrained to a configurable root path
|
|
6
|
+
## English
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
Remote Codex is a web, Android, and iOS supervisor for Codex workspaces and
|
|
9
|
+
threads. It can run locally, over Tailscale/LAN, or through a public relay so a
|
|
10
|
+
private machine can connect outward without opening inbound ports.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
- pnpm `>= 10`
|
|
12
|
+
### Downloads
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
- Android APK: [remote-codex-android.apk](https://github.com/dufangshi/remoteCodex/releases/latest/download/remote-codex-android.apk)
|
|
15
|
+
- iOS IPA: [RemoteCodex.ipa](https://github.com/dufangshi/remoteCodex/releases/latest/download/RemoteCodex.ipa)
|
|
16
|
+
- npm CLI: `npm install -g remote-codex`
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- Relay mode for web/mobile access to private workspaces.
|
|
21
|
+
- Device-scoped routes, shared sessions, and per-device workspace/thread lists.
|
|
22
|
+
- Codex thread chat with streaming steps, attachments, exports, and workspace explorer.
|
|
23
|
+
- Workspace file browsing, preview, upload/download, edit, and image preview.
|
|
24
|
+
- Android, iOS, web, Docker, and npm CLI entrypoints.
|
|
25
|
+
|
|
26
|
+
### Run A Relay Server
|
|
27
|
+
|
|
28
|
+
Docker from GHCR:
|
|
16
29
|
|
|
17
30
|
```bash
|
|
18
|
-
|
|
19
|
-
|
|
31
|
+
docker volume create remote-codex-relay-data
|
|
32
|
+
|
|
33
|
+
docker run -d \
|
|
34
|
+
--name remote-codex-relay \
|
|
35
|
+
--restart unless-stopped \
|
|
36
|
+
-p 8798:8788 \
|
|
37
|
+
-v remote-codex-relay-data:/var/lib/remote-codex-relay \
|
|
38
|
+
-e REMOTE_CODEX_RELAY_HOST=0.0.0.0 \
|
|
39
|
+
-e REMOTE_CODEX_RELAY_PORT=8788 \
|
|
40
|
+
-e REMOTE_CODEX_RELAY_DATA_DIR=/var/lib/remote-codex-relay \
|
|
41
|
+
-e REMOTE_CODEX_RELAY_REGISTRATION_ENABLED=true \
|
|
42
|
+
-e REMOTE_CODEX_ADMIN_USERNAME=admin \
|
|
43
|
+
-e REMOTE_CODEX_ADMIN_PASSWORD='change-this-password' \
|
|
44
|
+
-e REMOTE_CODEX_RELAY_SESSION_SECRET='change-this-session-secret' \
|
|
45
|
+
ghcr.io/dufangshi/remotecodex-relay:latest
|
|
20
46
|
```
|
|
21
47
|
|
|
22
|
-
|
|
48
|
+
Build the Docker image yourself:
|
|
23
49
|
|
|
24
|
-
|
|
25
|
-
|
|
50
|
+
```bash
|
|
51
|
+
git clone https://github.com/dufangshi/remoteCodex.git
|
|
52
|
+
cd remoteCodex
|
|
53
|
+
docker build -f Dockerfile.relay -t remote-codex-relay .
|
|
54
|
+
docker run -d --name remote-codex-relay --restart unless-stopped \
|
|
55
|
+
-p 8798:8788 \
|
|
56
|
+
-v remote-codex-relay-data:/var/lib/remote-codex-relay \
|
|
57
|
+
-e REMOTE_CODEX_RELAY_HOST=0.0.0.0 \
|
|
58
|
+
-e REMOTE_CODEX_RELAY_PORT=8788 \
|
|
59
|
+
-e REMOTE_CODEX_RELAY_DATA_DIR=/var/lib/remote-codex-relay \
|
|
60
|
+
-e REMOTE_CODEX_RELAY_REGISTRATION_ENABLED=true \
|
|
61
|
+
-e REMOTE_CODEX_ADMIN_USERNAME=admin \
|
|
62
|
+
-e REMOTE_CODEX_ADMIN_PASSWORD='change-this-password' \
|
|
63
|
+
-e REMOTE_CODEX_RELAY_SESSION_SECRET='change-this-session-secret' \
|
|
64
|
+
remote-codex-relay
|
|
65
|
+
```
|
|
26
66
|
|
|
27
|
-
|
|
67
|
+
Direct script mode:
|
|
28
68
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
69
|
+
```bash
|
|
70
|
+
git clone https://github.com/dufangshi/remoteCodex.git
|
|
71
|
+
cd remoteCodex
|
|
72
|
+
./start.sh
|
|
73
|
+
```
|
|
32
74
|
|
|
33
|
-
|
|
75
|
+
`start.sh` defaults to relay mode on `0.0.0.0:8798`, creates
|
|
76
|
+
`.local/relay.env` on first run, and prints the initial admin password. Override
|
|
77
|
+
the port with:
|
|
34
78
|
|
|
35
|
-
|
|
79
|
+
```bash
|
|
80
|
+
REMOTE_CODEX_RELAY_PORT=18088 ./start.sh
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Open `http://SERVER_HOST:8798/relay-portal`, sign in, create a device, and copy
|
|
84
|
+
the setup command.
|
|
85
|
+
|
|
86
|
+
### Connect A Private Machine
|
|
87
|
+
|
|
88
|
+
Install the CLI on the machine that owns the workspace:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npm install -g remote-codex
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Then run the copied command from the relay portal. It has this shape:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
REMOTE_CODEX_RELAY_SERVER_URL=ws://SERVER_HOST:8798 \
|
|
98
|
+
REMOTE_CODEX_RELAY_AGENT_TOKEN=rcd_device_token \
|
|
99
|
+
REMOTE_CODEX_RELAY_SUPERVISOR_PORT=45679 \
|
|
100
|
+
remote-codex relay-supervisor
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`45679` is used by default in copied setup commands to avoid common local
|
|
104
|
+
`8787` port conflicts. You can change it if needed.
|
|
105
|
+
|
|
106
|
+
### Local Mode
|
|
36
107
|
|
|
37
108
|
```bash
|
|
38
109
|
npm install -g remote-codex
|
|
@@ -41,122 +112,158 @@ remote-codex status
|
|
|
41
112
|
remote-codex stop
|
|
42
113
|
```
|
|
43
114
|
|
|
44
|
-
|
|
115
|
+
Default npm CLI ports:
|
|
45
116
|
|
|
46
|
-
- API: `http://127.0.0.1:45674`
|
|
47
117
|
- Web: `http://127.0.0.1:45673`
|
|
48
|
-
-
|
|
49
|
-
- production database: `~/.remote-codex/supervisor.sqlite`
|
|
50
|
-
|
|
51
|
-
Environment overrides:
|
|
118
|
+
- API: `http://127.0.0.1:45674`
|
|
52
119
|
|
|
53
|
-
|
|
54
|
-
- `SERVICE_API_HOST` and `SERVICE_API_PORT`
|
|
55
|
-
- `REMOTE_CODEX_SERVICE_DIR`
|
|
56
|
-
- `DATABASE_URL`
|
|
57
|
-
- `WORKSPACE_ROOT`
|
|
58
|
-
- `CODEX_HOME`
|
|
59
|
-
- `CODEX_COMMAND`
|
|
120
|
+
Override with `SERVICE_PORT` and `SERVICE_API_PORT`.
|
|
60
121
|
|
|
61
|
-
|
|
122
|
+
### Development
|
|
62
123
|
|
|
63
124
|
```bash
|
|
125
|
+
pnpm install
|
|
64
126
|
pnpm db:migrate
|
|
65
127
|
pnpm dev
|
|
66
128
|
```
|
|
67
129
|
|
|
68
|
-
|
|
130
|
+
Common checks:
|
|
69
131
|
|
|
70
|
-
|
|
71
|
-
|
|
132
|
+
```bash
|
|
133
|
+
pnpm build
|
|
134
|
+
pnpm typecheck
|
|
135
|
+
pnpm test
|
|
136
|
+
```
|
|
72
137
|
|
|
73
|
-
|
|
138
|
+
### Publish Mobile Apps
|
|
74
139
|
|
|
75
|
-
|
|
140
|
+
After building an APK and IPA locally:
|
|
76
141
|
|
|
77
142
|
```bash
|
|
78
|
-
pnpm
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
pnpm service:stop
|
|
143
|
+
pnpm release:mobile -- --tag v0.11.23 \
|
|
144
|
+
--apk apps/android/app/build/outputs/apk/release/app-release.apk \
|
|
145
|
+
--ipa apps/ios/build/RemoteCodex.ipa
|
|
82
146
|
```
|
|
83
147
|
|
|
84
|
-
|
|
148
|
+
The uploaded asset names stay stable:
|
|
149
|
+
|
|
150
|
+
- `remote-codex-android.apk`
|
|
151
|
+
- `RemoteCodex.ipa`
|
|
152
|
+
|
|
153
|
+
## 中文
|
|
154
|
+
|
|
155
|
+
Remote Codex 是 Codex workspace 和 thread 的 Web、Android、iOS 控制台。它可以
|
|
156
|
+
本地运行,也可以通过 Tailscale/LAN 访问;relay 模式下,私有机器只需要主动连到
|
|
157
|
+
公网 relay,不需要开放入站端口。
|
|
85
158
|
|
|
86
|
-
|
|
87
|
-
- Web: `http://127.0.0.1:4173`
|
|
159
|
+
### 下载
|
|
88
160
|
|
|
89
|
-
|
|
161
|
+
- Android APK: [remote-codex-android.apk](https://github.com/dufangshi/remoteCodex/releases/latest/download/remote-codex-android.apk)
|
|
162
|
+
- iOS IPA: [RemoteCodex.ipa](https://github.com/dufangshi/remoteCodex/releases/latest/download/RemoteCodex.ipa)
|
|
163
|
+
- npm CLI: `npm install -g remote-codex`
|
|
90
164
|
|
|
91
|
-
|
|
165
|
+
### 功能
|
|
92
166
|
|
|
93
|
-
|
|
167
|
+
- Relay 模式:网页和移动端访问私有 workspace。
|
|
168
|
+
- 按设备隔离 URL、workspace、thread,并支持 session 分享。
|
|
169
|
+
- Codex thread 聊天、流式步骤、图片/附件、导出和 workspace explorer。
|
|
170
|
+
- 文件浏览、预览、上传/下载、编辑和图片预览。
|
|
171
|
+
- Web、Android、iOS、Docker、npm CLI 多入口。
|
|
172
|
+
|
|
173
|
+
### 启动 Relay 服务器
|
|
174
|
+
|
|
175
|
+
使用 GHCR 镜像:
|
|
94
176
|
|
|
95
177
|
```bash
|
|
96
|
-
|
|
97
|
-
|
|
178
|
+
docker volume create remote-codex-relay-data
|
|
179
|
+
|
|
180
|
+
docker run -d \
|
|
181
|
+
--name remote-codex-relay \
|
|
182
|
+
--restart unless-stopped \
|
|
183
|
+
-p 8798:8788 \
|
|
184
|
+
-v remote-codex-relay-data:/var/lib/remote-codex-relay \
|
|
185
|
+
-e REMOTE_CODEX_RELAY_HOST=0.0.0.0 \
|
|
186
|
+
-e REMOTE_CODEX_RELAY_PORT=8788 \
|
|
187
|
+
-e REMOTE_CODEX_RELAY_DATA_DIR=/var/lib/remote-codex-relay \
|
|
188
|
+
-e REMOTE_CODEX_RELAY_REGISTRATION_ENABLED=true \
|
|
189
|
+
-e REMOTE_CODEX_ADMIN_USERNAME=admin \
|
|
190
|
+
-e REMOTE_CODEX_ADMIN_PASSWORD='change-this-password' \
|
|
191
|
+
-e REMOTE_CODEX_RELAY_SESSION_SECRET='change-this-session-secret' \
|
|
192
|
+
ghcr.io/dufangshi/remotecodex-relay:latest
|
|
98
193
|
```
|
|
99
194
|
|
|
100
|
-
|
|
195
|
+
自己构建 Docker 镜像:
|
|
101
196
|
|
|
102
197
|
```bash
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
198
|
+
git clone https://github.com/dufangshi/remoteCodex.git
|
|
199
|
+
cd remoteCodex
|
|
200
|
+
docker build -f Dockerfile.relay -t remote-codex-relay .
|
|
201
|
+
docker run -d --name remote-codex-relay --restart unless-stopped \
|
|
202
|
+
-p 8798:8788 \
|
|
203
|
+
-v remote-codex-relay-data:/var/lib/remote-codex-relay \
|
|
204
|
+
-e REMOTE_CODEX_RELAY_HOST=0.0.0.0 \
|
|
205
|
+
-e REMOTE_CODEX_RELAY_PORT=8788 \
|
|
206
|
+
-e REMOTE_CODEX_RELAY_DATA_DIR=/var/lib/remote-codex-relay \
|
|
207
|
+
-e REMOTE_CODEX_RELAY_REGISTRATION_ENABLED=true \
|
|
208
|
+
-e REMOTE_CODEX_ADMIN_USERNAME=admin \
|
|
209
|
+
-e REMOTE_CODEX_ADMIN_PASSWORD='change-this-password' \
|
|
210
|
+
-e REMOTE_CODEX_RELAY_SESSION_SECRET='change-this-session-secret' \
|
|
211
|
+
remote-codex-relay
|
|
106
212
|
```
|
|
107
213
|
|
|
108
|
-
|
|
214
|
+
直接脚本启动:
|
|
109
215
|
|
|
110
216
|
```bash
|
|
111
|
-
|
|
112
|
-
|
|
217
|
+
git clone https://github.com/dufangshi/remoteCodex.git
|
|
218
|
+
cd remoteCodex
|
|
219
|
+
./start.sh
|
|
113
220
|
```
|
|
114
221
|
|
|
115
|
-
|
|
222
|
+
`start.sh` 默认以 relay 模式监听 `0.0.0.0:8798`,首次运行会创建
|
|
223
|
+
`.local/relay.env` 并打印初始 admin 密码。改端口:
|
|
116
224
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
225
|
+
```bash
|
|
226
|
+
REMOTE_CODEX_RELAY_PORT=18088 ./start.sh
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
打开 `http://SERVER_HOST:8798/relay-portal`,登录后创建设备并复制 setup command。
|
|
122
230
|
|
|
231
|
+
### 连接私有机器
|
|
123
232
|
|
|
124
|
-
|
|
233
|
+
在真正拥有 workspace 的机器上安装 CLI:
|
|
125
234
|
|
|
126
235
|
```bash
|
|
127
|
-
|
|
128
|
-
pnpm lint
|
|
129
|
-
pnpm typecheck
|
|
130
|
-
pnpm test
|
|
131
|
-
pnpm db:migrate
|
|
236
|
+
npm install -g remote-codex
|
|
132
237
|
```
|
|
133
238
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
- [Plugin system](./docs/plugins.md)
|
|
137
|
-
|
|
138
|
-
## API Endpoints
|
|
239
|
+
然后运行 relay portal 复制出来的命令,形如:
|
|
139
240
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
-
|
|
145
|
-
|
|
146
|
-
- `POST /api/workspaces/:id/favorite`
|
|
147
|
-
- `POST /api/workspaces/:id/open`
|
|
148
|
-
- `GET /api/workspaces/tree?path=...&showHidden=...`
|
|
149
|
-
- `GET /ws`
|
|
241
|
+
```bash
|
|
242
|
+
REMOTE_CODEX_RELAY_SERVER_URL=ws://SERVER_HOST:8798 \
|
|
243
|
+
REMOTE_CODEX_RELAY_AGENT_TOKEN=rcd_device_token \
|
|
244
|
+
REMOTE_CODEX_RELAY_SUPERVISOR_PORT=45679 \
|
|
245
|
+
remote-codex relay-supervisor
|
|
246
|
+
```
|
|
150
247
|
|
|
151
|
-
|
|
248
|
+
复制命令默认使用 `45679`,用于避开本机常见的 `8787` 端口冲突;需要时可以手动换。
|
|
152
249
|
|
|
153
|
-
|
|
250
|
+
### 本地模式
|
|
154
251
|
|
|
155
252
|
```bash
|
|
156
|
-
|
|
253
|
+
npm install -g remote-codex
|
|
254
|
+
remote-codex start
|
|
255
|
+
remote-codex status
|
|
256
|
+
remote-codex stop
|
|
157
257
|
```
|
|
158
258
|
|
|
159
|
-
|
|
259
|
+
npm CLI 默认端口:
|
|
260
|
+
|
|
261
|
+
- Web: `http://127.0.0.1:45673`
|
|
262
|
+
- API: `http://127.0.0.1:45674`
|
|
263
|
+
|
|
264
|
+
可用 `SERVICE_PORT` 和 `SERVICE_API_PORT` 覆盖。
|
|
265
|
+
|
|
266
|
+
### 开发
|
|
160
267
|
|
|
161
268
|
```bash
|
|
162
269
|
pnpm install
|
|
@@ -164,31 +271,25 @@ pnpm db:migrate
|
|
|
164
271
|
pnpm dev
|
|
165
272
|
```
|
|
166
273
|
|
|
167
|
-
|
|
274
|
+
常用检查:
|
|
168
275
|
|
|
169
276
|
```bash
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
277
|
+
pnpm build
|
|
278
|
+
pnpm typecheck
|
|
279
|
+
pnpm test
|
|
173
280
|
```
|
|
174
281
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
- it appears in the workspace list
|
|
178
|
-
- the detail page shows the tree
|
|
179
|
-
- hidden files can be toggled on and off
|
|
180
|
-
|
|
181
|
-
5. Verify failure paths by attempting to add:
|
|
282
|
+
### 发布移动端安装包
|
|
182
283
|
|
|
183
|
-
|
|
184
|
-
- a directory outside `WORKSPACE_ROOT`
|
|
185
|
-
- a non-directory path
|
|
186
|
-
|
|
187
|
-
6. Run the full quality gate:
|
|
284
|
+
本地构建好 APK 和 IPA 后:
|
|
188
285
|
|
|
189
286
|
```bash
|
|
190
|
-
pnpm
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
pnpm build
|
|
287
|
+
pnpm release:mobile -- --tag v0.11.23 \
|
|
288
|
+
--apk apps/android/app/build/outputs/apk/release/app-release.apk \
|
|
289
|
+
--ipa apps/ios/build/RemoteCodex.ipa
|
|
194
290
|
```
|
|
291
|
+
|
|
292
|
+
上传后的文件名保持固定:
|
|
293
|
+
|
|
294
|
+
- `remote-codex-android.apk`
|
|
295
|
+
- `RemoteCodex.ipa`
|