@jackwener/opencli 1.0.1 → 1.0.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/.github/workflows/build-extension.yml +80 -0
- package/.github/workflows/ci.yml +6 -6
- package/.github/workflows/docs.yml +52 -0
- package/.github/workflows/e2e-headed.yml +2 -2
- package/.github/workflows/pkg-pr-new.yml +2 -2
- package/.github/workflows/release.yml +2 -5
- package/.github/workflows/security.yml +2 -2
- package/CDP.md +1 -1
- package/CDP.zh-CN.md +1 -1
- package/README.md +42 -34
- package/README.zh-CN.md +42 -34
- package/SKILL.md +3 -5
- package/dist/browser/cdp.d.ts +42 -0
- package/dist/browser/cdp.js +339 -0
- package/dist/browser/daemon-client.d.ts +3 -1
- package/dist/browser/daemon-client.js +4 -0
- package/dist/browser/dom-helpers.d.ts +20 -0
- package/dist/browser/dom-helpers.js +109 -0
- package/dist/browser/index.d.ts +3 -0
- package/dist/browser/index.js +4 -0
- package/dist/browser/mcp.d.ts +1 -0
- package/dist/browser/mcp.js +10 -5
- package/dist/browser/page.d.ts +7 -0
- package/dist/browser/page.js +39 -123
- package/dist/browser/utils.d.ts +10 -0
- package/dist/browser/utils.js +27 -0
- package/dist/browser.test.js +49 -1
- package/dist/build-manifest.js +3 -1
- package/dist/build-manifest.test.js +34 -0
- package/dist/capabilityRouting.d.ts +2 -0
- package/dist/capabilityRouting.js +30 -0
- package/dist/capabilityRouting.test.d.ts +1 -0
- package/dist/capabilityRouting.test.js +42 -0
- package/dist/chaoxing.d.ts +58 -0
- package/dist/chaoxing.js +225 -0
- package/dist/chaoxing.test.d.ts +1 -0
- package/dist/chaoxing.test.js +45 -0
- package/dist/cli-manifest.json +885 -48
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +234 -0
- package/dist/clis/antigravity/serve.d.ts +14 -0
- package/dist/clis/antigravity/serve.js +263 -0
- package/dist/clis/bilibili/download.js +4 -14
- package/dist/clis/boss/chatlist.d.ts +1 -0
- package/dist/clis/boss/chatlist.js +50 -0
- package/dist/clis/boss/chatmsg.d.ts +1 -0
- package/dist/clis/boss/chatmsg.js +73 -0
- package/dist/clis/boss/resume.d.ts +1 -0
- package/dist/clis/boss/resume.js +249 -0
- package/dist/clis/boss/send.d.ts +1 -0
- package/dist/clis/boss/send.js +176 -0
- package/dist/clis/chaoxing/assignments.d.ts +1 -0
- package/dist/clis/chaoxing/assignments.js +74 -0
- package/dist/clis/chaoxing/exams.d.ts +1 -0
- package/dist/clis/chaoxing/exams.js +74 -0
- package/dist/clis/chatgpt/ask.js +15 -14
- package/dist/clis/chatgpt/ax.d.ts +1 -0
- package/dist/clis/chatgpt/ax.js +78 -0
- package/dist/clis/chatgpt/read.js +5 -6
- package/dist/clis/hf/top.d.ts +1 -0
- package/dist/clis/hf/top.js +119 -0
- package/dist/clis/jike/comment.d.ts +1 -0
- package/dist/clis/jike/comment.js +107 -0
- package/dist/clis/jike/create.d.ts +1 -0
- package/dist/clis/jike/create.js +106 -0
- package/dist/clis/jike/feed.d.ts +1 -0
- package/dist/clis/jike/feed.js +67 -0
- package/dist/clis/jike/like.d.ts +1 -0
- package/dist/clis/jike/like.js +61 -0
- package/dist/clis/jike/notifications.d.ts +1 -0
- package/dist/clis/jike/notifications.js +169 -0
- package/dist/clis/jike/post.yaml +58 -0
- package/dist/clis/jike/repost.d.ts +1 -0
- package/dist/clis/jike/repost.js +103 -0
- package/dist/clis/jike/search.d.ts +1 -0
- package/dist/clis/jike/search.js +67 -0
- package/dist/clis/jike/shared.d.ts +19 -0
- package/dist/clis/jike/shared.js +25 -0
- package/dist/clis/jike/topic.yaml +52 -0
- package/dist/clis/jike/user.yaml +51 -0
- package/dist/clis/smzdm/search.js +28 -39
- package/dist/clis/stackoverflow/bounties.yaml +29 -0
- package/dist/clis/stackoverflow/hot.yaml +28 -0
- package/dist/clis/stackoverflow/search.yaml +32 -0
- package/dist/clis/stackoverflow/unanswered.yaml +28 -0
- package/dist/clis/twitter/download.js +6 -16
- package/dist/clis/twitter/post.js +9 -2
- package/dist/clis/twitter/search.js +14 -33
- package/dist/clis/xiaohongshu/download.d.ts +1 -1
- package/dist/clis/xiaohongshu/download.js +4 -4
- package/dist/clis/zhihu/download.js +3 -3
- package/dist/doctor.d.ts +7 -0
- package/dist/doctor.js +16 -0
- package/dist/download/index.d.ts +12 -8
- package/dist/download/index.js +11 -3
- package/dist/download/index.test.d.ts +1 -0
- package/dist/download/index.test.js +14 -0
- package/dist/engine.js +25 -14
- package/dist/explore.d.ts +1 -0
- package/dist/explore.js +48 -103
- package/dist/generate.js +1 -0
- package/dist/interceptor.js +3 -2
- package/dist/main.js +4 -193
- package/dist/output.d.ts +2 -1
- package/dist/output.js +3 -1
- package/dist/pipeline/executor.test.js +1 -0
- package/dist/pipeline/steps/download.js +14 -18
- package/dist/registry.d.ts +4 -3
- package/dist/registry.js +5 -2
- package/dist/runtime.d.ts +4 -1
- package/dist/runtime.js +2 -2
- package/dist/scripts/framework.d.ts +4 -0
- package/dist/scripts/framework.js +21 -0
- package/dist/scripts/interact.d.ts +4 -0
- package/dist/scripts/interact.js +20 -0
- package/dist/scripts/store.d.ts +9 -0
- package/dist/scripts/store.js +44 -0
- package/dist/synthesize.js +1 -1
- package/dist/types.d.ts +12 -0
- package/dist/verify.d.ts +6 -1
- package/dist/verify.js +54 -2
- package/docs/.vitepress/config.mts +193 -0
- package/docs/adapters/browser/apple-podcasts.md +28 -0
- package/docs/adapters/browser/bbc.md +26 -0
- package/docs/adapters/browser/bilibili.md +38 -0
- package/docs/adapters/browser/boss.md +28 -0
- package/docs/adapters/browser/coupang.md +28 -0
- package/docs/adapters/browser/ctrip.md +27 -0
- package/docs/adapters/browser/github.md +26 -0
- package/docs/adapters/browser/hackernews.md +26 -0
- package/docs/adapters/browser/linkedin.md +27 -0
- package/docs/adapters/browser/reddit.md +41 -0
- package/docs/adapters/browser/reuters.md +27 -0
- package/docs/adapters/browser/smzdm.md +27 -0
- package/docs/adapters/browser/twitter.md +47 -0
- package/docs/adapters/browser/v2ex.md +32 -0
- package/docs/adapters/browser/weibo.md +27 -0
- package/docs/adapters/browser/xiaohongshu.md +32 -0
- package/docs/adapters/browser/xiaoyuzhou.md +28 -0
- package/docs/adapters/browser/xueqiu.md +32 -0
- package/docs/adapters/browser/yahoo-finance.md +26 -0
- package/docs/adapters/browser/youtube.md +29 -0
- package/docs/adapters/browser/zhihu.md +30 -0
- package/docs/adapters/desktop/antigravity.md +46 -0
- package/docs/adapters/desktop/chatgpt.md +43 -0
- package/docs/adapters/desktop/chatwise.md +38 -0
- package/docs/adapters/desktop/codex.md +32 -0
- package/docs/adapters/desktop/cursor.md +33 -0
- package/docs/adapters/desktop/discord.md +28 -0
- package/docs/adapters/desktop/feishu.md +20 -0
- package/docs/adapters/desktop/neteasemusic.md +31 -0
- package/docs/adapters/desktop/notion.md +29 -0
- package/docs/adapters/desktop/wechat.md +28 -0
- package/docs/adapters/index.md +49 -0
- package/docs/advanced/cdp.md +103 -0
- package/docs/advanced/download.md +63 -0
- package/docs/advanced/electron.md +125 -0
- package/docs/advanced/remote-chrome.md +72 -0
- package/docs/developer/ai-workflow.md +66 -0
- package/docs/developer/architecture.md +90 -0
- package/docs/developer/contributing.md +136 -0
- package/docs/developer/testing.md +237 -0
- package/docs/developer/ts-adapter.md +87 -0
- package/docs/developer/yaml-adapter.md +108 -0
- package/docs/guide/browser-bridge.md +38 -0
- package/docs/guide/getting-started.md +56 -0
- package/docs/guide/installation.md +37 -0
- package/docs/guide/troubleshooting.md +56 -0
- package/docs/index.md +35 -0
- package/docs/zh/adapters/index.md +5 -0
- package/docs/zh/advanced/cdp.md +3 -0
- package/docs/zh/developer/contributing.md +24 -0
- package/docs/zh/guide/browser-bridge.md +25 -0
- package/docs/zh/guide/getting-started.md +40 -0
- package/docs/zh/guide/installation.md +37 -0
- package/docs/zh/index.md +29 -0
- package/extension/dist/background.js +386 -438
- package/extension/manifest.json +2 -2
- package/extension/package-lock.json +1156 -0
- package/extension/src/background.test.ts +151 -0
- package/extension/src/background.ts +124 -53
- package/extension/src/protocol.ts +3 -1
- package/package.json +7 -3
- package/src/browser/cdp.ts +367 -0
- package/src/browser/daemon-client.ts +7 -1
- package/src/browser/dom-helpers.ts +116 -0
- package/src/browser/index.ts +4 -0
- package/src/browser/mcp.ts +14 -6
- package/src/browser/page.ts +47 -124
- package/src/browser/utils.ts +27 -0
- package/src/browser.test.ts +56 -0
- package/src/build-manifest.test.ts +36 -0
- package/src/build-manifest.ts +2 -1
- package/src/capabilityRouting.test.ts +47 -0
- package/src/capabilityRouting.ts +28 -0
- package/src/chaoxing.test.ts +53 -0
- package/src/chaoxing.ts +268 -0
- package/src/cli.ts +205 -0
- package/src/clis/antigravity/SKILL.md +5 -0
- package/src/clis/antigravity/serve.ts +329 -0
- package/src/clis/bilibili/download.ts +4 -15
- package/src/clis/boss/chatlist.ts +50 -0
- package/src/clis/boss/chatmsg.ts +70 -0
- package/src/clis/boss/resume.ts +262 -0
- package/src/clis/boss/send.ts +193 -0
- package/src/clis/chaoxing/README.md +36 -0
- package/src/clis/chaoxing/README.zh-CN.md +35 -0
- package/src/clis/chaoxing/assignments.ts +88 -0
- package/src/clis/chaoxing/exams.ts +88 -0
- package/src/clis/chatgpt/ask.ts +14 -15
- package/src/clis/chatgpt/ax.ts +81 -0
- package/src/clis/chatgpt/read.ts +5 -7
- package/src/clis/hf/top.ts +141 -0
- package/src/clis/jike/comment.ts +113 -0
- package/src/clis/jike/create.ts +113 -0
- package/src/clis/jike/feed.ts +74 -0
- package/src/clis/jike/like.ts +65 -0
- package/src/clis/jike/notifications.ts +185 -0
- package/src/clis/jike/post.yaml +58 -0
- package/src/clis/jike/repost.ts +114 -0
- package/src/clis/jike/search.ts +74 -0
- package/src/clis/jike/shared.ts +36 -0
- package/src/clis/jike/topic.yaml +52 -0
- package/src/clis/jike/user.yaml +51 -0
- package/src/clis/smzdm/search.ts +30 -39
- package/src/clis/stackoverflow/bounties.yaml +29 -0
- package/src/clis/stackoverflow/hot.yaml +28 -0
- package/src/clis/stackoverflow/search.yaml +32 -0
- package/src/clis/stackoverflow/unanswered.yaml +28 -0
- package/src/clis/twitter/download.ts +6 -17
- package/src/clis/twitter/post.ts +9 -2
- package/src/clis/twitter/search.ts +15 -33
- package/src/clis/xiaohongshu/download.ts +4 -4
- package/src/clis/zhihu/download.ts +3 -3
- package/src/doctor.ts +18 -2
- package/src/download/index.test.ts +16 -0
- package/src/download/index.ts +22 -4
- package/src/engine.ts +20 -13
- package/src/explore.ts +54 -103
- package/src/generate.ts +1 -0
- package/src/interceptor.ts +3 -2
- package/src/main.ts +4 -180
- package/src/output.ts +15 -13
- package/src/pipeline/executor.test.ts +1 -0
- package/src/pipeline/steps/download.ts +14 -17
- package/src/registry.ts +9 -5
- package/src/runtime.ts +3 -2
- package/src/scripts/framework.ts +20 -0
- package/src/scripts/interact.ts +22 -0
- package/src/scripts/store.ts +40 -0
- package/src/synthesize.ts +1 -1
- package/src/types.ts +9 -0
- package/src/verify.ts +64 -3
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: Build Chrome Extension
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
tags: [ "v*.*.*" ]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [ "main" ]
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout Code
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Setup Node.js
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: 20
|
|
24
|
+
cache: 'npm'
|
|
25
|
+
cache-dependency-path: extension/package-lock.json
|
|
26
|
+
|
|
27
|
+
- name: Install extension dependencies
|
|
28
|
+
run: npm ci
|
|
29
|
+
working-directory: extension
|
|
30
|
+
|
|
31
|
+
- name: Build extension
|
|
32
|
+
run: npm run build
|
|
33
|
+
working-directory: extension
|
|
34
|
+
|
|
35
|
+
- name: Prepare extension package
|
|
36
|
+
run: |
|
|
37
|
+
rm -rf extension-package
|
|
38
|
+
mkdir -p extension-package
|
|
39
|
+
cp extension/manifest.json extension-package/
|
|
40
|
+
cp -R extension/dist extension-package/
|
|
41
|
+
cp -R extension/icons extension-package/
|
|
42
|
+
|
|
43
|
+
- name: Create Extension ZIP
|
|
44
|
+
run: |
|
|
45
|
+
cd extension-package
|
|
46
|
+
zip -r ../opencli-extension.zip .
|
|
47
|
+
|
|
48
|
+
- name: Create Extension CRX
|
|
49
|
+
run: |
|
|
50
|
+
npm install -g crx3
|
|
51
|
+
if [ -n "${{ secrets.CRX_PRIVATE_KEY }}" ]; then
|
|
52
|
+
echo "Found CRX_PRIVATE_KEY, signing extension..."
|
|
53
|
+
echo "${{ secrets.CRX_PRIVATE_KEY }}" > crx-key.pem
|
|
54
|
+
crx3 pack extension-package -o opencli-extension.crx -p crx-key.pem
|
|
55
|
+
rm crx-key.pem
|
|
56
|
+
else
|
|
57
|
+
echo "No CRX_PRIVATE_KEY configured. Generating CRX with a temporary random key..."
|
|
58
|
+
crx3 pack extension-package -o opencli-extension.crx
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
- name: Upload Artifacts (Action Run)
|
|
62
|
+
uses: actions/upload-artifact@v4
|
|
63
|
+
with:
|
|
64
|
+
name: opencli-extension-build
|
|
65
|
+
path: |
|
|
66
|
+
opencli-extension.zip
|
|
67
|
+
opencli-extension.crx
|
|
68
|
+
retention-days: 7
|
|
69
|
+
|
|
70
|
+
- name: Attach to GitHub Release
|
|
71
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
72
|
+
uses: softprops/action-gh-release@v2
|
|
73
|
+
with:
|
|
74
|
+
files: |
|
|
75
|
+
opencli-extension.zip
|
|
76
|
+
opencli-extension.crx
|
|
77
|
+
draft: false
|
|
78
|
+
prerelease: false
|
|
79
|
+
env:
|
|
80
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -18,9 +18,9 @@ jobs:
|
|
|
18
18
|
build:
|
|
19
19
|
runs-on: ubuntu-latest
|
|
20
20
|
steps:
|
|
21
|
-
- uses: actions/checkout@
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
22
|
|
|
23
|
-
- uses: actions/setup-node@
|
|
23
|
+
- uses: actions/setup-node@v4
|
|
24
24
|
with:
|
|
25
25
|
node-version: '22'
|
|
26
26
|
cache: 'npm'
|
|
@@ -43,9 +43,9 @@ jobs:
|
|
|
43
43
|
node-version: ['20', '22']
|
|
44
44
|
shard: [1, 2]
|
|
45
45
|
steps:
|
|
46
|
-
- uses: actions/checkout@
|
|
46
|
+
- uses: actions/checkout@v4
|
|
47
47
|
|
|
48
|
-
- uses: actions/setup-node@
|
|
48
|
+
- uses: actions/setup-node@v4
|
|
49
49
|
with:
|
|
50
50
|
node-version: ${{ matrix.node-version }}
|
|
51
51
|
cache: 'npm'
|
|
@@ -62,9 +62,9 @@ jobs:
|
|
|
62
62
|
needs: build
|
|
63
63
|
runs-on: ubuntu-latest
|
|
64
64
|
steps:
|
|
65
|
-
- uses: actions/checkout@
|
|
65
|
+
- uses: actions/checkout@v4
|
|
66
66
|
|
|
67
|
-
- uses: actions/setup-node@
|
|
67
|
+
- uses: actions/setup-node@v4
|
|
68
68
|
with:
|
|
69
69
|
node-version: '22'
|
|
70
70
|
cache: 'npm'
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Deploy Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
paths: ['docs/**']
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
pages: write
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: pages
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
with:
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
|
|
26
|
+
- uses: actions/setup-node@v4
|
|
27
|
+
with:
|
|
28
|
+
node-version: 20
|
|
29
|
+
cache: npm
|
|
30
|
+
|
|
31
|
+
- name: Install dependencies
|
|
32
|
+
run: npm ci
|
|
33
|
+
|
|
34
|
+
- name: Build docs
|
|
35
|
+
run: npm run docs:build
|
|
36
|
+
|
|
37
|
+
- uses: actions/configure-pages@v4
|
|
38
|
+
|
|
39
|
+
- uses: actions/upload-pages-artifact@v3
|
|
40
|
+
with:
|
|
41
|
+
path: docs/.vitepress/dist
|
|
42
|
+
|
|
43
|
+
deploy:
|
|
44
|
+
environment:
|
|
45
|
+
name: github-pages
|
|
46
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
47
|
+
needs: build
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
steps:
|
|
50
|
+
- name: Deploy to GitHub Pages
|
|
51
|
+
id: deployment
|
|
52
|
+
uses: actions/deploy-pages@v4
|
|
@@ -13,9 +13,9 @@ jobs:
|
|
|
13
13
|
if: ${{ vars.PKG_PR_NEW_ENABLED == 'true' }}
|
|
14
14
|
runs-on: ubuntu-latest
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
17
|
|
|
18
|
-
- uses: actions/setup-node@
|
|
18
|
+
- uses: actions/setup-node@v4
|
|
19
19
|
with:
|
|
20
20
|
node-version: '22'
|
|
21
21
|
cache: 'npm'
|
|
@@ -13,9 +13,9 @@ jobs:
|
|
|
13
13
|
release:
|
|
14
14
|
runs-on: ubuntu-latest
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
17
|
|
|
18
|
-
- uses: actions/setup-node@
|
|
18
|
+
- uses: actions/setup-node@v4
|
|
19
19
|
with:
|
|
20
20
|
node-version: '22'
|
|
21
21
|
registry-url: 'https://registry.npmjs.org'
|
|
@@ -26,9 +26,6 @@ jobs:
|
|
|
26
26
|
- name: Type check
|
|
27
27
|
run: npx tsc --noEmit
|
|
28
28
|
|
|
29
|
-
- name: Build
|
|
30
|
-
run: npm run build
|
|
31
|
-
|
|
32
29
|
- name: Create GitHub Release
|
|
33
30
|
uses: softprops/action-gh-release@v2
|
|
34
31
|
with:
|
package/CDP.md
CHANGED
|
@@ -98,6 +98,6 @@ opencli doctor # Verify connection
|
|
|
98
98
|
opencli bilibili hot --limit 5 # Test a command
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
> *Tip: OpenCLI
|
|
101
|
+
> *Tip: If you provide a standard HTTP/HTTPS CDP endpoint, OpenCLI requests the `/json` target list and picks the most likely inspectable app/page target automatically. If multiple app targets exist, you can further narrow selection with `OPENCLI_CDP_TARGET` (for example `antigravity` or `codex`).*
|
|
102
102
|
|
|
103
103
|
If you plan to use this setup frequently, you can persist the environment variable by adding the `export` line to your `~/.bashrc` or `~/.zshrc` on the server.
|
package/CDP.zh-CN.md
CHANGED
|
@@ -98,6 +98,6 @@ opencli doctor # 查看并验证连接是否通畅
|
|
|
98
98
|
opencli bilibili hot --limit 5 # 执行目标命令
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
> *Tip: 如果你填写的是一个普通 HTTP/HTTPS 的
|
|
101
|
+
> *Tip: 如果你填写的是一个普通 HTTP/HTTPS 的 CDP 地址,OpenCLI 会自动请求 `/json` target 列表,并挑选最可能的 app/page target;如果同一个端口下暴露了多个应用 target,还可以通过 `OPENCLI_CDP_TARGET`(例如 `antigravity`、`codex`)进一步缩小匹配范围。*
|
|
102
102
|
|
|
103
103
|
如果你想在此服务器上永久启用该配置,可以将对应的 `export` 语句追加进入你的 `~/.bashrc` 或 `~/.zshrc` 配置文件中。
|
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ Turn ANY Electron application into a CLI tool! Recombine, script, and extend app
|
|
|
39
39
|
- **CLI All Electron** — CLI-ify apps like Antigravity Ultra! Now AI can control itself natively using cc/openclaw!
|
|
40
40
|
- **Account-safe** — Reuses Chrome's logged-in state; your credentials never leave the browser.
|
|
41
41
|
- **AI Agent ready** — `explore` discovers APIs, `synthesize` generates adapters, `cascade` finds auth strategies.
|
|
42
|
-
- **Self-healing setup** — `opencli setup`
|
|
42
|
+
- **Self-healing setup** — `opencli setup` verifies Browser Bridge connectivity; `opencli doctor` diagnoses daemon, extension, and live browser connectivity.
|
|
43
43
|
- **Dynamic Loader** — Simply drop `.ts` or `.yaml` adapters into the `clis/` folder for auto-registration.
|
|
44
44
|
- **Dual-Engine Architecture** — Supports both YAML declarative data pipelines and robust browser runtime TypeScript injections.
|
|
45
45
|
|
|
@@ -54,10 +54,18 @@ OpenCLI connects to your browser through a lightweight **Browser Bridge** Chrome
|
|
|
54
54
|
|
|
55
55
|
### Browser Bridge Extension Setup
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
You can install the extension via either method:
|
|
58
|
+
|
|
59
|
+
**Method 1: Download Pre-built Release (Recommended)**
|
|
60
|
+
1. Go to the GitHub [Releases page](https://github.com/jackwener/opencli/releases) and download the latest `opencli-extension.zip` or `opencli-extension.crx`.
|
|
61
|
+
2. Open `chrome://extensions` and enable **Developer mode** (top-right toggle).
|
|
62
|
+
3. Drag and drop the `.crx` file or the unzipped folder into the extensions page.
|
|
63
|
+
|
|
64
|
+
**Method 2: Load Unpacked Source (For Developers)**
|
|
65
|
+
1. Open `chrome://extensions` and enable **Developer mode**.
|
|
66
|
+
2. Click **Load unpacked** and select the `extension/` directory from this repository.
|
|
67
|
+
|
|
68
|
+
That's it! The daemon auto-starts when you run any browser command. No tokens, no manual configuration.
|
|
61
69
|
|
|
62
70
|
> **Tip**: Use `opencli doctor` for ongoing diagnosis:
|
|
63
71
|
> ```bash
|
|
@@ -107,34 +115,34 @@ Run `opencli list` for the live registry.
|
|
|
107
115
|
|
|
108
116
|
| Site | Commands | Mode |
|
|
109
117
|
|------|----------|------|
|
|
110
|
-
| **twitter** | `trending` `bookmarks` `profile` `search` `timeline` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `article` `follow` `unfollow` `bookmark` `unbookmark` `download` `accept` `reply-dm` |
|
|
111
|
-
| **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `save` `comment` `subscribe` `saved` `upvoted` |
|
|
112
|
-
| **cursor** | `status` `send` `read` `new` `dump` `composer` `model` `extract-code` `ask` `screenshot` `history` `export` |
|
|
113
|
-
| **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `dynamic` `ranking` `following` `user-videos` `download` |
|
|
114
|
-
| **codex** | `status` `send` `read` `new` `extract-diff` `model` `ask` `screenshot` `history` `export` |
|
|
115
|
-
| **chatwise** | `status` `new` `send` `read` `ask` `model` `history` `export` `screenshot` |
|
|
116
|
-
| **notion** | `status` `search` `read` `new` `write` `sidebar` `favorites` `export` |
|
|
117
|
-
| **discord-app** | `status` `send` `read` `channels` `servers` `search` `members` |
|
|
118
|
-
| **v2ex** | `hot` `latest` `topic` `daily` `me` `notifications` |
|
|
119
|
-
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` |
|
|
120
|
-
| **antigravity** | `status` `send` `read` `new` `
|
|
121
|
-
| **chatgpt** | `status` `new` `send` `read` `ask` |
|
|
122
|
-
| **xiaohongshu** | `search` `notifications` `feed` `me` `user` `download` |
|
|
123
|
-
| **apple-podcasts** | `search` `episodes` `top` |
|
|
124
|
-
| **xiaoyuzhou** | `podcast` `podcast-episodes` `episode` |
|
|
125
|
-
| **zhihu** | `hot` `search` `question` `download` |
|
|
126
|
-
| **youtube** | `search` `video` `transcript` |
|
|
127
|
-
| **boss** | `search` `detail` |
|
|
128
|
-
| **coupang** | `search` `add-to-cart` |
|
|
129
|
-
| **bbc** | `news` |
|
|
130
|
-
| **ctrip** | `search` |
|
|
131
|
-
| **github** | `search` |
|
|
132
|
-
| **hackernews** | `top` |
|
|
133
|
-
| **linkedin** | `search` |
|
|
134
|
-
| **reuters** | `search` |
|
|
135
|
-
| **smzdm** | `search` |
|
|
136
|
-
| **weibo** | `hot` |
|
|
137
|
-
| **yahoo-finance** | `quote` |
|
|
118
|
+
| **twitter** | `trending` `bookmarks` `profile` `search` `timeline` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `article` `follow` `unfollow` `bookmark` `unbookmark` `download` `accept` `reply-dm` | Browser |
|
|
119
|
+
| **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `save` `comment` `subscribe` `saved` `upvoted` | Browser |
|
|
120
|
+
| **cursor** | `status` `send` `read` `new` `dump` `composer` `model` `extract-code` `ask` `screenshot` `history` `export` | Desktop |
|
|
121
|
+
| **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `dynamic` `ranking` `following` `user-videos` `download` | Browser |
|
|
122
|
+
| **codex** | `status` `send` `read` `new` `extract-diff` `model` `ask` `screenshot` `history` `export` | Desktop |
|
|
123
|
+
| **chatwise** | `status` `new` `send` `read` `ask` `model` `history` `export` `screenshot` | Desktop |
|
|
124
|
+
| **notion** | `status` `search` `read` `new` `write` `sidebar` `favorites` `export` | Desktop |
|
|
125
|
+
| **discord-app** | `status` `send` `read` `channels` `servers` `search` `members` | Desktop |
|
|
126
|
+
| **v2ex** | `hot` `latest` `topic` `daily` `me` `notifications` | Public / Browser |
|
|
127
|
+
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` | Browser |
|
|
128
|
+
| **antigravity** | `status` `send` `read` `new` `dump` `extract-code` `model` `watch` | Desktop |
|
|
129
|
+
| **chatgpt** | `status` `new` `send` `read` `ask` | Desktop |
|
|
130
|
+
| **xiaohongshu** | `search` `notifications` `feed` `me` `user` `download` | Browser |
|
|
131
|
+
| **apple-podcasts** | `search` `episodes` `top` | Public |
|
|
132
|
+
| **xiaoyuzhou** | `podcast` `podcast-episodes` `episode` | Public |
|
|
133
|
+
| **zhihu** | `hot` `search` `question` `download` | Browser |
|
|
134
|
+
| **youtube** | `search` `video` `transcript` | Browser |
|
|
135
|
+
| **boss** | `search` `detail` | Browser |
|
|
136
|
+
| **coupang** | `search` `add-to-cart` | Browser |
|
|
137
|
+
| **bbc** | `news` | Public |
|
|
138
|
+
| **ctrip** | `search` | Browser |
|
|
139
|
+
| **github** | `search` | Public |
|
|
140
|
+
| **hackernews** | `top` | Public |
|
|
141
|
+
| **linkedin** | `search` | Browser |
|
|
142
|
+
| **reuters** | `search` | Browser |
|
|
143
|
+
| **smzdm** | `search` | Browser |
|
|
144
|
+
| **weibo** | `hot` | Browser |
|
|
145
|
+
| **yahoo-finance** | `quote` | Browser |
|
|
138
146
|
|
|
139
147
|
### Desktop App Adapters
|
|
140
148
|
|
|
@@ -181,7 +189,7 @@ brew install yt-dlp
|
|
|
181
189
|
|
|
182
190
|
```bash
|
|
183
191
|
# Download images/videos from Xiaohongshu note
|
|
184
|
-
opencli xiaohongshu download --
|
|
192
|
+
opencli xiaohongshu download --note_id abc123 --output ./xhs
|
|
185
193
|
|
|
186
194
|
# Download Bilibili video (requires yt-dlp)
|
|
187
195
|
opencli bilibili download --bvid BV1xxx --output ./bilibili
|
package/README.zh-CN.md
CHANGED
|
@@ -40,7 +40,7 @@ CLI all electron!现在支持把所有 electron 应用 CLI 化,从而组合
|
|
|
40
40
|
- **CLI All Electron** — 支持把所有 electron 应用(如 Antigravity Ultra)CLI 化,让 AI 控制自己!
|
|
41
41
|
- **多站点覆盖** — 覆盖 B站、知乎、小红书、Twitter、Reddit,以及多种桌面应用
|
|
42
42
|
- **零风控** — 复用 Chrome 登录态,无需存储任何凭证
|
|
43
|
-
- **自修复配置** — `opencli setup`
|
|
43
|
+
- **自修复配置** — `opencli setup` 检查 Browser Bridge 连通性;`opencli doctor` 诊断 daemon、扩展和浏览器连接状态
|
|
44
44
|
- **AI 原生** — `explore` 自动发现 API,`synthesize` 生成适配器,`cascade` 探测认证策略
|
|
45
45
|
- **动态加载引擎** — 声明式的 `.yaml` 或者底层定制的 `.ts` 适配器,放入 `clis/` 文件夹即可自动注册生效
|
|
46
46
|
|
|
@@ -55,10 +55,18 @@ OpenCLI 通过轻量化的 **Browser Bridge** Chrome 扩展 + 微型 daemon 与
|
|
|
55
55
|
|
|
56
56
|
### Browser Bridge 扩展配置
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
你可以选择以下任一方式安装扩展:
|
|
59
|
+
|
|
60
|
+
**方式一:下载构建好的安装包(推荐)**
|
|
61
|
+
1. 到 GitHub [Releases 页面](https://github.com/jackwener/opencli/releases) 下载最新的 `opencli-extension.zip` 或 `opencli-extension.crx`。
|
|
62
|
+
2. 打开 Chrome 的 `chrome://extensions`,启用右上角的 **开发者模式**。
|
|
63
|
+
3. 将 `.crx` 拖入浏览器窗口,或将解压后的文件夹拖入即可完成安装。
|
|
64
|
+
|
|
65
|
+
**方式二:加载源码(针对开发者)**
|
|
66
|
+
1. 同样在 `chrome://extensions` 开启 **开发者模式**。
|
|
67
|
+
2. 点击 **加载已解压的扩展程序**,选择本仓库代码树中的 `extension/` 文件夹。
|
|
68
|
+
|
|
69
|
+
完成!运行任何 opencli 浏览器命令时,后台微型 daemon 会自动启动与浏览器通信。无需配 API Token,零代码配置。
|
|
62
70
|
|
|
63
71
|
> **Tip**:后续诊断用 `opencli doctor`:
|
|
64
72
|
> ```bash
|
|
@@ -108,34 +116,34 @@ npm install -g @jackwener/opencli@latest
|
|
|
108
116
|
|
|
109
117
|
| 站点 | 命令 | 模式 |
|
|
110
118
|
|------|------|------|
|
|
111
|
-
| **twitter** | `trending` `bookmarks` `profile` `search` `timeline` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `article` `follow` `unfollow` `bookmark` `unbookmark` `download` `accept` `reply-dm` |
|
|
112
|
-
| **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `save` `comment` `subscribe` `saved` `upvoted` |
|
|
113
|
-
| **cursor** | `status` `send` `read` `new` `dump` `composer` `model` `extract-code` `ask` `screenshot` `history` `export` |
|
|
114
|
-
| **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `dynamic` `ranking` `following` `user-videos` `download` |
|
|
115
|
-
| **codex** | `status` `send` `read` `new` `extract-diff` `model` `ask` `screenshot` `history` `export` |
|
|
116
|
-
| **chatwise** | `status` `new` `send` `read` `ask` `model` `history` `export` `screenshot` |
|
|
117
|
-
| **notion** | `status` `search` `read` `new` `write` `sidebar` `favorites` `export` |
|
|
118
|
-
| **discord-app** | `status` `send` `read` `channels` `servers` `search` `members` |
|
|
119
|
-
| **v2ex** | `hot` `latest` `topic` `daily` `me` `notifications` |
|
|
120
|
-
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` |
|
|
121
|
-
| **antigravity** | `status` `send` `read` `new` `
|
|
122
|
-
| **chatgpt** | `status` `new` `send` `read` `ask` |
|
|
123
|
-
| **xiaohongshu** | `search` `notifications` `feed` `me` `user` `download` |
|
|
124
|
-
| **apple-podcasts** | `search` `episodes` `top` |
|
|
125
|
-
| **xiaoyuzhou** | `podcast` `podcast-episodes` `episode` |
|
|
126
|
-
| **zhihu** | `hot` `search` `question` `download` |
|
|
127
|
-
| **youtube** | `search` `video` `transcript` |
|
|
128
|
-
| **boss** | `search` `detail` |
|
|
129
|
-
| **coupang** | `search` `add-to-cart` |
|
|
130
|
-
| **bbc** | `news` |
|
|
131
|
-
| **ctrip** | `search` |
|
|
132
|
-
| **github** | `search` |
|
|
133
|
-
| **hackernews** | `top` |
|
|
134
|
-
| **linkedin** | `search` |
|
|
135
|
-
| **reuters** | `search` |
|
|
136
|
-
| **smzdm** | `search` |
|
|
137
|
-
| **weibo** | `hot` |
|
|
138
|
-
| **yahoo-finance** | `quote` |
|
|
119
|
+
| **twitter** | `trending` `bookmarks` `profile` `search` `timeline` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `article` `follow` `unfollow` `bookmark` `unbookmark` `download` `accept` `reply-dm` | 浏览器 |
|
|
120
|
+
| **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `save` `comment` `subscribe` `saved` `upvoted` | 浏览器 |
|
|
121
|
+
| **cursor** | `status` `send` `read` `new` `dump` `composer` `model` `extract-code` `ask` `screenshot` `history` `export` | 桌面端 |
|
|
122
|
+
| **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `dynamic` `ranking` `following` `user-videos` `download` | 浏览器 |
|
|
123
|
+
| **codex** | `status` `send` `read` `new` `extract-diff` `model` `ask` `screenshot` `history` `export` | 桌面端 |
|
|
124
|
+
| **chatwise** | `status` `new` `send` `read` `ask` `model` `history` `export` `screenshot` | 桌面端 |
|
|
125
|
+
| **notion** | `status` `search` `read` `new` `write` `sidebar` `favorites` `export` | 桌面端 |
|
|
126
|
+
| **discord-app** | `status` `send` `read` `channels` `servers` `search` `members` | 桌面端 |
|
|
127
|
+
| **v2ex** | `hot` `latest` `topic` `daily` `me` `notifications` | 公开 / 浏览器 |
|
|
128
|
+
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` | 浏览器 |
|
|
129
|
+
| **antigravity** | `status` `send` `read` `new` `dump` `extract-code` `model` `watch` | 桌面端 |
|
|
130
|
+
| **chatgpt** | `status` `new` `send` `read` `ask` | 桌面端 |
|
|
131
|
+
| **xiaohongshu** | `search` `notifications` `feed` `me` `user` `download` | 浏览器 |
|
|
132
|
+
| **apple-podcasts** | `search` `episodes` `top` | 公开 |
|
|
133
|
+
| **xiaoyuzhou** | `podcast` `podcast-episodes` `episode` | 公开 |
|
|
134
|
+
| **zhihu** | `hot` `search` `question` `download` | 浏览器 |
|
|
135
|
+
| **youtube** | `search` `video` `transcript` | 浏览器 |
|
|
136
|
+
| **boss** | `search` `detail` | 浏览器 |
|
|
137
|
+
| **coupang** | `search` `add-to-cart` | 浏览器 |
|
|
138
|
+
| **bbc** | `news` | 公共 API |
|
|
139
|
+
| **ctrip** | `search` | 浏览器 |
|
|
140
|
+
| **github** | `search` | 公共 API |
|
|
141
|
+
| **hackernews** | `top` | 公共 API |
|
|
142
|
+
| **linkedin** | `search` | 浏览器 |
|
|
143
|
+
| **reuters** | `search` | 浏览器 |
|
|
144
|
+
| **smzdm** | `search` | 浏览器 |
|
|
145
|
+
| **weibo** | `hot` | 浏览器 |
|
|
146
|
+
| **yahoo-finance** | `quote` | 浏览器 |
|
|
139
147
|
|
|
140
148
|
### 桌面应用适配器
|
|
141
149
|
|
|
@@ -182,7 +190,7 @@ brew install yt-dlp
|
|
|
182
190
|
|
|
183
191
|
```bash
|
|
184
192
|
# 下载小红书笔记中的图片/视频
|
|
185
|
-
opencli xiaohongshu download --
|
|
193
|
+
opencli xiaohongshu download --note_id abc123 --output ./xhs
|
|
186
194
|
|
|
187
195
|
# 下载B站视频(需要 yt-dlp)
|
|
188
196
|
opencli bilibili download --bvid BV1xxx --output ./bilibili
|
package/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: opencli
|
|
3
3
|
description: "OpenCLI — Make any website or Electron App your CLI. Zero risk, AI-powered, reuse Chrome login. 80+ commands across 19 sites."
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.4
|
|
5
5
|
author: jackwener
|
|
6
6
|
tags: [cli, browser, web, chrome-extension, cdp, bilibili, zhihu, twitter, github, v2ex, hackernews, reddit, xiaohongshu, xueqiu, youtube, boss, coupang, AI, agent]
|
|
7
7
|
---
|
|
@@ -170,11 +170,9 @@ opencli list --json # JSON output
|
|
|
170
170
|
opencli list -f yaml # YAML output
|
|
171
171
|
opencli validate # Validate all CLI definitions
|
|
172
172
|
opencli validate bilibili # Validate specific site
|
|
173
|
-
opencli setup # Interactive
|
|
174
|
-
opencli doctor # Diagnose
|
|
173
|
+
opencli setup # Interactive Browser Bridge setup and connectivity check
|
|
174
|
+
opencli doctor # Diagnose daemon, extension, and browser connectivity
|
|
175
175
|
opencli doctor --live # Also test live browser connectivity
|
|
176
|
-
opencli doctor --fix # Fix mismatched configs (interactive confirmation)
|
|
177
|
-
opencli doctor --fix -y # Fix all configs non-interactively
|
|
178
176
|
```
|
|
179
177
|
|
|
180
178
|
### AI Agent Workflow
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CDP client — implements IPage by connecting directly to a Chrome/Electron CDP WebSocket.
|
|
3
|
+
*
|
|
4
|
+
* Fixes applied:
|
|
5
|
+
* - send() now has a 30s timeout guard (P0 #4)
|
|
6
|
+
* - goto() waits for Page.loadEventFired instead of hardcoded 1s sleep (P1 #3)
|
|
7
|
+
* - Implemented scroll, autoScroll, screenshot, networkRequests (P1 #2)
|
|
8
|
+
* - Shared DOM helper methods extracted to reduce duplication with Page (P1 #5)
|
|
9
|
+
*/
|
|
10
|
+
import type { IPage } from '../types.js';
|
|
11
|
+
export interface CDPTarget {
|
|
12
|
+
type?: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
webSocketDebuggerUrl?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class CDPBridge {
|
|
18
|
+
private _ws;
|
|
19
|
+
private _idCounter;
|
|
20
|
+
private _pending;
|
|
21
|
+
private _eventListeners;
|
|
22
|
+
connect(opts?: {
|
|
23
|
+
timeout?: number;
|
|
24
|
+
workspace?: string;
|
|
25
|
+
}): Promise<IPage>;
|
|
26
|
+
close(): Promise<void>;
|
|
27
|
+
/** Send a CDP command with timeout guard (P0 fix #4) */
|
|
28
|
+
send(method: string, params?: any, timeoutMs?: number): Promise<any>;
|
|
29
|
+
/** Listen for a CDP event */
|
|
30
|
+
on(event: string, handler: (params: any) => void): void;
|
|
31
|
+
/** Remove a CDP event listener */
|
|
32
|
+
off(event: string, handler: (params: any) => void): void;
|
|
33
|
+
/** Wait for a CDP event to fire (one-shot) */
|
|
34
|
+
waitForEvent(event: string, timeoutMs?: number): Promise<any>;
|
|
35
|
+
}
|
|
36
|
+
declare function selectCDPTarget(targets: CDPTarget[]): CDPTarget | undefined;
|
|
37
|
+
declare function scoreCDPTarget(target: CDPTarget, preferredPattern?: RegExp): number;
|
|
38
|
+
export declare const __test__: {
|
|
39
|
+
selectCDPTarget: typeof selectCDPTarget;
|
|
40
|
+
scoreCDPTarget: typeof scoreCDPTarget;
|
|
41
|
+
};
|
|
42
|
+
export {};
|