codex-webapp 0.1.2 → 0.1.4

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.ja.md CHANGED
@@ -28,34 +28,53 @@ Codex は、ターミナルだけで完結するツールから、よりアプ
28
28
 
29
29
  ## Codex App から始める
30
30
 
31
- Codex App を使っている場合は、次の指示をそのまま貼ってください。Codex が準備確認、dry-run、ローカルUIの起動、smoke test までを進め、成功・失敗を報告する想定です。
31
+ Codex App を使っている場合は、次の指示をそのまま貼ってください。Codex が「npm package を一時実行して、ローカルのWeb画面を起動し、ブラウザで開く」ことを認識しやすいように書いてあります。
32
32
 
33
33
  ```text
34
- Please set up Codex WebApp on this machine.
34
+ Codex WebApp をこのPCで起動してください。
35
35
 
36
- Use this npm package:
37
- codex-webapp
36
+ これは OpenAI 公式ではない、Codex App向けの非公式 companion UI です。
37
+ token、cookie、private repository の中身、顧客データ、内部URLは表示しないでください。
38
+ `.env` や `SECRET`、`KEY`、`TOKEN` を含むterminal出力は、AIにもissueにも貼らないでください。
38
39
 
39
- Please:
40
- 1. Check my Codex version. Codex CLI must be 0.130.0 or newer because this uses `codex remote-control`.
41
- 2. Run the package doctor.
42
- 3. Run start in dry-run mode first.
43
- 4. Start the local browser UI on localhost.
44
- 5. Smoke-test the printed local URL.
40
+ 次の順番で進めてください。
45
41
 
46
- Do not print tokens, cookies, private repo contents, customer data, or internal URLs.
47
- Keep any raw Codex browser server on localhost unless I have a trusted access boundary such as Tailscale or Cloudflare Access.
42
+ 1. まず `node -v`、`npm -v`、`npx -v` を確認してください。`npx` が使えない場合は、ここで止まり、Node.js/npm が必要だと説明してください。
43
+ 2. `npx -y codex-webapp@latest doctor` を実行して、Codex CLI 0.130.0 以上で、`codex remote-control` が使えるか確認してください。
44
+ 3. `doctor` がエラーを出した場合は、ここで止まり、`start` には進まず、原因と直し方を説明してください。
45
+ 4. `npx -y codex-webapp@latest start --dry-run` を実行して、起動予定の内容を確認してください。
46
+ 5. 問題なければ `npx -y codex-webapp@latest start` を実行して、ローカルのブラウザUIを起動してください。
47
+ 6. 起動できたら、ブラウザで `http://127.0.0.1:8214/` を開くように案内してください。
48
+ 7. この terminal window を閉じるとWeb画面は止まること、止めたいときは `Ctrl+C` を押すこと、PCを再起動した後はもう一度 `npx -y codex-webapp@latest start` が必要なことも説明してください。
49
+
50
+ 外出先のPCやスマホから使う場合は、raw UI server をpublic IPへ直接公開せず、Tailscale、Cloudflare Access、または同等の信頼できるアクセス境界を使ってください。認証なしのport-forwardingやpublic tunnelは使わないでください。
48
51
  ```
49
52
 
50
53
  実際には、おおむね次のようなコマンドが実行されます。
51
54
 
52
55
  ```bash
53
- npx -y codex-webapp doctor
54
- npx -y codex-webapp start --dry-run
55
- npx -y codex-webapp start
56
+ npx -y codex-webapp@latest doctor
57
+ npx -y codex-webapp@latest start --dry-run
58
+ npx -y codex-webapp@latest start
56
59
  ```
57
60
 
58
- `npx` は、npm に公開されている package を一時的に実行する仕組みです。試すだけなら、この repository を clone したり、手元で新しい project を作ったりする必要はありません。
61
+ `npx` は、npm に公開されている package を一時的に実行する仕組みです。試すだけなら、この repository を clone したり、手元で新しい project を作ったりする必要はありません。READMEでは、常に公開済みの最新パッチを使うため `codex-webapp@latest` を指定しています。
62
+
63
+ > **秘密情報はユーザー側でも確認してください。** Codexには秘密情報を出さないよう指示していますが、AIへの指示だけで安全が保証されるわけではありません。terminal output、`.env`、error log、issue本文を貼る前に、`SECRET`、`KEY`、`TOKEN`、cookie、顧客名、private URL が含まれていないか必ず見てください。
64
+
65
+ ## 起動中だけ使える、という基本
66
+
67
+ Codex WebApp はクラウド上に常駐するサービスではありません。あなたのPC上で `npx -y codex-webapp@latest start` が動いている間だけ、ブラウザUIが使えます。
68
+
69
+ | できごと | 何が起きるか | どうすればよいか |
70
+ | --- | --- | --- |
71
+ | terminal window を閉じた | Web画面は止まります。 | もう一度 `npx -y codex-webapp@latest start` を実行します。 |
72
+ | 起動中のUIを止めたい | terminal上のプロセスを止めます。 | 起動しているterminalで `Ctrl+C` を押してください。 |
73
+ | PCをスリープした | 復帰後に動く場合もありますが、接続が切れることがあります。 | 開けない場合は起動し直してください。 |
74
+ | PCを再起動した | プロセスは残りません。 | 再起動後にもう一度 `start` してください。 |
75
+ | 別のPCやスマホから開きたい | `127.0.0.1` は「このPC自身」を指すため、そのままでは別端末から開けません。 | Tailscale、Cloudflare Access、または同等の安全なアクセス境界を用意してください。 |
76
+
77
+ まずは同じPCのブラウザで `http://127.0.0.1:8214/` を開けるところまでを確認してください。スマホや外出先PCからの利用は、その次の段階です。認証なしのport-forwardingやpublic tunnelでraw UI serverを公開すると、意図しない第三者にあなたのPC上のCodex操作面を見せる危険があります。
59
78
 
60
79
  ## ターミナルから始める
61
80
 
@@ -127,7 +146,7 @@ Codex WebApp は telemetry、analytics、browser extension、project-operated ph
127
146
  | Codex CLI | `codex remote-control` を使うため、`0.130.0` 以上が必要です。 |
128
147
  | Node.js | `20` 以上が必要です。 |
129
148
  | network binding | デフォルトは `127.0.0.1`。非 loopback host は明示的な opt-in が必要です。 |
130
- | package channel | npm の `latest` channel から `codex-webapp` を使ってください。現在の release は `0.1.2` です。 |
149
+ | package channel | npm の `latest` channel から `codex-webapp` を使ってください。現在の release は `0.1.4` です。 |
131
150
 
132
151
  Codex が入っていない、または古い場合は、先に更新してください。
133
152
 
package/README.md CHANGED
@@ -57,6 +57,19 @@ npx -y codex-webapp start
57
57
 
58
58
  `npx` runs the published npm package temporarily. You do not need to create a project, clone this repository, or install Codex WebApp by hand just to try it.
59
59
 
60
+ ## It only works while the process is running
61
+
62
+ Codex WebApp is not a hosted cloud service. The browser UI is available only while `npx -y codex-webapp start` is running on your computer.
63
+
64
+ | Event | What happens | What to do |
65
+ | --- | --- | --- |
66
+ | You close the terminal window | The browser UI stops. | Run `npx -y codex-webapp start` again. |
67
+ | The computer sleeps | The connection may survive, but it can also break. | Restart the command if the page no longer opens. |
68
+ | The computer restarts | The process is gone. | Run `start` again after rebooting. |
69
+ | You want to open it from a phone or another PC | `127.0.0.1` means “this same computer,” so another device cannot use that URL directly. | Put Tailscale, Cloudflare Access, or an equivalent trusted access boundary in front first. |
70
+
71
+ Start with the same computer first: run the command, then open `http://127.0.0.1:8214/` in that computer’s browser. Phone and remote access should come after that local check passes.
72
+
60
73
  ## Quick start from a terminal
61
74
 
62
75
  Use this route if you prefer to control the commands yourself. Codex WebApp requires **Node.js 20 or newer** and **Codex CLI 0.130.0 or newer**.
@@ -127,7 +140,7 @@ Codex WebApp does not include telemetry, analytics, a browser extension, or a pr
127
140
  | Codex CLI | `0.130.0` or newer, because `codex remote-control` is required. |
128
141
  | Node.js | `20` or newer. |
129
142
  | Network binding | `127.0.0.1` by default. Non-loopback hosts require explicit opt-in. |
130
- | Package channel | `codex-webapp` from the npm `latest` channel. Current release: `0.1.2`. |
143
+ | Package channel | `codex-webapp` from the npm `latest` channel. Current release: `0.1.4`. |
131
144
 
132
145
  If Codex is missing or too old, update it first.
133
146
 
@@ -15,24 +15,26 @@ Tailscale, Cloudflare Access, or an equivalent trusted boundary.
15
15
 
16
16
  ## Paste Prompt
17
17
 
18
- Paste this prompt into Codex App:
18
+ Paste this prompt into Codex App. Japanese is intentional here: it is written for users who may be more comfortable asking Codex App in Japanese.
19
19
 
20
20
  ```text
21
- Please verify Codex WebApp on this machine.
22
-
23
- Constraints:
24
- - Treat it as an unofficial companion UI, not an OpenAI-endorsed tool.
25
- - Do not paste or print tokens, cookies, private repository content, customer data, or internal URLs.
26
- - Keep any raw Codex browser server or app-server on localhost or behind Tailscale, Cloudflare Access, or an equivalent trusted boundary.
27
-
28
- Steps:
29
- 1. Check whether Codex is available and whether `codex remote-control --help` works.
30
- 2. If Codex is older than 0.130.0, explain the update that is needed.
31
- 3. Run `npx codex-webapp doctor`.
32
- 4. Run `npx codex-webapp start --dry-run`.
33
- 5. If a UI server is available, run `npx codex-webapp smoke --url http://127.0.0.1:8214/`.
34
- 6. Use `--browser --screenshot artifacts/codex-webapp.png` only when browser evidence is needed.
35
- 7. Summarize pass/fail status and start a small diagnosis if a step fails.
21
+ Codex WebApp をこのPCで起動してください。
22
+
23
+ これは OpenAI 公式ではない、Codex App向けの非公式 companion UI です。
24
+ token、cookie、private repository の中身、顧客データ、内部URLは表示しないでください。
25
+ `.env` `SECRET`、`KEY`、`TOKEN` を含むterminal出力は、AIにもissueにも貼らないでください。
26
+
27
+ 次の順番で進めてください。
28
+
29
+ 1. まず `node -v`、`npm -v`、`npx -v` を確認してください。`npx` が使えない場合は、ここで止まり、Node.js/npm が必要だと説明してください。
30
+ 2. `npx -y codex-webapp@latest doctor` を実行して、Codex CLI 0.130.0 以上で、`codex remote-control` が使えるか確認してください。
31
+ 3. `doctor` がエラーを出した場合は、ここで止まり、`start` には進まず、原因と直し方を説明してください。
32
+ 4. `npx -y codex-webapp@latest start --dry-run` を実行して、起動予定の内容を確認してください。
33
+ 5. 問題なければ `npx -y codex-webapp@latest start` を実行して、ローカルのブラウザUIを起動してください。
34
+ 6. 起動できたら、ブラウザで `http://127.0.0.1:8214/` を開くように案内してください。
35
+ 7. この terminal window を閉じるとWeb画面は止まること、止めたいときは `Ctrl+C` を押すこと、PCを再起動した後はもう一度 `npx -y codex-webapp@latest start` が必要なことも説明してください。
36
+
37
+ 外出先のPCやスマホから使う場合は、raw UI server をpublic IPへ直接公開せず、Tailscale、Cloudflare Access、または同等の信頼できるアクセス境界を使ってください。認証なしのport-forwardingやpublic tunnelは使わないでください。
36
38
  ```
37
39
 
38
40
  The proof we want is not that a developer can type commands. The proof is that
@@ -80,7 +80,7 @@ npx -y codex-webapp smoke \
80
80
 
81
81
  이 패키지는 Codex App native marketplace plugin, browser extension, one-click installer, managed hosting service가 아닙니다. Codex App에 프롬프트를 붙여 넣고, Codex가 `npx`로 npm 패키지를 실행하는 방식입니다.
82
82
 
83
- 현재 release는 `0.1.2`이며 early, compatibility-first입니다. 현재 `0xcaff/codex-web` commit `585613f5a3a355af5aefc388ca4e31b07a472cda`를 참조하는 Codex 스타일 browser runtime을 실행하고, 그 주변에 설치, 안전, 문서, 검증 evidence 계층을 더합니다.
83
+ 현재 release는 `0.1.4`이며 early, compatibility-first입니다. 현재 `0xcaff/codex-web` commit `585613f5a3a355af5aefc388ca4e31b07a472cda`를 참조하는 Codex 스타일 browser runtime을 실행하고, 그 주변에 설치, 안전, 문서, 검증 evidence 계층을 더합니다.
84
84
 
85
85
  ## Security And Privacy
86
86
 
@@ -80,7 +80,7 @@ npx -y codex-webapp smoke \
80
80
 
81
81
  这不是 Codex App native marketplace plugin、browser extension、one-click installer 或 managed hosting service。它的使用方式是:把提示词粘贴到 Codex App,让 Codex 通过 `npx` 执行 npm 包。
82
82
 
83
- 当前 release 为 `0.1.2`,仍处于 early 阶段,并采用 compatibility-first 方针。它目前运行一个引用 `0xcaff/codex-web` commit `585613f5a3a355af5aefc388ca4e31b07a472cda` 的 Codex 风格 browser runtime,并在其周围增加安装、安全、文档和验证证据层。
83
+ 当前 release 为 `0.1.4`,仍处于 early 阶段,并采用 compatibility-first 方针。它目前运行一个引用 `0xcaff/codex-web` commit `585613f5a3a355af5aefc388ca4e31b07a472cda` 的 Codex 风格 browser runtime,并在其周围增加安装、安全、文档和验证证据层。
84
84
 
85
85
  ## Security And Privacy
86
86
 
@@ -24,7 +24,7 @@ codex remote-control --help
24
24
  ## 3. friendly doctor を実行
25
25
 
26
26
  ```bash
27
- npx codex-webapp doctor
27
+ npx -y codex-webapp doctor
28
28
  ```
29
29
 
30
30
  Codexが古い、または `remote-control` が見つからない場合は、次に打つべきコマンドを表示します。
@@ -32,13 +32,13 @@ Codexが古い、または `remote-control` が見つからない場合は、次
32
32
  ## 4. Codex-style Web UI を起動
33
33
 
34
34
  ```bash
35
- npx codex-webapp start
35
+ npx -y codex-webapp start
36
36
  ```
37
37
 
38
38
  このコマンドは起動前に確認プロンプトを出します。自動化された信頼済み環境だけで `--yes` を使ってください。
39
39
 
40
40
  ```bash
41
- npx codex-webapp start --yes
41
+ npx -y codex-webapp start --yes
42
42
  ```
43
43
 
44
44
  ## 5. ブラウザで表示できるか確認
@@ -46,7 +46,7 @@ npx codex-webapp start --yes
46
46
  UIサーバーが起動している状態で、実ブラウザ疎通を確認します。
47
47
 
48
48
  ```bash
49
- npx codex-webapp smoke \
49
+ npx -y codex-webapp smoke \
50
50
  --url http://127.0.0.1:8214/
51
51
  ```
52
52
 
@@ -55,7 +55,7 @@ npx codex-webapp smoke \
55
55
  スクリーンショットも残したい場合は、Playwrightを使うdeep smokeを実行します。
56
56
 
57
57
  ```bash
58
- npx codex-webapp smoke \
58
+ npx -y codex-webapp smoke \
59
59
  --browser \
60
60
  --url http://127.0.0.1:8214/ \
61
61
  --screenshot artifacts/codex-webapp.png
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-webapp",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Unofficial. Respectful web app surface, doctor, and safety wrapper for Codex App users.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/src/commands.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { spawn, spawnSync } from "node:child_process";
2
+ import { createServer } from "node:net";
2
3
  import { createInterface } from "node:readline/promises";
3
4
  import { stdin as input, stdout as output } from "node:process";
4
5
 
@@ -17,6 +18,17 @@ import {
17
18
  } from "./codexWeb.js";
18
19
 
19
20
  const BANNER = "Codex WebApp — unofficial OpenAI Codex companion; not endorsed by OpenAI.";
21
+ const DEFAULT_WEB_URL = "http://127.0.0.1:8214/";
22
+
23
+ function codexAppFlowLines(url = DEFAULT_WEB_URL) {
24
+ return [
25
+ "Codex App flow:",
26
+ " 1. Paste a setup request into the Codex App prompt.",
27
+ " 2. Codex runs: npx -y codex-webapp start",
28
+ ` 3. When it starts, open: ${url}`,
29
+ " 4. Keep this terminal window open. Closing it will stop the browser UI.",
30
+ ];
31
+ }
20
32
 
21
33
  export function main(argv = process.argv) {
22
34
  const command = argv[2] ?? "help";
@@ -97,7 +109,9 @@ export function doctor() {
97
109
  "`codex remote-control` is available.",
98
110
  `codex-web reference: ${CODEX_WEB_REFERENCE}`,
99
111
  "Next:",
100
- " npx codex-webapp start",
112
+ " npx -y codex-webapp start",
113
+ "",
114
+ ...codexAppFlowLines(),
101
115
  ]);
102
116
  }
103
117
 
@@ -126,12 +140,17 @@ export async function start(args = []) {
126
140
  BANNER,
127
141
  "Dry run passed.",
128
142
  `Would start codex-web: ${plannedWebUrl}`,
143
+ "",
144
+ ...codexAppFlowLines(plannedWebUrl),
145
+ "",
129
146
  "Would start:",
130
147
  ` npx ${npxArgs.join(" ")}`,
131
148
  ]);
132
149
  return;
133
150
  }
134
151
 
152
+ await assertPortAvailable(options.host, options.port);
153
+
135
154
  if (!options.yes) {
136
155
  console.log(BANNER);
137
156
  console.log(`About to start codex-web: ${plannedWebUrl}`);
@@ -148,6 +167,9 @@ export async function start(args = []) {
148
167
 
149
168
  console.log(`Starting codex-web from ${CODEX_WEB_REFERENCE}...`);
150
169
  console.log(`Open: ${plannedWebUrl}`);
170
+ console.log("");
171
+ for (const line of codexAppFlowLines(plannedWebUrl)) console.log(line);
172
+ console.log("");
151
173
  console.log("Keep this terminal open. Expose it only through a trusted local, Tailscale, Cloudflare Access, or equivalent boundary.");
152
174
  const codexPath = resolveCodexPath();
153
175
  const child = spawn("npx", npxArgs, {
@@ -162,6 +184,23 @@ export async function start(args = []) {
162
184
  });
163
185
  }
164
186
 
187
+ async function assertPortAvailable(host, port) {
188
+ await new Promise((resolve, reject) => {
189
+ const server = createServer();
190
+ server.once("error", (error) => {
191
+ if (error?.code === "EADDRINUSE") {
192
+ reject(new Error(`Port ${port} is already in use on ${host}. Codex WebApp may already be running. Close the other terminal window, or start with --port <port>.`));
193
+ return;
194
+ }
195
+ reject(error);
196
+ });
197
+ server.once("listening", () => {
198
+ server.close(resolve);
199
+ });
200
+ server.listen(port, host);
201
+ });
202
+ }
203
+
165
204
  export function help() {
166
205
  console.log(`${BANNER}
167
206
 
@@ -176,8 +215,16 @@ Commands:
176
215
  codex-webapp smoke --url http://127.0.0.1:8214/
177
216
  codex-webapp smoke --browser --screenshot artifacts/codex-webapp.png
178
217
 
179
- Quick start:
180
- npx codex-webapp doctor
218
+ Quick start from Codex App:
219
+ Paste a request that asks Codex to run:
220
+ npx -y codex-webapp doctor
221
+ npx -y codex-webapp start
222
+ Then open:
223
+ ${DEFAULT_WEB_URL}
224
+
225
+ Terminal quick start:
226
+ npx -y codex-webapp doctor
227
+ npx -y codex-webapp start
181
228
  `);
182
229
  }
183
230