@jackwener/opencli 1.3.2 → 1.4.0
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/pull_request_template.md +3 -1
- package/.github/workflows/build-extension.yml +7 -1
- package/.github/workflows/ci.yml +29 -3
- package/.github/workflows/docs.yml +1 -1
- package/.github/workflows/e2e-headed.yml +20 -0
- package/.github/workflows/release.yml +1 -1
- package/.github/workflows/security.yml +0 -3
- package/CHANGELOG.md +55 -0
- package/CONTRIBUTING.md +6 -3
- package/README.md +37 -10
- package/README.zh-CN.md +37 -10
- package/SKILL.md +7 -2
- package/TESTING.md +1 -0
- package/chatwise-opencli.ps1 +82 -0
- package/dist/analysis.d.ts +38 -0
- package/dist/analysis.js +166 -0
- package/dist/browser/cdp.d.ts +0 -4
- package/dist/browser/cdp.js +59 -38
- package/dist/browser/cdp.test.d.ts +1 -0
- package/dist/browser/cdp.test.js +52 -0
- package/dist/browser/daemon-client.js +2 -1
- package/dist/browser/discover.js +2 -1
- package/dist/browser/dom-snapshot.d.ts +2 -2
- package/dist/browser/dom-snapshot.js +54 -1
- package/dist/browser/dom-snapshot.test.js +36 -0
- package/dist/browser/errors.js +2 -1
- package/dist/browser/index.d.ts +3 -2
- package/dist/browser/index.js +2 -1
- package/dist/browser/mcp.d.ts +0 -2
- package/dist/browser/mcp.js +2 -3
- package/dist/browser/page.d.ts +4 -3
- package/dist/browser/page.js +44 -35
- package/dist/browser/stealth.d.ts +16 -0
- package/dist/browser/stealth.js +155 -0
- package/dist/browser.test.js +47 -1
- package/dist/build-manifest.js +15 -9
- package/dist/build-manifest.test.js +12 -0
- package/dist/cascade.js +4 -2
- package/dist/cli-manifest.json +639 -258
- package/dist/cli.js +57 -29
- package/dist/clis/_shared/desktop-commands.d.ts +22 -0
- package/dist/clis/_shared/desktop-commands.js +108 -0
- package/dist/clis/antigravity/serve.js +5 -2
- package/dist/clis/arxiv/search.js +1 -1
- package/dist/clis/bilibili/dynamic.test.d.ts +1 -0
- package/dist/clis/bilibili/dynamic.test.js +68 -0
- package/dist/clis/bilibili/favorite.js +4 -2
- package/dist/clis/bilibili/following.js +3 -2
- package/dist/clis/bilibili/subtitle.js +8 -7
- package/dist/clis/bilibili/utils.js +2 -2
- package/dist/clis/boss/batchgreet.js +1 -1
- package/dist/clis/boss/chatlist.js +1 -1
- package/dist/clis/boss/chatmsg.js +1 -1
- package/dist/clis/boss/detail.js +1 -1
- package/dist/clis/boss/exchange.js +1 -1
- package/dist/clis/boss/greet.js +1 -1
- package/dist/clis/boss/invite.js +1 -1
- package/dist/clis/boss/joblist.js +1 -1
- package/dist/clis/boss/mark.js +4 -3
- package/dist/clis/boss/recommend.js +1 -1
- package/dist/clis/boss/resume.js +1 -1
- package/dist/clis/boss/search.js +1 -1
- package/dist/clis/boss/send.js +5 -4
- package/dist/clis/boss/stats.js +1 -1
- package/dist/clis/chatgpt/ask.js +4 -0
- package/dist/clis/chatgpt/new.js +5 -1
- package/dist/clis/chatgpt/read.js +5 -1
- package/dist/clis/chatgpt/send.js +2 -1
- package/dist/clis/chatgpt/status.js +5 -1
- package/dist/clis/chatwise/ask.js +8 -2
- package/dist/clis/chatwise/export.js +2 -0
- package/dist/clis/chatwise/history.js +2 -0
- package/dist/clis/chatwise/model.js +8 -3
- package/dist/clis/chatwise/new.js +3 -18
- package/dist/clis/chatwise/read.js +2 -0
- package/dist/clis/chatwise/screenshot.js +3 -27
- package/dist/clis/chatwise/send.js +8 -2
- package/dist/clis/chatwise/shared.d.ts +2 -0
- package/dist/clis/chatwise/shared.js +6 -0
- package/dist/clis/chatwise/status.js +3 -22
- package/dist/clis/codex/ask.js +6 -2
- package/dist/clis/codex/dump.js +2 -25
- package/dist/clis/codex/new.js +2 -25
- package/dist/clis/codex/screenshot.js +2 -27
- package/dist/clis/codex/send.js +6 -4
- package/dist/clis/codex/status.js +2 -22
- package/dist/clis/cursor/ask.js +2 -1
- package/dist/clis/cursor/composer.js +2 -1
- package/dist/clis/cursor/dump.js +2 -25
- package/dist/clis/cursor/new.js +2 -18
- package/dist/clis/cursor/read.js +2 -1
- package/dist/clis/cursor/screenshot.js +1 -30
- package/dist/clis/cursor/send.js +2 -1
- package/dist/clis/cursor/status.js +2 -21
- package/dist/clis/dictionary/examples.yaml +25 -0
- package/dist/clis/dictionary/search.yaml +27 -0
- package/dist/clis/dictionary/synonyms.yaml +25 -0
- package/dist/clis/douban/book-hot.js +1 -1
- package/dist/clis/douban/movie-hot.js +1 -1
- package/dist/clis/douban/search.js +1 -1
- package/dist/clis/douban/utils.d.ts +4 -1
- package/dist/clis/douban/utils.js +156 -1
- package/dist/clis/doubao/ask.js +1 -1
- package/dist/clis/doubao/new.js +1 -1
- package/dist/clis/doubao/read.js +1 -1
- package/dist/clis/doubao/send.js +1 -1
- package/dist/clis/doubao/status.js +1 -1
- package/dist/clis/doubao-app/ask.js +1 -1
- package/dist/clis/doubao-app/new.js +1 -1
- package/dist/clis/doubao-app/read.js +1 -1
- package/dist/clis/doubao-app/send.js +1 -1
- package/dist/clis/grok/ask.d.ts +4 -0
- package/dist/clis/grok/ask.js +28 -10
- package/dist/clis/grok/ask.test.js +18 -0
- package/dist/clis/jd/item.d.ts +1 -0
- package/dist/clis/jd/item.js +96 -0
- package/dist/clis/jd/item.test.d.ts +1 -0
- package/dist/clis/jd/item.test.js +28 -0
- package/dist/clis/jike/feed.js +1 -1
- package/dist/clis/jike/search.js +1 -1
- package/dist/clis/linkedin/search.js +5 -4
- package/dist/clis/linkedin/timeline.d.ts +21 -0
- package/dist/clis/linkedin/timeline.js +503 -0
- package/dist/clis/linkedin/timeline.test.d.ts +1 -0
- package/dist/clis/linkedin/timeline.test.js +81 -0
- package/dist/clis/medium/feed.js +1 -1
- package/dist/clis/medium/search.js +1 -1
- package/dist/clis/medium/user.js +1 -1
- package/dist/clis/medium/{shared.js → utils.js} +2 -1
- package/dist/clis/pixiv/detail.yaml +49 -0
- package/dist/clis/pixiv/download.d.ts +7 -0
- package/dist/clis/pixiv/download.js +78 -0
- package/dist/clis/pixiv/download.test.d.ts +1 -0
- package/dist/clis/pixiv/download.test.js +87 -0
- package/dist/clis/pixiv/illusts.d.ts +8 -0
- package/dist/clis/pixiv/illusts.js +65 -0
- package/dist/clis/pixiv/illusts.test.d.ts +1 -0
- package/dist/clis/pixiv/illusts.test.js +99 -0
- package/dist/clis/pixiv/ranking.yaml +53 -0
- package/dist/clis/pixiv/search.d.ts +6 -0
- package/dist/clis/pixiv/search.js +43 -0
- package/dist/clis/pixiv/search.test.d.ts +1 -0
- package/dist/clis/pixiv/search.test.js +83 -0
- package/dist/clis/pixiv/test-utils.d.ts +12 -0
- package/dist/clis/pixiv/test-utils.js +23 -0
- package/dist/clis/pixiv/user.yaml +46 -0
- package/dist/clis/pixiv/utils.d.ts +27 -0
- package/dist/clis/pixiv/utils.js +49 -0
- package/dist/clis/reddit/comment.js +2 -1
- package/dist/clis/reddit/read.js +4 -3
- package/dist/clis/reddit/read.test.d.ts +1 -0
- package/dist/clis/reddit/read.test.js +28 -0
- package/dist/clis/reddit/save.js +2 -1
- package/dist/clis/reddit/saved.js +7 -3
- package/dist/clis/reddit/subscribe.js +2 -1
- package/dist/clis/reddit/upvote.js +2 -1
- package/dist/clis/reddit/upvoted.js +7 -3
- package/dist/clis/sinablog/article.js +1 -1
- package/dist/clis/sinablog/hot.js +1 -1
- package/dist/clis/sinablog/user.js +1 -1
- package/dist/clis/substack/feed.js +1 -1
- package/dist/clis/substack/publication.js +1 -1
- package/dist/clis/substack/search.js +3 -2
- package/dist/clis/substack/{shared.js → utils.js} +3 -2
- package/dist/clis/tiktok/search.yaml +2 -1
- package/dist/clis/twitter/accept.js +2 -1
- package/dist/clis/twitter/article.js +4 -1
- package/dist/clis/twitter/block.js +2 -1
- package/dist/clis/twitter/bookmark.js +2 -1
- package/dist/clis/twitter/bookmarks.js +3 -2
- package/dist/clis/twitter/delete.js +2 -1
- package/dist/clis/twitter/follow.js +2 -1
- package/dist/clis/twitter/followers.js +3 -2
- package/dist/clis/twitter/following.js +3 -2
- package/dist/clis/twitter/hide-reply.js +2 -1
- package/dist/clis/twitter/like.js +2 -1
- package/dist/clis/twitter/notifications.js +2 -1
- package/dist/clis/twitter/post.js +2 -1
- package/dist/clis/twitter/profile.js +5 -2
- package/dist/clis/twitter/reply-dm.js +2 -1
- package/dist/clis/twitter/reply.js +2 -1
- package/dist/clis/twitter/search.js +30 -13
- package/dist/clis/twitter/search.test.d.ts +1 -0
- package/dist/clis/twitter/search.test.js +104 -0
- package/dist/clis/twitter/thread.js +2 -2
- package/dist/clis/twitter/timeline.js +3 -2
- package/dist/clis/twitter/trending.js +3 -2
- package/dist/clis/twitter/unblock.js +2 -1
- package/dist/clis/twitter/unbookmark.js +2 -1
- package/dist/clis/twitter/unfollow.js +2 -1
- package/dist/clis/v2ex/daily.js +3 -2
- package/dist/clis/v2ex/me.js +3 -2
- package/dist/clis/v2ex/notifications.js +4 -4
- package/dist/clis/web/read.d.ts +16 -0
- package/dist/clis/web/read.js +202 -0
- package/dist/clis/xueqiu/danjuan-utils.d.ts +55 -0
- package/dist/clis/xueqiu/danjuan-utils.js +126 -0
- package/dist/clis/xueqiu/danjuan-utils.test.d.ts +1 -0
- package/dist/clis/xueqiu/danjuan-utils.test.js +41 -0
- package/dist/clis/xueqiu/fund-holdings.d.ts +1 -0
- package/dist/clis/xueqiu/fund-holdings.js +28 -0
- package/dist/clis/xueqiu/fund-snapshot.d.ts +1 -0
- package/dist/clis/xueqiu/fund-snapshot.js +25 -0
- package/dist/clis/youtube/transcript.js +5 -4
- package/dist/clis/youtube/video.js +3 -2
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +2 -0
- package/dist/daemon.js +9 -4
- package/dist/discovery.js +11 -10
- package/dist/doctor.js +4 -2
- package/dist/download/index.d.ts +4 -12
- package/dist/download/index.js +33 -12
- package/dist/download/index.test.js +79 -2
- package/dist/download/media-download.js +4 -2
- package/dist/engine.test.js +76 -4
- package/dist/execution.d.ts +1 -9
- package/dist/execution.js +56 -46
- package/dist/explore.js +12 -111
- package/dist/external-clis.yaml +0 -8
- package/dist/external.js +7 -5
- package/dist/external.test.js +4 -0
- package/dist/generate.d.ts +0 -9
- package/dist/generate.js +4 -20
- package/dist/hooks.d.ts +46 -0
- package/dist/hooks.js +56 -0
- package/dist/hooks.test.d.ts +4 -0
- package/dist/hooks.test.js +92 -0
- package/dist/interceptor.js +70 -23
- package/dist/main.js +2 -0
- package/dist/output.js +12 -6
- package/dist/pipeline/executor.js +1 -1
- package/dist/pipeline/steps/browser.js +1 -3
- package/dist/pipeline/steps/download.js +42 -26
- package/dist/pipeline/steps/download.test.d.ts +1 -0
- package/dist/pipeline/steps/download.test.js +101 -0
- package/dist/pipeline/steps/fetch.js +40 -22
- package/dist/pipeline/steps/fetch.test.d.ts +1 -0
- package/dist/pipeline/steps/fetch.test.js +123 -0
- package/dist/pipeline/steps/transform.js +2 -6
- package/dist/pipeline/template.js +66 -52
- package/dist/pipeline/template.test.js +28 -0
- package/dist/pipeline/transform.test.js +18 -0
- package/dist/plugin.d.ts +40 -1
- package/dist/plugin.js +214 -17
- package/dist/plugin.test.d.ts +1 -1
- package/dist/plugin.test.js +219 -3
- package/dist/record.js +6 -98
- package/dist/registry-api.d.ts +2 -0
- package/dist/registry-api.js +1 -0
- package/dist/registry.d.ts +5 -2
- package/dist/registry.js +1 -2
- package/dist/runtime.d.ts +0 -1
- package/dist/runtime.js +14 -4
- package/dist/snapshotFormatter.d.ts +7 -14
- package/dist/snapshotFormatter.js +38 -78
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +29 -0
- package/dist/validate.js +3 -5
- package/dist/yaml-schema.d.ts +26 -0
- package/dist/yaml-schema.js +5 -0
- package/docs/.vitepress/config.mts +3 -0
- package/docs/adapters/browser/dictionary.md +27 -0
- package/docs/adapters/browser/douban.md +18 -8
- package/docs/adapters/browser/jd.md +27 -0
- package/docs/adapters/browser/linkedin.md +6 -0
- package/docs/adapters/browser/pixiv.md +92 -0
- package/docs/adapters/browser/web.md +30 -0
- package/docs/adapters/browser/wikipedia.md +0 -9
- package/docs/adapters/browser/xueqiu.md +27 -9
- package/docs/adapters/desktop/antigravity.md +0 -3
- package/docs/adapters/index.md +11 -9
- package/docs/comparison.md +125 -0
- package/docs/developer/contributing.md +21 -2
- package/docs/developer/testing.md +14 -8
- package/docs/developer/ts-adapter.md +18 -0
- package/docs/developer/yaml-adapter.md +16 -0
- package/docs/guide/plugins.md +10 -0
- package/docs/zh/guide/plugins.md +10 -0
- package/extension/dist/background.js +519 -444
- package/extension/manifest.json +1 -1
- package/extension/package.json +1 -1
- package/extension/src/background.test.ts +46 -1
- package/extension/src/background.ts +108 -33
- package/extension/src/cdp.ts +9 -9
- package/package.json +3 -2
- package/scripts/check-doc-coverage.sh +2 -0
- package/src/analysis.ts +170 -0
- package/src/browser/cdp.test.ts +66 -0
- package/src/browser/cdp.ts +64 -41
- package/src/browser/daemon-client.ts +4 -3
- package/src/browser/discover.ts +2 -1
- package/src/browser/dom-snapshot.test.ts +42 -0
- package/src/browser/dom-snapshot.ts +56 -3
- package/src/browser/errors.ts +2 -1
- package/src/browser/index.ts +3 -2
- package/src/browser/mcp.ts +2 -4
- package/src/browser/page.ts +43 -35
- package/src/browser/stealth.ts +156 -0
- package/src/browser.test.ts +51 -1
- package/src/build-manifest.test.ts +14 -0
- package/src/build-manifest.ts +13 -32
- package/src/cascade.ts +5 -3
- package/src/cli.ts +66 -34
- package/src/clis/_shared/desktop-commands.ts +121 -0
- package/src/clis/antigravity/serve.ts +6 -3
- package/src/clis/arxiv/search.ts +1 -1
- package/src/clis/bilibili/dynamic.test.ts +79 -0
- package/src/clis/bilibili/favorite.ts +5 -2
- package/src/clis/bilibili/following.ts +3 -2
- package/src/clis/bilibili/subtitle.ts +8 -7
- package/src/clis/bilibili/utils.ts +2 -2
- package/src/clis/boss/batchgreet.ts +1 -1
- package/src/clis/boss/chatlist.ts +1 -1
- package/src/clis/boss/chatmsg.ts +1 -1
- package/src/clis/boss/detail.ts +1 -1
- package/src/clis/boss/exchange.ts +1 -1
- package/src/clis/boss/greet.ts +1 -1
- package/src/clis/boss/invite.ts +1 -1
- package/src/clis/boss/joblist.ts +1 -1
- package/src/clis/boss/mark.ts +4 -3
- package/src/clis/boss/recommend.ts +1 -1
- package/src/clis/boss/resume.ts +1 -1
- package/src/clis/boss/search.ts +1 -1
- package/src/clis/boss/send.ts +5 -4
- package/src/clis/boss/stats.ts +1 -1
- package/src/clis/chatgpt/ask.ts +5 -0
- package/src/clis/chatgpt/new.ts +7 -2
- package/src/clis/chatgpt/read.ts +7 -2
- package/src/clis/chatgpt/send.ts +3 -2
- package/src/clis/chatgpt/status.ts +6 -1
- package/src/clis/chatwise/ask.ts +7 -2
- package/src/clis/chatwise/export.ts +2 -0
- package/src/clis/chatwise/history.ts +2 -0
- package/src/clis/chatwise/model.ts +7 -3
- package/src/clis/chatwise/new.ts +3 -20
- package/src/clis/chatwise/read.ts +2 -0
- package/src/clis/chatwise/screenshot.ts +3 -32
- package/src/clis/chatwise/send.ts +7 -2
- package/src/clis/chatwise/shared.ts +8 -0
- package/src/clis/chatwise/status.ts +3 -24
- package/src/clis/codex/ask.ts +5 -2
- package/src/clis/codex/dump.ts +2 -27
- package/src/clis/codex/new.ts +2 -28
- package/src/clis/codex/screenshot.ts +2 -32
- package/src/clis/codex/send.ts +5 -4
- package/src/clis/codex/status.ts +2 -24
- package/src/clis/cursor/ask.ts +2 -1
- package/src/clis/cursor/composer.ts +2 -1
- package/src/clis/cursor/dump.ts +2 -27
- package/src/clis/cursor/new.ts +2 -20
- package/src/clis/cursor/read.ts +2 -1
- package/src/clis/cursor/screenshot.ts +1 -36
- package/src/clis/cursor/send.ts +2 -1
- package/src/clis/cursor/status.ts +2 -22
- package/src/clis/dictionary/examples.yaml +25 -0
- package/src/clis/dictionary/search.yaml +27 -0
- package/src/clis/dictionary/synonyms.yaml +25 -0
- package/src/clis/douban/book-hot.ts +1 -1
- package/src/clis/douban/movie-hot.ts +1 -1
- package/src/clis/douban/search.ts +1 -1
- package/src/clis/douban/utils.ts +165 -1
- package/src/clis/doubao/ask.ts +1 -1
- package/src/clis/doubao/new.ts +1 -1
- package/src/clis/doubao/read.ts +1 -1
- package/src/clis/doubao/send.ts +1 -1
- package/src/clis/doubao/status.ts +1 -1
- package/src/clis/doubao-app/ask.ts +1 -1
- package/src/clis/doubao-app/new.ts +1 -1
- package/src/clis/doubao-app/read.ts +1 -1
- package/src/clis/doubao-app/send.ts +1 -1
- package/src/clis/grok/ask.test.ts +25 -0
- package/src/clis/grok/ask.ts +25 -12
- package/src/clis/jd/item.test.ts +35 -0
- package/src/clis/jd/item.ts +101 -0
- package/src/clis/jike/feed.ts +1 -1
- package/src/clis/jike/search.ts +1 -1
- package/src/clis/linkedin/search.ts +5 -4
- package/src/clis/linkedin/timeline.test.ts +99 -0
- package/src/clis/linkedin/timeline.ts +532 -0
- package/src/clis/medium/feed.ts +1 -1
- package/src/clis/medium/search.ts +1 -1
- package/src/clis/medium/user.ts +1 -1
- package/src/clis/medium/{shared.ts → utils.ts} +2 -1
- package/src/clis/pixiv/detail.yaml +49 -0
- package/src/clis/pixiv/download.test.ts +114 -0
- package/src/clis/pixiv/download.ts +91 -0
- package/src/clis/pixiv/illusts.test.ts +115 -0
- package/src/clis/pixiv/illusts.ts +78 -0
- package/src/clis/pixiv/ranking.yaml +53 -0
- package/src/clis/pixiv/search.test.ts +97 -0
- package/src/clis/pixiv/search.ts +53 -0
- package/src/clis/pixiv/test-utils.ts +29 -0
- package/src/clis/pixiv/user.yaml +46 -0
- package/src/clis/pixiv/utils.ts +62 -0
- package/src/clis/reddit/comment.ts +2 -1
- package/src/clis/reddit/read.test.ts +34 -0
- package/src/clis/reddit/read.ts +4 -3
- package/src/clis/reddit/save.ts +2 -1
- package/src/clis/reddit/saved.ts +6 -2
- package/src/clis/reddit/subscribe.ts +2 -1
- package/src/clis/reddit/upvote.ts +2 -1
- package/src/clis/reddit/upvoted.ts +6 -2
- package/src/clis/sinablog/article.ts +1 -1
- package/src/clis/sinablog/hot.ts +1 -1
- package/src/clis/sinablog/user.ts +1 -1
- package/src/clis/substack/feed.ts +1 -1
- package/src/clis/substack/publication.ts +1 -1
- package/src/clis/substack/search.ts +3 -2
- package/src/clis/substack/{shared.ts → utils.ts} +3 -2
- package/src/clis/tiktok/search.yaml +2 -1
- package/src/clis/twitter/accept.ts +2 -1
- package/src/clis/twitter/article.ts +3 -1
- package/src/clis/twitter/block.ts +2 -1
- package/src/clis/twitter/bookmark.ts +2 -1
- package/src/clis/twitter/bookmarks.ts +3 -2
- package/src/clis/twitter/delete.ts +2 -1
- package/src/clis/twitter/follow.ts +2 -1
- package/src/clis/twitter/followers.ts +3 -2
- package/src/clis/twitter/following.ts +3 -2
- package/src/clis/twitter/hide-reply.ts +2 -1
- package/src/clis/twitter/like.ts +2 -1
- package/src/clis/twitter/notifications.ts +2 -1
- package/src/clis/twitter/post.ts +2 -1
- package/src/clis/twitter/profile.ts +4 -2
- package/src/clis/twitter/reply-dm.ts +2 -1
- package/src/clis/twitter/reply.ts +2 -1
- package/src/clis/twitter/search.test.ts +113 -0
- package/src/clis/twitter/search.ts +38 -14
- package/src/clis/twitter/thread.ts +2 -2
- package/src/clis/twitter/timeline.ts +3 -2
- package/src/clis/twitter/trending.ts +3 -2
- package/src/clis/twitter/unblock.ts +2 -1
- package/src/clis/twitter/unbookmark.ts +2 -1
- package/src/clis/twitter/unfollow.ts +2 -1
- package/src/clis/v2ex/daily.ts +3 -2
- package/src/clis/v2ex/me.ts +3 -2
- package/src/clis/v2ex/notifications.ts +3 -4
- package/src/clis/web/read.ts +210 -0
- package/src/clis/xueqiu/danjuan-utils.test.ts +49 -0
- package/src/clis/xueqiu/danjuan-utils.ts +176 -0
- package/src/clis/xueqiu/fund-holdings.ts +32 -0
- package/src/clis/xueqiu/fund-snapshot.ts +27 -0
- package/src/clis/youtube/transcript.ts +5 -4
- package/src/clis/youtube/video.ts +3 -2
- package/src/constants.ts +3 -0
- package/src/daemon.ts +7 -5
- package/src/discovery.ts +12 -34
- package/src/doctor.ts +5 -3
- package/src/download/index.test.ts +93 -2
- package/src/download/index.ts +44 -23
- package/src/download/media-download.ts +5 -3
- package/src/engine.test.ts +84 -3
- package/src/execution.ts +62 -46
- package/src/explore.ts +21 -90
- package/src/external-clis.yaml +0 -8
- package/src/external.test.ts +9 -0
- package/src/external.ts +12 -10
- package/src/generate.ts +4 -41
- package/src/hooks.test.ts +126 -0
- package/src/hooks.ts +90 -0
- package/src/interceptor.ts +73 -23
- package/src/main.ts +2 -0
- package/src/output.ts +14 -6
- package/src/pipeline/executor.ts +1 -1
- package/src/pipeline/steps/browser.ts +1 -3
- package/src/pipeline/steps/download.test.ts +136 -0
- package/src/pipeline/steps/download.ts +47 -34
- package/src/pipeline/steps/fetch.test.ts +179 -0
- package/src/pipeline/steps/fetch.ts +39 -23
- package/src/pipeline/steps/transform.ts +2 -6
- package/src/pipeline/template.test.ts +28 -0
- package/src/pipeline/template.ts +67 -79
- package/src/pipeline/transform.test.ts +20 -0
- package/src/plugin.test.ts +251 -3
- package/src/plugin.ts +265 -21
- package/src/record.ts +12 -84
- package/src/registry-api.ts +2 -0
- package/src/registry.ts +7 -4
- package/src/runtime.ts +14 -4
- package/src/snapshotFormatter.ts +43 -121
- package/src/utils.ts +39 -0
- package/src/validate.ts +3 -6
- package/src/yaml-schema.ts +28 -0
- package/tests/e2e/browser-auth.test.ts +25 -0
- package/tests/e2e/plugin-management.test.ts +137 -0
- package/tests/e2e/public-commands.test.ts +34 -1
- package/vitest.config.ts +19 -1
- package/.github/workflows/pkg-pr-new.yml +0 -30
- package/dist/clis/douban/shared.d.ts +0 -4
- package/dist/clis/douban/shared.js +0 -155
- package/src/clis/douban/shared.ts +0 -165
- /package/dist/clis/boss/{common.d.ts → utils.d.ts} +0 -0
- /package/dist/clis/boss/{common.js → utils.js} +0 -0
- /package/dist/clis/doubao/{common.d.ts → utils.d.ts} +0 -0
- /package/dist/clis/doubao/{common.js → utils.js} +0 -0
- /package/dist/clis/doubao-app/{common.d.ts → utils.d.ts} +0 -0
- /package/dist/clis/doubao-app/{common.js → utils.js} +0 -0
- /package/dist/clis/jike/{shared.d.ts → utils.d.ts} +0 -0
- /package/dist/clis/jike/{shared.js → utils.js} +0 -0
- /package/dist/clis/medium/{shared.d.ts → utils.d.ts} +0 -0
- /package/dist/clis/sinablog/{shared.d.ts → utils.d.ts} +0 -0
- /package/dist/clis/sinablog/{shared.js → utils.js} +0 -0
- /package/dist/clis/substack/{shared.d.ts → utils.d.ts} +0 -0
- /package/src/clis/boss/{common.ts → utils.ts} +0 -0
- /package/src/clis/doubao/{common.ts → utils.ts} +0 -0
- /package/src/clis/doubao-app/{common.ts → utils.ts} +0 -0
- /package/src/clis/jike/{shared.ts → utils.ts} +0 -0
- /package/src/clis/sinablog/{shared.ts → utils.ts} +0 -0
|
@@ -24,8 +24,10 @@ Related issue:
|
|
|
24
24
|
- [ ] Added doc page under `docs/adapters/` (if new adapter)
|
|
25
25
|
- [ ] Updated `docs/adapters/index.md` table (if new adapter)
|
|
26
26
|
- [ ] Updated sidebar in `docs/.vitepress/config.mts` (if new adapter)
|
|
27
|
+
- [ ] Updated `README.md` / `README.zh-CN.md` when command discoverability changed
|
|
28
|
+
- [ ] Used positional args for the command's primary subject unless a named flag is clearly better
|
|
29
|
+
- [ ] Normalized expected adapter failures to `CliError` subclasses instead of raw `Error`
|
|
27
30
|
|
|
28
31
|
## Screenshots / Output
|
|
29
32
|
|
|
30
33
|
<!-- If applicable, paste CLI output or screenshots here. -->
|
|
31
|
-
|
|
@@ -4,8 +4,14 @@ on:
|
|
|
4
4
|
push:
|
|
5
5
|
branches: [ "main" ]
|
|
6
6
|
tags: [ "v*.*.*" ]
|
|
7
|
+
paths:
|
|
8
|
+
- 'extension/**'
|
|
9
|
+
- '.github/workflows/build-extension.yml'
|
|
7
10
|
pull_request:
|
|
8
11
|
branches: [ "main" ]
|
|
12
|
+
paths:
|
|
13
|
+
- 'extension/**'
|
|
14
|
+
- '.github/workflows/build-extension.yml'
|
|
9
15
|
|
|
10
16
|
permissions:
|
|
11
17
|
contents: write
|
|
@@ -46,7 +52,7 @@ jobs:
|
|
|
46
52
|
zip -r ../opencli-extension.zip .
|
|
47
53
|
|
|
48
54
|
- name: Upload Artifacts (Action Run)
|
|
49
|
-
uses: actions/upload-artifact@
|
|
55
|
+
uses: actions/upload-artifact@v7
|
|
50
56
|
with:
|
|
51
57
|
name: opencli-extension-build
|
|
52
58
|
path: |
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -16,7 +16,11 @@ concurrency:
|
|
|
16
16
|
jobs:
|
|
17
17
|
# ── Fast gate: typecheck + build ──
|
|
18
18
|
build:
|
|
19
|
-
runs-on:
|
|
19
|
+
runs-on: ${{ matrix.os }}
|
|
20
|
+
strategy:
|
|
21
|
+
fail-fast: false
|
|
22
|
+
matrix:
|
|
23
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
20
24
|
steps:
|
|
21
25
|
- uses: actions/checkout@v6
|
|
22
26
|
|
|
@@ -36,10 +40,11 @@ jobs:
|
|
|
36
40
|
|
|
37
41
|
# ── Unit tests (vitest shard) ──
|
|
38
42
|
unit-test:
|
|
39
|
-
runs-on:
|
|
43
|
+
runs-on: ${{ matrix.os }}
|
|
40
44
|
strategy:
|
|
41
45
|
fail-fast: false
|
|
42
46
|
matrix:
|
|
47
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
43
48
|
node-version: ['20', '22']
|
|
44
49
|
shard: [1, 2]
|
|
45
50
|
steps:
|
|
@@ -54,7 +59,28 @@ jobs:
|
|
|
54
59
|
run: npm ci
|
|
55
60
|
|
|
56
61
|
- name: Run unit tests (Node ${{ matrix.node-version }}, shard ${{ matrix.shard }}/2)
|
|
57
|
-
run:
|
|
62
|
+
run: npm test -- --reporter=verbose --shard=${{ matrix.shard }}/2
|
|
63
|
+
|
|
64
|
+
adapter-test:
|
|
65
|
+
runs-on: ${{ matrix.os }}
|
|
66
|
+
strategy:
|
|
67
|
+
fail-fast: false
|
|
68
|
+
matrix:
|
|
69
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
70
|
+
needs: build
|
|
71
|
+
steps:
|
|
72
|
+
- uses: actions/checkout@v6
|
|
73
|
+
|
|
74
|
+
- uses: actions/setup-node@v6
|
|
75
|
+
with:
|
|
76
|
+
node-version: '22'
|
|
77
|
+
cache: 'npm'
|
|
78
|
+
|
|
79
|
+
- name: Install dependencies
|
|
80
|
+
run: npm ci
|
|
81
|
+
|
|
82
|
+
- name: Run focused adapter tests
|
|
83
|
+
run: npm run test:adapter -- --reporter=verbose
|
|
58
84
|
|
|
59
85
|
# ── Smoke tests (scheduled / manual only) ──
|
|
60
86
|
smoke-test:
|
|
@@ -10,7 +10,7 @@ jobs:
|
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
12
|
- name: Trigger opencli-website rebuild
|
|
13
|
-
uses: peter-evans/repository-dispatch@
|
|
13
|
+
uses: peter-evans/repository-dispatch@v4
|
|
14
14
|
with:
|
|
15
15
|
token: ${{ secrets.WEBSITE_DEPLOY_TOKEN }}
|
|
16
16
|
repository: jackwener/opencli-website
|
|
@@ -3,8 +3,28 @@ name: E2E Headed Chrome
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
branches: [main, dev]
|
|
6
|
+
paths:
|
|
7
|
+
- 'extension/**'
|
|
8
|
+
- 'src/browser/**'
|
|
9
|
+
- 'src/daemon.ts'
|
|
10
|
+
- 'src/execution.ts'
|
|
11
|
+
- 'src/interceptor.ts'
|
|
12
|
+
- 'tests/e2e/**'
|
|
13
|
+
- 'tests/smoke/**'
|
|
14
|
+
- '.github/actions/setup-chrome/**'
|
|
15
|
+
- '.github/workflows/e2e-headed.yml'
|
|
6
16
|
pull_request:
|
|
7
17
|
branches: [main, dev]
|
|
18
|
+
paths:
|
|
19
|
+
- 'extension/**'
|
|
20
|
+
- 'src/browser/**'
|
|
21
|
+
- 'src/daemon.ts'
|
|
22
|
+
- 'src/execution.ts'
|
|
23
|
+
- 'src/interceptor.ts'
|
|
24
|
+
- 'tests/e2e/**'
|
|
25
|
+
- 'tests/smoke/**'
|
|
26
|
+
- '.github/actions/setup-chrome/**'
|
|
27
|
+
- '.github/workflows/e2e-headed.yml'
|
|
8
28
|
workflow_dispatch:
|
|
9
29
|
|
|
10
30
|
concurrency:
|
|
@@ -37,7 +37,7 @@ jobs:
|
|
|
37
37
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
38
38
|
|
|
39
39
|
- name: Trigger website rebuild
|
|
40
|
-
uses: peter-evans/repository-dispatch@
|
|
40
|
+
uses: peter-evans/repository-dispatch@v4
|
|
41
41
|
with:
|
|
42
42
|
token: ${{ secrets.WEBSITE_DEPLOY_TOKEN }}
|
|
43
43
|
repository: jackwener/opencli-website
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.4.0](https://github.com/jackwener/opencli/compare/v1.3.3...v1.4.0) (2026-03-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **pixiv:** add Pixiv adapter — ranking, search, user illusts, detail, download ([#403](https://github.com/jackwener/opencli/issues/403))
|
|
9
|
+
* **plugin:** add lifecycle hooks API — onStartup, onBeforeExecute, onAfterExecute ([#376](https://github.com/jackwener/opencli/issues/376))
|
|
10
|
+
* **plugin:** validate plugin structure on install and update ([#364](https://github.com/jackwener/opencli/issues/364))
|
|
11
|
+
* **xueqiu:** add Danjuan fund account commands — fund-holdings, fund-snapshot ([#391](https://github.com/jackwener/opencli/issues/391))
|
|
12
|
+
* **tiktok:** add video URL to search results ([#404](https://github.com/jackwener/opencli/issues/404))
|
|
13
|
+
* **linkedin:** add timeline feed command ([#342](https://github.com/jackwener/opencli/issues/342))
|
|
14
|
+
* **jd:** add JD.com product details adapter ([#344](https://github.com/jackwener/opencli/issues/344))
|
|
15
|
+
* **web:** add generic `web read` command for any URL → Markdown ([#343](https://github.com/jackwener/opencli/issues/343))
|
|
16
|
+
* **dictionary:** add dictionary search, synonyms, and examples adapters ([#241](https://github.com/jackwener/opencli/issues/241))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **analysis:** fix hasLimit using wrong Set (SEARCH_PARAMS → LIMIT_PARAMS) ([#412](https://github.com/jackwener/opencli/issues/412))
|
|
22
|
+
* **pipeline:** remove phantom scroll step — declared but never registered ([#412](https://github.com/jackwener/opencli/issues/412))
|
|
23
|
+
* **validate:** add missing download step to KNOWN_STEP_NAMES ([#412](https://github.com/jackwener/opencli/issues/412))
|
|
24
|
+
* **extension:** security hardening — tab isolation, URL validation, cookie scope ([#409](https://github.com/jackwener/opencli/issues/409))
|
|
25
|
+
* **sort:** use localeCompare with natural numeric sort by default ([#306](https://github.com/jackwener/opencli/issues/306))
|
|
26
|
+
* **pipeline:** evaluate chained || in template engine ([#305](https://github.com/jackwener/opencli/issues/305))
|
|
27
|
+
* **pipeline:** check HTTP status in fetch step ([#384](https://github.com/jackwener/opencli/issues/384))
|
|
28
|
+
* **plugin:** resolve Windows path and symlink issues ([#400](https://github.com/jackwener/opencli/issues/400))
|
|
29
|
+
* **download:** scope cookies to target domain ([#385](https://github.com/jackwener/opencli/issues/385))
|
|
30
|
+
* **extension:** fix same-url navigation timeout ([#380](https://github.com/jackwener/opencli/issues/380))
|
|
31
|
+
* fix ChatWise Windows connect ([#405](https://github.com/jackwener/opencli/issues/405))
|
|
32
|
+
* resolve 6 critical + 11 important bugs from deep code review ([#337](https://github.com/jackwener/opencli/issues/337), [#340](https://github.com/jackwener/opencli/issues/340))
|
|
33
|
+
* harden security-sensitive execution paths ([#335](https://github.com/jackwener/opencli/issues/335))
|
|
34
|
+
* **stealth:** harden anti-detection against advanced fingerprinting ([#357](https://github.com/jackwener/opencli/issues/357))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Code Quality
|
|
38
|
+
|
|
39
|
+
* replace all `catch (err: any)` with typed `getErrorMessage()` across 13 files ([#412](https://github.com/jackwener/opencli/issues/412))
|
|
40
|
+
* adopt CliError subclasses in social and desktop adapters ([#367](https://github.com/jackwener/opencli/issues/367), [#372](https://github.com/jackwener/opencli/issues/372), [#375](https://github.com/jackwener/opencli/issues/375))
|
|
41
|
+
* simplify codebase with type dedup, shared analysis module, and consistent naming ([#373](https://github.com/jackwener/opencli/issues/373))
|
|
42
|
+
* **ci:** add cross-platform CI matrix (Linux/macOS/Windows) ([#402](https://github.com/jackwener/opencli/issues/402))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## [1.3.3](https://github.com/jackwener/opencli/compare/v1.3.2...v1.3.3) (2026-03-25)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Features
|
|
49
|
+
|
|
50
|
+
* **browser:** add stealth anti-detection for CDP and daemon modes ([#319](https://github.com/jackwener/opencli/issues/319))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Bug Fixes
|
|
54
|
+
|
|
55
|
+
* **stealth:** review fixes — guard plugins, rewrite stack trace cleanup ([#320](https://github.com/jackwener/opencli/issues/320))
|
|
56
|
+
|
|
57
|
+
|
|
3
58
|
## [1.3.2](https://github.com/jackwener/opencli/compare/v1.3.1...v1.3.2) (2026-03-24)
|
|
4
59
|
|
|
5
60
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -17,7 +17,8 @@ npm run build
|
|
|
17
17
|
|
|
18
18
|
# 4. Run a few checks
|
|
19
19
|
npx tsc --noEmit
|
|
20
|
-
|
|
20
|
+
npm test
|
|
21
|
+
npm run test:adapter
|
|
21
22
|
|
|
22
23
|
# 5. Link globally (optional, for testing `opencli` command)
|
|
23
24
|
npm link
|
|
@@ -161,7 +162,8 @@ args: [
|
|
|
161
162
|
See [TESTING.md](./TESTING.md) for the full guide and exact test locations.
|
|
162
163
|
|
|
163
164
|
```bash
|
|
164
|
-
|
|
165
|
+
npm test # Core unit tests (non-adapter)
|
|
166
|
+
npm run test:adapter # Focused adapter tests: zhihu/twitter/reddit/bilibili
|
|
165
167
|
npx vitest run tests/e2e/ # E2E tests
|
|
166
168
|
npx vitest run # All tests
|
|
167
169
|
```
|
|
@@ -194,7 +196,8 @@ Common scopes: site name (`twitter`, `reddit`) or module name (`browser`, `pipel
|
|
|
194
196
|
3. Run the checks that apply:
|
|
195
197
|
```bash
|
|
196
198
|
npx tsc --noEmit # Type check
|
|
197
|
-
|
|
199
|
+
npm test # Core unit tests
|
|
200
|
+
npm run test:adapter # Focused adapter tests (if you touched adapter logic)
|
|
198
201
|
opencli validate # YAML validation (if applicable)
|
|
199
202
|
```
|
|
200
203
|
4. Commit using conventional commit format
|
package/README.md
CHANGED
|
@@ -23,11 +23,31 @@ Turn ANY Electron application into a CLI tool! Recombine, script, and extend app
|
|
|
23
23
|
- **CLI All Electron** — CLI-ify apps like Antigravity Ultra! Now AI can control itself natively using cc/openclaw!
|
|
24
24
|
- **Account-safe** — Reuses Chrome's logged-in state; your credentials never leave the browser.
|
|
25
25
|
- **AI Agent ready** — `explore` discovers APIs, `synthesize` generates adapters, `cascade` finds auth strategies.
|
|
26
|
-
- **External CLI Hub** — Discover, auto-install, and passthrough commands to any external CLI (gh, obsidian, docker,
|
|
26
|
+
- **External CLI Hub** — Discover, auto-install, and passthrough commands to any external CLI (gh, obsidian, docker, etc). Zero setup.
|
|
27
27
|
- **Self-healing setup** — `opencli doctor` diagnoses and auto-starts the daemon, extension, and live browser connectivity.
|
|
28
28
|
- **Dynamic Loader** — Simply drop `.ts` or `.yaml` adapters into the `clis/` folder for auto-registration.
|
|
29
29
|
- **Dual-Engine Architecture** — Supports both YAML declarative data pipelines and robust browser runtime TypeScript injections.
|
|
30
30
|
|
|
31
|
+
## Why opencli?
|
|
32
|
+
|
|
33
|
+
There are many great browser automation tools. Here's when opencli is the right choice:
|
|
34
|
+
|
|
35
|
+
| Your need | Best tool | Why |
|
|
36
|
+
|-----------|-----------|-----|
|
|
37
|
+
| Scheduled data extraction from specific sites | **opencli** | Pre-built adapters, deterministic JSON, zero LLM cost |
|
|
38
|
+
| AI agent needs reliable site operations | **opencli** | Hundreds of commands, structured output, fast deterministic response |
|
|
39
|
+
| Explore an unknown website ad-hoc | Browser-Use, Stagehand | LLM-driven general browsing for one-off tasks |
|
|
40
|
+
| Large-scale web crawling | Crawl4AI, Scrapy | Purpose-built for throughput and scale |
|
|
41
|
+
| Control desktop Electron apps from terminal | **opencli** | CDP + AppleScript — the only CLI tool that does this |
|
|
42
|
+
|
|
43
|
+
**What makes opencli different:**
|
|
44
|
+
|
|
45
|
+
- **Zero LLM cost** — No tokens consumed at runtime. Run 10,000 times and pay nothing.
|
|
46
|
+
- **Deterministic** — Same command, same output schema, every time. Pipeable, scriptable, CI-friendly.
|
|
47
|
+
- **Broad coverage** — 50+ sites across global and Chinese platforms (Bilibili, Zhihu, Xiaohongshu, Reddit, HackerNews, and more), plus desktop Electron apps via CDP.
|
|
48
|
+
|
|
49
|
+
> For a detailed comparison with Browser-Use, Crawl4AI, Firecrawl, and others, see the [Comparison Guide](./docs/comparison.md).
|
|
50
|
+
|
|
31
51
|
## Prerequisites
|
|
32
52
|
|
|
33
53
|
- **Node.js**: >= 20.0.0
|
|
@@ -99,7 +119,7 @@ Run `opencli list` for the live registry.
|
|
|
99
119
|
|
|
100
120
|
| Site | Commands | Mode |
|
|
101
121
|
|------|----------|------|
|
|
102
|
-
| **twitter** | `trending` `bookmarks` `profile` `search` `timeline` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `article` `follow` `unfollow` `bookmark` `unbookmark` `download` `accept` `reply-dm` | Browser |
|
|
122
|
+
| **twitter** | `trending` `bookmarks` `profile` `search` `timeline` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `article` `follow` `unfollow` `bookmark` `unbookmark` `download` `accept` `reply-dm` `block` `unblock` `hide-reply` | Browser |
|
|
103
123
|
| **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `save` `comment` `subscribe` `saved` `upvoted` | Browser |
|
|
104
124
|
| **cursor** | `status` `send` `read` `new` `dump` `composer` `model` `extract-code` `ask` `screenshot` `history` `export` | Desktop |
|
|
105
125
|
| **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `dynamic` `ranking` `following` `user-videos` `download` | Browser |
|
|
@@ -110,8 +130,8 @@ Run `opencli list` for the live registry.
|
|
|
110
130
|
| **notion** | `status` `search` `read` `new` `write` `sidebar` `favorites` `export` | Desktop |
|
|
111
131
|
| **discord-app** | `status` `send` `read` `channels` `servers` `search` `members` | Desktop |
|
|
112
132
|
| **v2ex** | `hot` `latest` `topic` `node` `user` `member` `replies` `nodes` `daily` `me` `notifications` | Public / Browser |
|
|
113
|
-
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` `earnings-date` | Browser |
|
|
114
|
-
| **antigravity** | `status` `send` `read` `new` `dump` `extract-code` `model` `watch`
|
|
133
|
+
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` `earnings-date` `fund-holdings` `fund-snapshot` | Browser |
|
|
134
|
+
| **antigravity** | `status` `send` `read` `new` `dump` `extract-code` `model` `watch` | Desktop |
|
|
115
135
|
| **chatgpt** | `status` `new` `send` `read` `ask` | Desktop |
|
|
116
136
|
| **xiaohongshu** | `search` `notifications` `feed` `user` `download` `publish` `creator-notes` `creator-note-detail` `creator-notes-summary` `creator-profile` `creator-stats` | Browser |
|
|
117
137
|
| **apple-podcasts** | `search` `episodes` `top` | Public |
|
|
@@ -125,12 +145,15 @@ Run `opencli list` for the live registry.
|
|
|
125
145
|
| **bloomberg** | `main` `markets` `economics` `industries` `tech` `politics` `businessweek` `opinions` `feeds` `news` | Public / Browser |
|
|
126
146
|
| **ctrip** | `search` | Browser |
|
|
127
147
|
| **devto** | `top` `tag` `user` | Public |
|
|
148
|
+
| **dictionary** | `search` `synonyms` `examples` | Public |
|
|
128
149
|
| **arxiv** | `search` `paper` | Public |
|
|
129
|
-
| **wikipedia** | `search` `summary` | Public |
|
|
150
|
+
| **wikipedia** | `search` `summary` `random` `trending` | Public |
|
|
130
151
|
| **hackernews** | `top` `new` `best` `ask` `show` `jobs` `search` `user` | Public |
|
|
152
|
+
| **jd** | `item` | Browser |
|
|
131
153
|
| **linkedin** | `search` | Browser |
|
|
132
154
|
| **reuters** | `search` | Browser |
|
|
133
155
|
| **smzdm** | `search` | Browser |
|
|
156
|
+
| **web** | `read` | Browser |
|
|
134
157
|
| **weibo** | `hot` `search` | Browser |
|
|
135
158
|
| **yahoo-finance** | `quote` | Browser |
|
|
136
159
|
| **sinafinance** | `news` | 🌐 Public |
|
|
@@ -145,14 +168,15 @@ Run `opencli list` for the live registry.
|
|
|
145
168
|
| **stackoverflow** | `hot` `search` `bounties` `unanswered` | Public |
|
|
146
169
|
| **steam** | `top-sellers` | Public |
|
|
147
170
|
| **weread** | `shelf` `search` `book` `highlights` `notes` `notebooks` `ranking` | Browser |
|
|
148
|
-
| **douban** | `search` `top250` `subject` `marks` `reviews` | Browser |
|
|
171
|
+
| **douban** | `search` `top250` `subject` `marks` `reviews` `movie-hot` `book-hot` | Browser |
|
|
149
172
|
| **facebook** | `feed` `profile` `search` `friends` `groups` `events` `notifications` `memories` `add-friend` `join-group` | Browser |
|
|
150
173
|
| **google** | `news` `search` `suggest` `trends` | Public |
|
|
151
174
|
| **instagram** | `explore` `profile` `search` `user` `followers` `following` `follow` `unfollow` `like` `unlike` `comment` `save` `unsave` `saved` | Browser |
|
|
152
175
|
| **lobsters** | `hot` `newest` `active` `tag` | Public |
|
|
153
|
-
| **medium** | `feed` `search` `user`
|
|
154
|
-
| **sinablog** | `hot` `search` `article` `user`
|
|
155
|
-
| **substack** | `feed` `search` `publication`
|
|
176
|
+
| **medium** | `feed` `search` `user` | Browser |
|
|
177
|
+
| **sinablog** | `hot` `search` `article` `user` | Browser |
|
|
178
|
+
| **substack** | `feed` `search` `publication` | Browser |
|
|
179
|
+
| **pixiv** | `ranking` `search` `user` `illusts` `detail` `download` | Browser |
|
|
156
180
|
| **tiktok** | `explore` `search` `profile` `user` `following` `follow` `unfollow` `like` `unlike` `comment` `save` `unsave` `live` `notifications` `friends` | Browser |
|
|
157
181
|
|
|
158
182
|
|
|
@@ -165,7 +189,6 @@ OpenCLI acts as a universal hub for your existing command-line tools. It provide
|
|
|
165
189
|
| **gh** | GitHub CLI | `opencli gh pr list --limit 5` |
|
|
166
190
|
| **obsidian** | Obsidian vault management | `opencli obsidian search query="AI"` |
|
|
167
191
|
| **docker** | Docker command-line interface | `opencli docker ps` |
|
|
168
|
-
| **kubectl** | Kubernetes command-line tool | `opencli kubectl get pods` |
|
|
169
192
|
| **readwise** | Readwise & Reader CLI | `opencli readwise login` |
|
|
170
193
|
| **gws** | Google Workspace CLI — Docs, Sheets, Drive, Gmail, Calendar | `opencli gws docs list` |
|
|
171
194
|
|
|
@@ -205,6 +228,7 @@ OpenCLI supports downloading images, videos, and articles from supported platfor
|
|
|
205
228
|
| **xiaohongshu** | Images, Videos | Downloads all media from a note |
|
|
206
229
|
| **bilibili** | Videos | Requires `yt-dlp` installed |
|
|
207
230
|
| **twitter** | Images, Videos | Downloads from user media tab or single tweet |
|
|
231
|
+
| **pixiv** | Images | Downloads original-quality illustrations, supports multi-page works |
|
|
208
232
|
| **zhihu** | Articles (Markdown) | Exports articles with optional image download |
|
|
209
233
|
| **weixin** | Articles (Markdown) | Exports WeChat Official Account articles |
|
|
210
234
|
|
|
@@ -270,9 +294,12 @@ Extend OpenCLI with community-contributed adapters. Plugins use the same YAML/TS
|
|
|
270
294
|
opencli plugin install github:user/opencli-plugin-my-tool # Install
|
|
271
295
|
opencli plugin list # List installed
|
|
272
296
|
opencli plugin update my-tool # Update to latest
|
|
297
|
+
opencli plugin update --all # Update all installed plugins
|
|
273
298
|
opencli plugin uninstall my-tool # Remove
|
|
274
299
|
```
|
|
275
300
|
|
|
301
|
+
`opencli plugin list` also shows the tracked short commit hash when a plugin version is recorded in `~/.opencli/plugins.lock.json`.
|
|
302
|
+
|
|
276
303
|
| Plugin | Type | Description |
|
|
277
304
|
|--------|------|-------------|
|
|
278
305
|
| [opencli-plugin-github-trending](https://github.com/ByteYue/opencli-plugin-github-trending) | YAML | GitHub Trending repositories |
|
package/README.zh-CN.md
CHANGED
|
@@ -25,11 +25,31 @@ CLI all electron!现在支持把所有 electron 应用 CLI 化,从而组合
|
|
|
25
25
|
- **CLI All Electron** — 支持把所有 electron 应用(如 Antigravity Ultra)CLI 化,让 AI 控制自己!
|
|
26
26
|
- **多站点覆盖** — 覆盖 B站、知乎、小红书、Twitter、Reddit,以及多种桌面应用
|
|
27
27
|
- **零风控** — 复用 Chrome 登录态,无需存储任何凭证
|
|
28
|
-
- **外部 CLI 枢纽** — 统一发现、自动安装、透传执行 `gh`、`docker
|
|
28
|
+
- **外部 CLI 枢纽** — 统一发现、自动安装、透传执行 `gh`、`docker` 等本地 CLI
|
|
29
29
|
- **自修复配置** — `opencli doctor` 自动启动 daemon,诊断扩展和浏览器连接状态
|
|
30
30
|
- **AI 原生** — `explore` 自动发现 API,`synthesize` 生成适配器,`cascade` 探测认证策略
|
|
31
31
|
- **动态加载引擎** — 声明式的 `.yaml` 或者底层定制的 `.ts` 适配器,放入 `clis/` 文件夹即可自动注册生效
|
|
32
32
|
|
|
33
|
+
## 为什么选 opencli?
|
|
34
|
+
|
|
35
|
+
浏览器自动化工具很多,opencli 适合什么场景?
|
|
36
|
+
|
|
37
|
+
| 你的需求 | 最佳工具 | 原因 |
|
|
38
|
+
|----------|----------|------|
|
|
39
|
+
| 定时从特定站点提取结构化数据 | **opencli** | 预定义适配器,确定性 JSON 输出,零 LLM 成本 |
|
|
40
|
+
| AI Agent 需要可靠的站点操作 | **opencli** | 数百条命令,结构化输出,快速确定性响应 |
|
|
41
|
+
| 临时探索未知网站 | Browser-Use、Stagehand | LLM 驱动的通用浏览,适合一次性任务 |
|
|
42
|
+
| 大规模网页爬取 | Crawl4AI、Scrapy | 专为吞吐量和规模设计 |
|
|
43
|
+
| 从终端控制桌面 Electron 应用 | **opencli** | CDP + AppleScript,目前唯一能做到这一点的 CLI 工具 |
|
|
44
|
+
|
|
45
|
+
**opencli 的核心差异:**
|
|
46
|
+
|
|
47
|
+
- **零 LLM 成本** — 运行时不消耗任何 token,跑一万次不花一分钱
|
|
48
|
+
- **确定性** — 同一命令永远返回同一结构,可管道化、可脚本化、CI 友好
|
|
49
|
+
- **覆盖广泛** — 50+ 站点,横跨全球与中国平台(B站、知乎、小红书、Reddit、HackerNews 等),并支持通过 CDP 控制桌面 Electron 应用
|
|
50
|
+
|
|
51
|
+
> 与 Browser-Use、Crawl4AI、Firecrawl 等工具的详细对比,请查看 [Comparison Guide](./docs/comparison.md)。
|
|
52
|
+
|
|
33
53
|
## 前置要求
|
|
34
54
|
|
|
35
55
|
- **Node.js**: >= 20.0.0
|
|
@@ -101,7 +121,7 @@ npm install -g @jackwener/opencli@latest
|
|
|
101
121
|
|
|
102
122
|
| 站点 | 命令 | 模式 |
|
|
103
123
|
|------|------|------|
|
|
104
|
-
| **twitter** | `trending` `bookmarks` `profile` `search` `timeline` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `article` `follow` `unfollow` `bookmark` `unbookmark` `download` `accept` `reply-dm` | 浏览器 |
|
|
124
|
+
| **twitter** | `trending` `bookmarks` `profile` `search` `timeline` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `article` `follow` `unfollow` `bookmark` `unbookmark` `download` `accept` `reply-dm` `block` `unblock` `hide-reply` | 浏览器 |
|
|
105
125
|
| **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `save` `comment` `subscribe` `saved` `upvoted` | 浏览器 |
|
|
106
126
|
| **cursor** | `status` `send` `read` `new` `dump` `composer` `model` `extract-code` `ask` `screenshot` `history` `export` | 桌面端 |
|
|
107
127
|
| **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `dynamic` `ranking` `following` `user-videos` `download` | 浏览器 |
|
|
@@ -112,8 +132,8 @@ npm install -g @jackwener/opencli@latest
|
|
|
112
132
|
| **notion** | `status` `search` `read` `new` `write` `sidebar` `favorites` `export` | 桌面端 |
|
|
113
133
|
| **discord-app** | `status` `send` `read` `channels` `servers` `search` `members` | 桌面端 |
|
|
114
134
|
| **v2ex** | `hot` `latest` `topic` `node` `user` `member` `replies` `nodes` `daily` `me` `notifications` | 公开 / 浏览器 |
|
|
115
|
-
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` `earnings-date` | 浏览器 |
|
|
116
|
-
| **antigravity** | `status` `send` `read` `new` `dump` `extract-code` `model` `watch`
|
|
135
|
+
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` `earnings-date` `fund-holdings` `fund-snapshot` | 浏览器 |
|
|
136
|
+
| **antigravity** | `status` `send` `read` `new` `dump` `extract-code` `model` `watch` | 桌面端 |
|
|
117
137
|
| **chatgpt** | `status` `new` `send` `read` `ask` | 桌面端 |
|
|
118
138
|
| **xiaohongshu** | `search` `notifications` `feed` `user` `download` `publish` `creator-notes` `creator-note-detail` `creator-notes-summary` `creator-profile` `creator-stats` | 浏览器 |
|
|
119
139
|
| **apple-podcasts** | `search` `episodes` `top` | 公开 |
|
|
@@ -127,12 +147,15 @@ npm install -g @jackwener/opencli@latest
|
|
|
127
147
|
| **bloomberg** | `main` `markets` `economics` `industries` `tech` `politics` `businessweek` `opinions` `feeds` `news` | 公共 API / 浏览器 |
|
|
128
148
|
| **ctrip** | `search` | 浏览器 |
|
|
129
149
|
| **devto** | `top` `tag` `user` | 公开 |
|
|
150
|
+
| **dictionary** | `search` `synonyms` `examples` | 公开 |
|
|
130
151
|
| **arxiv** | `search` `paper` | 公开 |
|
|
131
|
-
| **wikipedia** | `search` `summary` | 公开 |
|
|
152
|
+
| **wikipedia** | `search` `summary` `random` `trending` | 公开 |
|
|
132
153
|
| **hackernews** | `top` `new` `best` `ask` `show` `jobs` `search` `user` | 公共 API |
|
|
154
|
+
| **jd** | `item` | 浏览器 |
|
|
133
155
|
| **linkedin** | `search` | 浏览器 |
|
|
134
156
|
| **reuters** | `search` | 浏览器 |
|
|
135
157
|
| **smzdm** | `search` | 浏览器 |
|
|
158
|
+
| **web** | `read` | 浏览器 |
|
|
136
159
|
| **weibo** | `hot` `search` | 浏览器 |
|
|
137
160
|
| **yahoo-finance** | `quote` | 浏览器 |
|
|
138
161
|
| **sinafinance** | `news` | 🌐 公开 |
|
|
@@ -147,14 +170,15 @@ npm install -g @jackwener/opencli@latest
|
|
|
147
170
|
| **stackoverflow** | `hot` `search` `bounties` `unanswered` | 公开 |
|
|
148
171
|
| **steam** | `top-sellers` | 公开 |
|
|
149
172
|
| **weread** | `shelf` `search` `book` `highlights` `notes` `notebooks` `ranking` | 浏览器 |
|
|
150
|
-
| **douban** | `search` `top250` `subject` `marks` `reviews` | 浏览器 |
|
|
173
|
+
| **douban** | `search` `top250` `subject` `marks` `reviews` `movie-hot` `book-hot` | 浏览器 |
|
|
151
174
|
| **facebook** | `feed` `profile` `search` `friends` `groups` `events` `notifications` `memories` `add-friend` `join-group` | 浏览器 |
|
|
152
175
|
| **google** | `news` `search` `suggest` `trends` | 公开 |
|
|
153
176
|
| **instagram** | `explore` `profile` `search` `user` `followers` `following` `follow` `unfollow` `like` `unlike` `comment` `save` `unsave` `saved` | 浏览器 |
|
|
154
177
|
| **lobsters** | `hot` `newest` `active` `tag` | 公开 |
|
|
155
|
-
| **medium** | `feed` `search` `user`
|
|
156
|
-
| **sinablog** | `hot` `search` `article` `user`
|
|
157
|
-
| **substack** | `feed` `search` `publication`
|
|
178
|
+
| **medium** | `feed` `search` `user` | 浏览器 |
|
|
179
|
+
| **sinablog** | `hot` `search` `article` `user` | 浏览器 |
|
|
180
|
+
| **substack** | `feed` `search` `publication` | 浏览器 |
|
|
181
|
+
| **pixiv** | `ranking` `search` `user` `illusts` `detail` `download` | 浏览器 |
|
|
158
182
|
| **tiktok** | `explore` `search` `profile` `user` `following` `follow` `unfollow` `like` `unlike` `comment` `save` `unsave` `live` `notifications` `friends` | 浏览器 |
|
|
159
183
|
|
|
160
184
|
|
|
@@ -167,7 +191,6 @@ OpenCLI 也可以作为你现有命令行工具的统一入口,负责发现、
|
|
|
167
191
|
| **gh** | GitHub CLI | `opencli gh pr list --limit 5` |
|
|
168
192
|
| **obsidian** | Obsidian 仓库管理 | `opencli obsidian search query="AI"` |
|
|
169
193
|
| **docker** | Docker 命令行工具 | `opencli docker ps` |
|
|
170
|
-
| **kubectl** | Kubernetes CLI | `opencli kubectl get pods` |
|
|
171
194
|
| **readwise** | Readwise / Reader CLI | `opencli readwise login` |
|
|
172
195
|
| **gws** | Google Workspace CLI — Docs, Sheets, Drive, Gmail, Calendar | `opencli gws docs list` |
|
|
173
196
|
|
|
@@ -207,6 +230,7 @@ OpenCLI 支持从各平台下载图片、视频和文章。
|
|
|
207
230
|
| **小红书** | 图片、视频 | 下载笔记中的所有媒体文件 |
|
|
208
231
|
| **B站** | 视频 | 需要安装 `yt-dlp` |
|
|
209
232
|
| **Twitter/X** | 图片、视频 | 从用户媒体页或单条推文下载 |
|
|
233
|
+
| **Pixiv** | 图片 | 下载原始画质插画,支持多页作品 |
|
|
210
234
|
| **知乎** | 文章(Markdown) | 导出文章,可选下载图片到本地 |
|
|
211
235
|
| **微信公众号** | 文章(Markdown) | 导出微信公众号文章为 Markdown |
|
|
212
236
|
|
|
@@ -272,9 +296,12 @@ opencli bilibili hot -v # 详细模式:展示管线执行步骤调试
|
|
|
272
296
|
opencli plugin install github:user/opencli-plugin-my-tool # 安装
|
|
273
297
|
opencli plugin list # 查看已安装
|
|
274
298
|
opencli plugin update my-tool # 更新到最新
|
|
299
|
+
opencli plugin update --all # 更新全部已安装插件
|
|
275
300
|
opencli plugin uninstall my-tool # 卸载
|
|
276
301
|
```
|
|
277
302
|
|
|
303
|
+
当 plugin 的版本被记录到 `~/.opencli/plugins.lock.json` 后,`opencli plugin list` 也会显示对应的短 commit hash。
|
|
304
|
+
|
|
278
305
|
| 插件 | 类型 | 描述 |
|
|
279
306
|
|------|------|------|
|
|
280
307
|
| [opencli-plugin-github-trending](https://github.com/ByteYue/opencli-plugin-github-trending) | YAML | GitHub Trending 仓库 |
|
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."
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
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, yollomi, AI, agent]
|
|
7
7
|
---
|
|
@@ -15,6 +15,12 @@ tags: [cli, browser, web, chrome-extension, cdp, bilibili, zhihu, twitter, githu
|
|
|
15
15
|
> 该文档包含完整的 API 发现工作流(必须使用浏览器探索)、5 级认证策略决策树、平台 SDK 速查表、`tap` 步骤调试流程、分页 API 模板、级联请求模式、以及常见陷阱。
|
|
16
16
|
> **本文件(SKILL.md)仅提供命令参考和简化模板,不足以正确开发适配器。**
|
|
17
17
|
|
|
18
|
+
> [!IMPORTANT]
|
|
19
|
+
> 创建或修改 adapter 时,再额外遵守 3 条收口规则:
|
|
20
|
+
> 1. 主参数优先用 positional arg,不要把 `query` / `id` / `url` 默认做成 `--query` / `--id` / `--url`
|
|
21
|
+
> 2. 预期中的 adapter 失败优先抛 `CliError` 子类,不要直接 throw 原始 `Error`
|
|
22
|
+
> 3. 新增 adapter 或新增用户可发现命令时,同步更新 adapter docs、`docs/adapters/index.md`、sidebar,以及 README/README.zh-CN 中受影响的入口
|
|
23
|
+
|
|
18
24
|
## Install & Run
|
|
19
25
|
|
|
20
26
|
```bash
|
|
@@ -182,7 +188,6 @@ opencli antigravity dump # 导出 DOM 和快照调试信息
|
|
|
182
188
|
opencli antigravity extract-code # 自动抽取 AI 回复中的代码块
|
|
183
189
|
opencli antigravity model claude # 切换底层模型
|
|
184
190
|
opencli antigravity watch # 流式监听增量消息
|
|
185
|
-
opencli antigravity serve --port 8082 # 启动 Anthropic 兼容代理
|
|
186
191
|
|
|
187
192
|
# Barchart (browser)
|
|
188
193
|
opencli barchart quote --symbol AAPL # 股票行情
|
package/TESTING.md
CHANGED
|
@@ -68,6 +68,7 @@ src/
|
|
|
68
68
|
| `tests/e2e/browser-auth.test.ts` | `bilibili`、`twitter`、`v2ex`、`xueqiu`、`linux-do`、`xiaohongshu` 的需登录命令 graceful failure |
|
|
69
69
|
| `tests/e2e/management.test.ts` | `list`、`validate`、`verify`、`--version`、`--help`、unknown command |
|
|
70
70
|
| `tests/e2e/output-formats.test.ts` | `json` / `yaml` / `csv` / `md` 输出格式校验 |
|
|
71
|
+
| `tests/e2e/plugin-management.test.ts` | `plugin install` / `list` / `update` / `uninstall` 全生命周期 |
|
|
71
72
|
|
|
72
73
|
### 烟雾测试(1 个文件)
|
|
73
74
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
[CmdletBinding()]
|
|
2
|
+
param(
|
|
3
|
+
[Parameter(ValueFromRemainingArguments = $true)]
|
|
4
|
+
[string[]]$OpenCliArgs
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
$ErrorActionPreference = 'Stop'
|
|
8
|
+
|
|
9
|
+
$chatwiseExe = 'C:\Program Files\ChatWise\ChatWise.exe'
|
|
10
|
+
if (-not (Test-Path $chatwiseExe)) {
|
|
11
|
+
throw "ChatWise executable not found at $chatwiseExe"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
$opencli = Get-Command opencli -ErrorAction SilentlyContinue
|
|
15
|
+
if (-not $opencli) {
|
|
16
|
+
throw 'opencli was not found in PATH'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function Clear-LocalProxyEnv {
|
|
20
|
+
$vars = 'http_proxy','https_proxy','HTTP_PROXY','HTTPS_PROXY'
|
|
21
|
+
foreach ($name in $vars) {
|
|
22
|
+
Set-Item -Path "Env:$name" -Value ''
|
|
23
|
+
}
|
|
24
|
+
$noProxy = '127.0.0.1,localhost'
|
|
25
|
+
Set-Item -Path 'Env:NO_PROXY' -Value $noProxy
|
|
26
|
+
Set-Item -Path 'Env:no_proxy' -Value $noProxy
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function Stop-ChatWiseTree {
|
|
30
|
+
$candidates = Get-CimInstance Win32_Process |
|
|
31
|
+
Where-Object { $_.Name -match '^ChatWise\.exe$|^chatwise\.exe$' }
|
|
32
|
+
|
|
33
|
+
foreach ($proc in $candidates) {
|
|
34
|
+
try {
|
|
35
|
+
Stop-Process -Id $proc.ProcessId -Force -ErrorAction Stop
|
|
36
|
+
} catch {}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
Start-Sleep -Seconds 2
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function Wait-ChatWiseDebugPort {
|
|
43
|
+
param(
|
|
44
|
+
[int]$Port = 9228,
|
|
45
|
+
[int]$TimeoutSeconds = 20
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
$deadline = (Get-Date).AddSeconds($TimeoutSeconds)
|
|
49
|
+
while ((Get-Date) -lt $deadline) {
|
|
50
|
+
try {
|
|
51
|
+
$resp = Invoke-WebRequest -UseBasicParsing -TimeoutSec 2 -Uri "http://127.0.0.1:$Port/json/version"
|
|
52
|
+
if ($resp.StatusCode -ge 200 -and $resp.StatusCode -lt 300) {
|
|
53
|
+
return
|
|
54
|
+
}
|
|
55
|
+
} catch {}
|
|
56
|
+
Start-Sleep -Milliseconds 500
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
throw "ChatWise debugging endpoint did not come up on 127.0.0.1:$Port"
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
Clear-LocalProxyEnv
|
|
63
|
+
Stop-ChatWiseTree
|
|
64
|
+
|
|
65
|
+
$proc = Start-Process -FilePath $chatwiseExe -ArgumentList '--remote-debugging-port=9228' -PassThru
|
|
66
|
+
Start-Sleep -Seconds 4
|
|
67
|
+
|
|
68
|
+
if ($proc.HasExited) {
|
|
69
|
+
throw "ChatWise exited early with code $($proc.ExitCode)"
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
Wait-ChatWiseDebugPort
|
|
73
|
+
|
|
74
|
+
$env:OPENCLI_CDP_ENDPOINT = 'http://127.0.0.1:9228'
|
|
75
|
+
|
|
76
|
+
if (-not $OpenCliArgs -or $OpenCliArgs.Count -eq 0) {
|
|
77
|
+
& $opencli.Source 'chatwise' 'status'
|
|
78
|
+
exit $LASTEXITCODE
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
& $opencli.Source @OpenCliArgs
|
|
82
|
+
exit $LASTEXITCODE
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared API analysis helpers used by both explore.ts and record.ts.
|
|
3
|
+
*
|
|
4
|
+
* Extracts common logic for:
|
|
5
|
+
* - URL pattern normalization
|
|
6
|
+
* - Array path discovery in JSON responses
|
|
7
|
+
* - Field role detection
|
|
8
|
+
* - Auth indicator inference
|
|
9
|
+
* - Capability name inference
|
|
10
|
+
* - Strategy inference
|
|
11
|
+
*/
|
|
12
|
+
/** Normalize a full URL into a pattern (replace IDs, strip volatile params). */
|
|
13
|
+
export declare function urlToPattern(url: string): string;
|
|
14
|
+
export interface ArrayDiscovery {
|
|
15
|
+
path: string;
|
|
16
|
+
items: unknown[];
|
|
17
|
+
}
|
|
18
|
+
/** Find the best (largest) array of objects in a JSON response body. */
|
|
19
|
+
export declare function findArrayPath(obj: unknown, depth?: number): ArrayDiscovery | null;
|
|
20
|
+
/** Flatten nested object keys up to maxDepth. */
|
|
21
|
+
export declare function flattenFields(obj: unknown, prefix: string, maxDepth: number): string[];
|
|
22
|
+
/** Detect semantic field roles (title, url, author, etc.) from sample fields. */
|
|
23
|
+
export declare function detectFieldRoles(sampleFields: string[]): Record<string, string>;
|
|
24
|
+
/** Infer a CLI capability name from a URL. */
|
|
25
|
+
export declare function inferCapabilityName(url: string, goal?: string): string;
|
|
26
|
+
/** Infer auth strategy from detected indicators. */
|
|
27
|
+
export declare function inferStrategy(authIndicators: string[]): string;
|
|
28
|
+
/** Detect auth indicators from HTTP headers. */
|
|
29
|
+
export declare function detectAuthFromHeaders(headers?: Record<string, string>): string[];
|
|
30
|
+
/** Detect auth indicators from URL and response body (heuristic). */
|
|
31
|
+
export declare function detectAuthFromContent(url: string, body: unknown): string[];
|
|
32
|
+
/** Extract non-volatile query params and classify them. */
|
|
33
|
+
export declare function classifyQueryParams(url: string): {
|
|
34
|
+
params: string[];
|
|
35
|
+
hasSearch: boolean;
|
|
36
|
+
hasPagination: boolean;
|
|
37
|
+
hasLimit: boolean;
|
|
38
|
+
};
|