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 CHANGED
@@ -1,38 +1,109 @@
1
- # Remote Codex Supervisor
1
+ # Remote Codex
2
2
 
3
- Phase 1 implements the base supervisor foundation for a local `Codex` control surface:
3
+ [![English](https://img.shields.io/badge/English-0f172a?style=for-the-badge)](#english)
4
+ [![中文](https://img.shields.io/badge/%E4%B8%AD%E6%96%87-0f172a?style=for-the-badge)](#中文)
4
5
 
5
- - `Fastify` API with health checks, runtime config, workspace registry, and WebSocket skeleton
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
- ## Requirements
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
- - Node.js `>= 20`
13
- - pnpm `>= 10`
12
+ ### Downloads
14
13
 
15
- ## Install
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
- pnpm install
19
- cp .env.example .env
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
- Optional overrides:
48
+ Build the Docker image yourself:
23
49
 
24
- - `WORKSPACE_ROOT=/absolute/path`
25
- - `DATABASE_URL=/absolute/path/to/sqlite.db`
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
- Defaults:
67
+ Direct script mode:
28
68
 
29
- - development database: `.local/supervisor-dev.sqlite`
30
- - production database: `~/.remote-codex/supervisor.sqlite`
31
- - workspace root: current user home directory
69
+ ```bash
70
+ git clone https://github.com/dufangshi/remoteCodex.git
71
+ cd remoteCodex
72
+ ./start.sh
73
+ ```
32
74
 
33
- ## Global CLI Install
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
- Remote Codex can also be packaged as an npm global CLI:
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
- The global CLI starts the production API and web service:
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
- - service logs/state: `~/.remote-codex/service/`
49
- - production database: `~/.remote-codex/supervisor.sqlite`
50
-
51
- Environment overrides:
118
+ - API: `http://127.0.0.1:45674`
52
119
 
53
- - `SERVICE_HOST` and `SERVICE_PORT`
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
- ## Development
122
+ ### Development
62
123
 
63
124
  ```bash
125
+ pnpm install
64
126
  pnpm db:migrate
65
127
  pnpm dev
66
128
  ```
67
129
 
68
- This starts:
130
+ Common checks:
69
131
 
70
- - API: `http://127.0.0.1:8787`
71
- - Web: `http://127.0.0.1:5173`
132
+ ```bash
133
+ pnpm build
134
+ pnpm typecheck
135
+ pnpm test
136
+ ```
72
137
 
73
- ## Service Mode
138
+ ### Publish Mobile Apps
74
139
 
75
- Build first, then use the service manager:
140
+ After building an APK and IPA locally:
76
141
 
77
142
  ```bash
78
- pnpm build
79
- pnpm service:start
80
- pnpm service:status
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
- This starts a quieter long-running stack:
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
- - API: `http://127.0.0.1:8787`
87
- - Web: `http://127.0.0.1:4173`
159
+ ### 下载
88
160
 
89
- Logs are written to `~/.remote-codex/service/` by default. Set `REMOTE_CODEX_SERVICE_DIR` to override this.
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
- ## Remote Access via Tailscale
165
+ ### 功能
92
166
 
93
- If you want to open the supervisor from another device on your tailnet:
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
- pnpm dev
97
- tailscale serve --bg 5173
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
- Or, if you are using service mode:
195
+ 自己构建 Docker 镜像:
101
196
 
102
197
  ```bash
103
- pnpm build
104
- pnpm service:start
105
- tailscale serve --bg 4173
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
- Useful Tailscale commands:
214
+ 直接脚本启动:
109
215
 
110
216
  ```bash
111
- tailscale serve status
112
- tailscale serve reset
217
+ git clone https://github.com/dufangshi/remoteCodex.git
218
+ cd remoteCodex
219
+ ./start.sh
113
220
  ```
114
221
 
115
- Notes:
222
+ `start.sh` 默认以 relay 模式监听 `0.0.0.0:8798`,首次运行会创建
223
+ `.local/relay.env` 并打印初始 admin 密码。改端口:
116
224
 
117
- - `tailscale serve --bg 5173` is required for the current remote-access workflow and was previously undocumented.
118
- - In both dev mode and service mode, the web entrypoint proxies `/api`, `/healthz`, and `/ws` to the API on
119
- `127.0.0.1:8787`, so you do not need a separate `tailscale serve` rule for the API port.
120
- - If the Tailscale hostname for the target machine changes, update `allowedHosts` in
121
- `apps/supervisor-web/vite.config.ts` before using remote access.
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
- ## Common Commands
233
+ 在真正拥有 workspace 的机器上安装 CLI:
125
234
 
126
235
  ```bash
127
- pnpm build
128
- pnpm lint
129
- pnpm typecheck
130
- pnpm test
131
- pnpm db:migrate
236
+ npm install -g remote-codex
132
237
  ```
133
238
 
134
- ## Documentation
135
-
136
- - [Plugin system](./docs/plugins.md)
137
-
138
- ## API Endpoints
239
+ 然后运行 relay portal 复制出来的命令,形如:
139
240
 
140
- - `GET /healthz`
141
- - `GET /api/version`
142
- - `GET /api/config/runtime`
143
- - `GET /api/workspaces`
144
- - `GET /api/workspaces/:id`
145
- - `POST /api/workspaces`
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
- ## Manual Acceptance
248
+ 复制命令默认使用 `45679`,用于避开本机常见的 `8787` 端口冲突;需要时可以手动换。
152
249
 
153
- 1. Remove prior build and local state:
250
+ ### 本地模式
154
251
 
155
252
  ```bash
156
- rm -rf node_modules .local apps/*/dist packages/*/dist
253
+ npm install -g remote-codex
254
+ remote-codex start
255
+ remote-codex status
256
+ remote-codex stop
157
257
  ```
158
258
 
159
- 2. Reinstall and start:
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
- 3. Verify API health:
274
+ 常用检查:
168
275
 
169
276
  ```bash
170
- curl http://127.0.0.1:8787/healthz
171
- curl http://127.0.0.1:8787/api/version
172
- curl http://127.0.0.1:8787/api/config/runtime
277
+ pnpm build
278
+ pnpm typecheck
279
+ pnpm test
173
280
  ```
174
281
 
175
- 4. Open the web UI at `http://127.0.0.1:5173`, add a valid workspace, then verify:
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
- - a non-existent directory
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 lint
191
- pnpm typecheck
192
- pnpm test
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`