ask-bridge 0.2.4 → 0.2.9
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.en.md +21 -4
- package/README.md +30 -3
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -39,6 +39,7 @@ Unlike typical API clients, `ask-bridge` operates inside a real Chrome browser w
|
|
|
39
39
|
- **🖥️ Pipe & Stdin Support**: Supports piping prompts via `stdin` (e.g. `cat report.txt | ask-bridge "summarize this"`).
|
|
40
40
|
- **📎 Image & File Attachments**: Attach local images with `--image` (supported on ChatGPT and Claude), or documents (PDF, Word, Excel, plain text, Markdown, JSON, etc.) with `--file`; Gemini currently supports `--file` and rejects `--image`.
|
|
41
41
|
- **🔀 Model Switching**: Use `--model` to switch the provider model before the prompt is sent, such as ChatGPT `GPT-5.4`, Gemini `3.5 Flash`, or Claude `Sonnet`.
|
|
42
|
+
- **Response Timeout**: Use `--timeout <seconds>` to control how long to wait for a provider response, defaulting to `300` seconds.
|
|
42
43
|
- **🔍 Quiet by Default & Verbose Mode**: Quiet and clean output by default (displaying only the generated response), with an optional `--verbose` flag to display full browser state logs if needed.
|
|
43
44
|
- **Version Info**: Use `-v` or `--version` to print the current version number.
|
|
44
45
|
|
|
@@ -147,8 +148,8 @@ ask-bridge --provider claude login
|
|
|
147
148
|
|
|
148
149
|
- This will automatically launch Google Chrome with a dedicated, persistent debug profile.
|
|
149
150
|
- Log in manually to the selected provider page, such as `https://chatgpt.com/`, `https://gemini.google.com/app`, or `https://claude.ai/new`.
|
|
150
|
-
-
|
|
151
|
-
-
|
|
151
|
+
- The tool now checks login status every second automatically, so you can stay on the browser and it will return immediately after login is detected.
|
|
152
|
+
- If login is not detected within `--timeout` seconds (default: 300), it will warn you to verify the result and retry.
|
|
152
153
|
|
|
153
154
|
#### Global Provider Config
|
|
154
155
|
|
|
@@ -233,7 +234,23 @@ This will print every stage of the browser automation:
|
|
|
233
234
|
- Submitting...
|
|
234
235
|
- Waiting for provider response...
|
|
235
236
|
|
|
236
|
-
### 6.
|
|
237
|
+
### 6. Response Timeout (`--timeout`)
|
|
238
|
+
|
|
239
|
+
The default wait time is 300 seconds. If a provider takes longer, increase (or decrease) the timeout:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
ask-bridge "Please summarize this report" --timeout 600
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
You can also set a shorter timeout:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
ask-bridge "Short answer" --timeout 60
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
If the response does not complete within the configured seconds, `ask-bridge` will stop waiting and print a timeout warning.
|
|
252
|
+
|
|
253
|
+
### 7. Version Info
|
|
237
254
|
|
|
238
255
|
Use `-v` or `--version` to print the current version number:
|
|
239
256
|
|
|
@@ -241,7 +258,7 @@ Use `-v` or `--version` to print the current version number:
|
|
|
241
258
|
ask-bridge -v
|
|
242
259
|
```
|
|
243
260
|
|
|
244
|
-
###
|
|
261
|
+
### 8. Piping & Stdin Support
|
|
245
262
|
|
|
246
263
|
You can pipe text or files directly into `ask-bridge`:
|
|
247
264
|
|
package/README.md
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
- **Pipe 與 stdin 支援**:支援透過 standard input 傳入 prompt,例如 `cat report.txt | ask-bridge "summarize this"`。
|
|
39
39
|
- **圖片與文件上傳**:可透過 `--image` 附上圖片(支援 ChatGPT 與 Claude),或透過 `--file` 附上文件(PDF、Word、Excel、純文字、Markdown、JSON 等皆可),一次可指定多個檔案;Gemini 目前支援 `--file`,不支援 `--image` 圖片輸入。
|
|
40
40
|
- **模型切換**:使用 `--model` 在送出 prompt 前自動切換 provider 模型(如 ChatGPT 的 `GPT-5.4`、`o3`,Gemini 的 `3.5 Flash`、`3.1 Pro`,或 Claude 的 `Sonnet`、`Opus`)。
|
|
41
|
+
- **回應超時**:使用 `--timeout <秒數>` 設定等待回應上限,預設為 `300` 秒。
|
|
41
42
|
- **預設安靜模式與 verbose 模式**:預設只輸出最終回覆;加上 `--verbose` 可顯示背景瀏覽器控制流程。
|
|
42
43
|
- **版本資訊**:使用 `-v` 或 `--version` 顯示目前版本號。
|
|
43
44
|
|
|
@@ -143,7 +144,7 @@ ask-bridge --provider claude login
|
|
|
143
144
|
- 使用專屬且持久化的 debug profile 啟動 Google Chrome。
|
|
144
145
|
- 開啟所選 provider 頁面,例如 `https://chatgpt.com/`、`https://gemini.google.com/app` 或 `https://claude.ai/new`。
|
|
145
146
|
- 等待你手動登入帳號。
|
|
146
|
-
-
|
|
147
|
+
- 本工具會每秒自動偵測登入狀態,不需要你回到終端機按 Enter;若超過 `--timeout`(預設 300 秒)仍未偵測到登入完成,會提醒你再確認一次。
|
|
147
148
|
|
|
148
149
|
此流程通常只需要執行一次。
|
|
149
150
|
|
|
@@ -232,7 +233,23 @@ Verbose 模式會顯示類似以下流程:
|
|
|
232
233
|
- 送出訊息。
|
|
233
234
|
- 等待 provider 回覆。
|
|
234
235
|
|
|
235
|
-
### 6.
|
|
236
|
+
### 6. 回應超時(`--timeout`)
|
|
237
|
+
|
|
238
|
+
回答等待預設 300 秒,若 provider 回應時間較長可提高(或降低)等待上限:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
ask-bridge "請幫我整理這份報告" --timeout 600
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
你也可以明確設定較短時間:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
ask-bridge "簡短回覆" --timeout 60
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
超過設定秒數仍未完成時,會輸出超時警告並直接結束回應等待流程。
|
|
251
|
+
|
|
252
|
+
### 7. 顯示版本
|
|
236
253
|
|
|
237
254
|
使用 `-v` 或 `--version` 顯示目前版本號:
|
|
238
255
|
|
|
@@ -240,7 +257,7 @@ Verbose 模式會顯示類似以下流程:
|
|
|
240
257
|
ask-bridge -v
|
|
241
258
|
```
|
|
242
259
|
|
|
243
|
-
###
|
|
260
|
+
### 8. Pipe 與 stdin
|
|
244
261
|
|
|
245
262
|
可透過 pipe 將文字或檔案內容傳入 `ask-bridge`:
|
|
246
263
|
|
|
@@ -339,6 +356,16 @@ ask-bridge close
|
|
|
339
356
|
|
|
340
357
|
`close` 只會關閉使用 `~/.config/ask-bridge/chrome-profile` 且監聽 debug port `9223` 的 `ask-bridge` Chrome instance;若該 port 被非 `ask-bridge` Chrome 程序占用,會回報錯誤而不會關閉它。
|
|
341
358
|
|
|
359
|
+
### 12. 更新 ask-bridge
|
|
360
|
+
|
|
361
|
+
若要直接自動更新目前安裝的 `ask-bridge`,可直接執行:
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
ask-bridge update
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
此命令會依作業系統重新執行 README 建議的官方安裝命令(macOS / Linux 或 Windows)。
|
|
368
|
+
|
|
342
369
|
## 運作原理
|
|
343
370
|
|
|
344
371
|
1. **瀏覽器初始化**:`ask-bridge` 會檢查 Chrome 是否正在監聽 debug port `9223`。若沒有,會以專屬 profile 目錄 `~/.config/ask-bridge/chrome-profile` 啟動 Google Chrome。
|