@jackwener/opencli 1.4.0 → 1.5.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/actions/setup-chrome/action.yml +5 -4
- package/.github/workflows/build-extension.yml +2 -6
- package/.github/workflows/ci.yml +37 -3
- package/.github/workflows/e2e-headed.yml +16 -3
- package/CHANGELOG.md +23 -0
- package/PRIVACY.md +57 -0
- package/README.md +36 -7
- package/README.zh-CN.md +13 -6
- package/SKILL.md +103 -2
- package/dist/browser/cdp.d.ts +2 -1
- package/dist/browser/discover.d.ts +4 -1
- package/dist/browser/discover.js +6 -2
- package/dist/browser/errors.d.ts +2 -2
- package/dist/browser/errors.js +4 -12
- package/dist/browser/mcp.d.ts +2 -1
- package/dist/build-manifest.d.ts +2 -0
- package/dist/build-manifest.js +39 -14
- package/dist/build-manifest.test.js +21 -0
- package/dist/capabilityRouting.d.ts +2 -0
- package/dist/capabilityRouting.js +2 -1
- package/dist/cli-manifest.json +1838 -151
- package/dist/cli.js +34 -3
- package/dist/clis/36kr/article.d.ts +1 -0
- package/dist/clis/36kr/article.js +62 -0
- package/dist/clis/36kr/hot.d.ts +3 -0
- package/dist/clis/36kr/hot.js +80 -0
- package/dist/clis/36kr/hot.test.d.ts +1 -0
- package/dist/clis/36kr/hot.test.js +15 -0
- package/dist/clis/36kr/news.d.ts +1 -0
- package/dist/clis/36kr/news.js +51 -0
- package/dist/clis/36kr/news.test.d.ts +1 -0
- package/dist/clis/36kr/news.test.js +85 -0
- package/dist/clis/36kr/search.d.ts +1 -0
- package/dist/clis/36kr/search.js +72 -0
- package/dist/clis/apple-podcasts/search.js +2 -1
- package/dist/clis/arxiv/search.js +2 -2
- package/dist/clis/bbc/news.js +0 -1
- package/dist/clis/bilibili/comments.d.ts +5 -0
- package/dist/clis/bilibili/comments.js +40 -0
- package/dist/clis/bilibili/comments.test.d.ts +1 -0
- package/dist/clis/bilibili/comments.test.js +82 -0
- package/dist/clis/chatgpt/ask.js +29 -14
- package/dist/clis/chatgpt/ax.d.ts +6 -0
- package/dist/clis/chatgpt/ax.js +172 -1
- package/dist/clis/chatgpt/model.d.ts +1 -0
- package/dist/clis/chatgpt/model.js +24 -0
- package/dist/clis/chatgpt/send.js +12 -3
- package/dist/clis/ctrip/search.js +0 -1
- package/dist/clis/douban/download.d.ts +1 -0
- package/dist/clis/douban/download.js +67 -0
- package/dist/clis/douban/download.test.d.ts +1 -0
- package/dist/clis/douban/download.test.js +170 -0
- package/dist/clis/douban/photos.d.ts +1 -0
- package/dist/clis/douban/photos.js +34 -0
- package/dist/clis/douban/utils.d.ts +25 -0
- package/dist/clis/douban/utils.js +190 -1
- package/dist/clis/douban/utils.test.d.ts +1 -0
- package/dist/clis/douban/utils.test.js +64 -0
- package/dist/clis/douyin/_shared/browser-fetch.d.ts +10 -0
- package/dist/clis/douyin/_shared/browser-fetch.js +30 -0
- package/dist/clis/douyin/_shared/browser-fetch.test.d.ts +1 -0
- package/dist/clis/douyin/_shared/browser-fetch.test.js +31 -0
- package/dist/clis/douyin/_shared/creation-id.d.ts +1 -0
- package/dist/clis/douyin/_shared/creation-id.js +5 -0
- package/dist/clis/douyin/_shared/creation-id.test.d.ts +1 -0
- package/dist/clis/douyin/_shared/creation-id.test.js +22 -0
- package/dist/clis/douyin/_shared/imagex-upload.d.ts +20 -0
- package/dist/clis/douyin/_shared/imagex-upload.js +53 -0
- package/dist/clis/douyin/_shared/imagex-upload.test.d.ts +1 -0
- package/dist/clis/douyin/_shared/imagex-upload.test.js +87 -0
- package/dist/clis/douyin/_shared/sts2.d.ts +8 -0
- package/dist/clis/douyin/_shared/sts2.js +15 -0
- package/dist/clis/douyin/_shared/text-extra.d.ts +18 -0
- package/dist/clis/douyin/_shared/text-extra.js +15 -0
- package/dist/clis/douyin/_shared/text-extra.test.d.ts +1 -0
- package/dist/clis/douyin/_shared/text-extra.test.js +37 -0
- package/dist/clis/douyin/_shared/timing.d.ts +2 -0
- package/dist/clis/douyin/_shared/timing.js +22 -0
- package/dist/clis/douyin/_shared/timing.test.d.ts +1 -0
- package/dist/clis/douyin/_shared/timing.test.js +28 -0
- package/dist/clis/douyin/_shared/tos-upload-short-read.test.d.ts +11 -0
- package/dist/clis/douyin/_shared/tos-upload-short-read.test.js +83 -0
- package/dist/clis/douyin/_shared/tos-upload.d.ts +53 -0
- package/dist/clis/douyin/_shared/tos-upload.js +295 -0
- package/dist/clis/douyin/_shared/tos-upload.test.d.ts +1 -0
- package/dist/clis/douyin/_shared/tos-upload.test.js +229 -0
- package/dist/clis/douyin/_shared/transcode.d.ts +27 -0
- package/dist/clis/douyin/_shared/transcode.js +45 -0
- package/dist/clis/douyin/_shared/transcode.test.d.ts +1 -0
- package/dist/clis/douyin/_shared/transcode.test.js +93 -0
- package/dist/clis/douyin/_shared/types.d.ts +26 -0
- package/dist/clis/douyin/_shared/types.js +1 -0
- package/dist/clis/douyin/activities.d.ts +1 -0
- package/dist/clis/douyin/activities.js +20 -0
- package/dist/clis/douyin/activities.test.d.ts +1 -0
- package/dist/clis/douyin/activities.test.js +22 -0
- package/dist/clis/douyin/collections.d.ts +1 -0
- package/dist/clis/douyin/collections.js +22 -0
- package/dist/clis/douyin/collections.test.d.ts +1 -0
- package/dist/clis/douyin/collections.test.js +23 -0
- package/dist/clis/douyin/delete.d.ts +1 -0
- package/dist/clis/douyin/delete.js +18 -0
- package/dist/clis/douyin/delete.test.d.ts +1 -0
- package/dist/clis/douyin/delete.test.js +11 -0
- package/dist/clis/douyin/draft.d.ts +14 -0
- package/dist/clis/douyin/draft.js +237 -0
- package/dist/clis/douyin/draft.test.d.ts +1 -0
- package/dist/clis/douyin/draft.test.js +11 -0
- package/dist/clis/douyin/drafts.d.ts +1 -0
- package/dist/clis/douyin/drafts.js +23 -0
- package/dist/clis/douyin/drafts.test.d.ts +1 -0
- package/dist/clis/douyin/drafts.test.js +11 -0
- package/dist/clis/douyin/hashtag.d.ts +1 -0
- package/dist/clis/douyin/hashtag.js +45 -0
- package/dist/clis/douyin/hashtag.test.d.ts +1 -0
- package/dist/clis/douyin/hashtag.test.js +25 -0
- package/dist/clis/douyin/location.d.ts +1 -0
- package/dist/clis/douyin/location.js +24 -0
- package/dist/clis/douyin/location.test.d.ts +1 -0
- package/dist/clis/douyin/location.test.js +23 -0
- package/dist/clis/douyin/profile.d.ts +1 -0
- package/dist/clis/douyin/profile.js +28 -0
- package/dist/clis/douyin/profile.test.d.ts +1 -0
- package/dist/clis/douyin/profile.test.js +11 -0
- package/dist/clis/douyin/publish.d.ts +14 -0
- package/dist/clis/douyin/publish.js +288 -0
- package/dist/clis/douyin/publish.test.d.ts +1 -0
- package/dist/clis/douyin/publish.test.js +38 -0
- package/dist/clis/douyin/stats.d.ts +1 -0
- package/dist/clis/douyin/stats.js +27 -0
- package/dist/clis/douyin/stats.test.d.ts +1 -0
- package/dist/clis/douyin/stats.test.js +22 -0
- package/dist/clis/douyin/update.d.ts +1 -0
- package/dist/clis/douyin/update.js +31 -0
- package/dist/clis/douyin/update.test.d.ts +1 -0
- package/dist/clis/douyin/update.test.js +11 -0
- package/dist/clis/douyin/videos.d.ts +1 -0
- package/dist/clis/douyin/videos.js +34 -0
- package/dist/clis/douyin/videos.test.d.ts +1 -0
- package/dist/clis/douyin/videos.test.js +11 -0
- package/dist/clis/hackernews/search.yaml +1 -1
- package/dist/clis/imdb/person.d.ts +1 -0
- package/dist/clis/imdb/person.js +203 -0
- package/dist/clis/imdb/reviews.d.ts +1 -0
- package/dist/clis/imdb/reviews.js +88 -0
- package/dist/clis/imdb/search.d.ts +1 -0
- package/dist/clis/imdb/search.js +161 -0
- package/dist/clis/imdb/title.d.ts +1 -0
- package/dist/clis/imdb/title.js +93 -0
- package/dist/clis/imdb/top.d.ts +1 -0
- package/dist/clis/imdb/top.js +53 -0
- package/dist/clis/imdb/trending.d.ts +1 -0
- package/dist/clis/imdb/trending.js +52 -0
- package/dist/clis/imdb/utils.d.ts +46 -0
- package/dist/clis/imdb/utils.js +285 -0
- package/dist/clis/imdb/utils.test.d.ts +1 -0
- package/dist/clis/imdb/utils.test.js +88 -0
- package/dist/clis/instagram/search.yaml +2 -1
- package/dist/clis/jd/item.d.ts +4 -0
- package/dist/clis/jd/item.js +16 -15
- package/dist/clis/jd/item.test.js +16 -1
- package/dist/clis/linux-do/categories.yaml +38 -9
- package/dist/clis/linux-do/category.d.ts +1 -0
- package/dist/clis/linux-do/category.js +36 -0
- package/dist/clis/linux-do/feed.d.ts +45 -0
- package/dist/clis/linux-do/feed.js +397 -0
- package/dist/clis/linux-do/feed.test.d.ts +1 -0
- package/dist/clis/linux-do/feed.test.js +118 -0
- package/dist/clis/linux-do/hot.d.ts +1 -0
- package/dist/clis/linux-do/hot.js +25 -0
- package/dist/clis/linux-do/latest.d.ts +1 -0
- package/dist/clis/linux-do/latest.js +18 -0
- package/dist/clis/linux-do/search.yaml +3 -1
- package/dist/clis/linux-do/tags.yaml +41 -0
- package/dist/clis/linux-do/topic.yaml +41 -3
- package/dist/clis/linux-do/user-posts.yaml +67 -0
- package/dist/clis/linux-do/user-topics.yaml +54 -0
- package/dist/clis/medium/search.js +1 -1
- package/dist/clis/paperreview/commands.test.d.ts +3 -0
- package/dist/clis/paperreview/commands.test.js +243 -0
- package/dist/clis/paperreview/feedback.d.ts +1 -0
- package/dist/clis/paperreview/feedback.js +52 -0
- package/dist/clis/paperreview/review.d.ts +1 -0
- package/dist/clis/paperreview/review.js +37 -0
- package/dist/clis/paperreview/submit.d.ts +1 -0
- package/dist/clis/paperreview/submit.js +85 -0
- package/dist/clis/paperreview/utils.d.ts +46 -0
- package/dist/clis/paperreview/utils.js +197 -0
- package/dist/clis/paperreview/utils.test.d.ts +1 -0
- package/dist/clis/paperreview/utils.test.js +49 -0
- package/dist/clis/producthunt/browse.d.ts +1 -0
- package/dist/clis/producthunt/browse.js +99 -0
- package/dist/clis/producthunt/hot.d.ts +1 -0
- package/dist/clis/producthunt/hot.js +110 -0
- package/dist/clis/producthunt/posts.d.ts +1 -0
- package/dist/clis/producthunt/posts.js +28 -0
- package/dist/clis/producthunt/today.d.ts +1 -0
- package/dist/clis/producthunt/today.js +35 -0
- package/dist/clis/producthunt/utils.d.ts +29 -0
- package/dist/clis/producthunt/utils.js +99 -0
- package/dist/clis/producthunt/utils.test.d.ts +1 -0
- package/dist/clis/producthunt/utils.test.js +64 -0
- package/dist/clis/reuters/search.js +0 -1
- package/dist/clis/twitter/article.js +4 -28
- package/dist/clis/twitter/likes.d.ts +24 -0
- package/dist/clis/twitter/likes.js +217 -0
- package/dist/clis/twitter/likes.test.d.ts +1 -0
- package/dist/clis/twitter/likes.test.js +85 -0
- package/dist/clis/twitter/profile.js +4 -28
- package/dist/clis/twitter/search.js +7 -4
- package/dist/clis/twitter/search.test.js +56 -2
- package/dist/clis/twitter/shared.d.ts +6 -0
- package/dist/clis/twitter/shared.js +35 -0
- package/dist/clis/twitter/timeline.js +2 -13
- package/dist/clis/weibo/comments.d.ts +1 -0
- package/dist/clis/weibo/comments.js +53 -0
- package/dist/clis/weibo/feed.d.ts +1 -0
- package/dist/clis/weibo/feed.js +56 -0
- package/dist/clis/weibo/hot.js +0 -1
- package/dist/clis/weibo/me.d.ts +1 -0
- package/dist/clis/weibo/me.js +76 -0
- package/dist/clis/weibo/post.d.ts +1 -0
- package/dist/clis/weibo/post.js +75 -0
- package/dist/clis/weibo/user.d.ts +1 -0
- package/dist/clis/weibo/user.js +63 -0
- package/dist/clis/weibo/utils.d.ts +6 -0
- package/dist/clis/weibo/utils.js +30 -0
- package/dist/clis/weixin/download.d.ts +17 -0
- package/dist/clis/weixin/download.js +88 -20
- package/dist/clis/weread/book.js +2 -2
- package/dist/clis/weread/commands.test.d.ts +3 -0
- package/dist/clis/weread/commands.test.js +43 -0
- package/dist/clis/weread/highlights.js +2 -2
- package/dist/clis/weread/notebooks.js +2 -2
- package/dist/clis/weread/notes.js +3 -3
- package/dist/clis/weread/search.js +3 -2
- package/dist/clis/weread/shelf.js +2 -2
- package/dist/clis/weread/utils.d.ts +4 -4
- package/dist/clis/weread/utils.js +32 -14
- package/dist/clis/weread/utils.test.js +1 -28
- package/dist/clis/xiaohongshu/comments.d.ts +5 -0
- package/dist/clis/xiaohongshu/comments.js +74 -0
- package/dist/clis/xiaohongshu/comments.test.d.ts +1 -0
- package/dist/clis/xiaohongshu/comments.test.js +79 -0
- package/dist/clis/xiaohongshu/publish.js +114 -18
- package/dist/clis/xiaohongshu/publish.test.d.ts +1 -0
- package/dist/clis/xiaohongshu/publish.test.js +119 -0
- package/dist/clis/xueqiu/search.yaml +2 -1
- package/dist/clis/yahoo-finance/quote.js +0 -1
- package/dist/clis/youtube/channel.d.ts +1 -0
- package/dist/clis/youtube/channel.js +150 -0
- package/dist/clis/youtube/comments.d.ts +1 -0
- package/dist/clis/youtube/comments.js +95 -0
- package/dist/clis/youtube/search.js +0 -1
- package/dist/clis/zhihu/search.yaml +2 -1
- package/dist/commanderAdapter.d.ts +1 -0
- package/dist/commanderAdapter.js +176 -29
- package/dist/commanderAdapter.test.d.ts +1 -0
- package/dist/commanderAdapter.test.js +62 -0
- package/dist/daemon.js +17 -1
- package/dist/discovery.js +8 -14
- package/dist/doctor.d.ts +1 -0
- package/dist/doctor.js +9 -2
- package/dist/download/index.js +63 -51
- package/dist/download/index.test.js +17 -4
- package/dist/errors.d.ts +3 -1
- package/dist/errors.js +15 -32
- package/dist/execution.d.ts +1 -3
- package/dist/execution.js +21 -1
- package/dist/external-clis.yaml +0 -17
- package/dist/hooks.js +2 -0
- package/dist/main.js +5 -0
- package/dist/output.js +5 -1
- package/dist/pipeline/executor.js +3 -4
- package/dist/plugin-manifest.d.ts +70 -0
- package/dist/plugin-manifest.js +160 -0
- package/dist/plugin-manifest.test.d.ts +4 -0
- package/dist/plugin-manifest.test.js +179 -0
- package/dist/plugin.d.ts +38 -5
- package/dist/plugin.js +267 -33
- package/dist/plugin.test.js +220 -3
- package/dist/registry.d.ts +4 -0
- package/dist/registry.js +2 -0
- package/dist/runtime-detect.d.ts +21 -0
- package/dist/runtime-detect.js +32 -0
- package/dist/runtime-detect.test.d.ts +1 -0
- package/dist/runtime-detect.test.js +27 -0
- package/dist/runtime.js +1 -1
- package/dist/serialization.d.ts +2 -0
- package/dist/serialization.js +6 -0
- package/dist/types.d.ts +1 -0
- package/dist/update-check.d.ts +22 -0
- package/dist/update-check.js +112 -0
- package/dist/weixin-download.test.d.ts +1 -0
- package/dist/weixin-download.test.js +30 -0
- package/dist/weread-private-api-regression.test.d.ts +1 -0
- package/dist/weread-private-api-regression.test.js +122 -0
- package/dist/weread-search-regression.test.d.ts +1 -0
- package/dist/weread-search-regression.test.js +39 -0
- package/dist/yaml-schema.d.ts +3 -0
- package/dist/yaml-schema.js +18 -1
- package/docs/.vitepress/config.mts +17 -0
- package/docs/adapters/browser/36kr.md +47 -0
- package/docs/adapters/browser/douban.md +14 -0
- package/docs/adapters/browser/douyin.md +75 -0
- package/docs/adapters/browser/imdb.md +47 -0
- package/docs/adapters/browser/jd.md +2 -2
- package/docs/adapters/browser/linux-do.md +181 -20
- package/docs/adapters/browser/paperreview.md +43 -0
- package/docs/adapters/browser/producthunt.md +49 -0
- package/docs/adapters/browser/twitter.md +6 -0
- package/docs/adapters/desktop/chatgpt.md +5 -0
- package/docs/adapters/index.md +12 -3
- package/docs/advanced/download.md +4 -0
- package/docs/advanced/rate-limiter-plugin.md +99 -0
- package/docs/guide/electron-app-cli.md +200 -0
- package/docs/guide/getting-started.md +1 -0
- package/docs/guide/plugins.md +87 -0
- package/docs/zh/guide/electron-app-cli.md +188 -0
- package/docs/zh/guide/getting-started.md +1 -0
- package/docs/zh/guide/plugins.md +65 -0
- package/extension/dist/background.js +508 -518
- package/extension/manifest.json +6 -2
- package/extension/package.json +2 -1
- package/extension/popup.html +84 -0
- package/extension/popup.js +25 -0
- package/extension/scripts/package-release.mjs +179 -0
- package/extension/src/background.ts +22 -1
- package/package.json +4 -1
- package/scripts/postinstall.js +10 -0
- package/src/browser/cdp.ts +2 -1
- package/src/browser/discover.ts +8 -3
- package/src/browser/errors.ts +13 -14
- package/src/browser/mcp.ts +2 -1
- package/src/build-manifest.test.ts +23 -0
- package/src/build-manifest.ts +40 -15
- package/src/capabilityRouting.ts +2 -1
- package/src/cli.ts +35 -3
- package/src/clis/36kr/article.ts +69 -0
- package/src/clis/36kr/hot.test.ts +19 -0
- package/src/clis/36kr/hot.ts +100 -0
- package/src/clis/36kr/news.test.ts +90 -0
- package/src/clis/36kr/news.ts +54 -0
- package/src/clis/36kr/search.ts +78 -0
- package/src/clis/apple-podcasts/search.ts +2 -1
- package/src/clis/arxiv/search.ts +2 -2
- package/src/clis/bbc/news.ts +0 -1
- package/src/clis/bilibili/comments.test.ts +102 -0
- package/src/clis/bilibili/comments.ts +44 -0
- package/src/clis/chatgpt/ask.ts +28 -14
- package/src/clis/chatgpt/ax.ts +180 -1
- package/src/clis/chatgpt/model.ts +27 -0
- package/src/clis/chatgpt/send.ts +16 -6
- package/src/clis/ctrip/search.ts +0 -1
- package/src/clis/douban/download.test.ts +196 -0
- package/src/clis/douban/download.ts +78 -0
- package/src/clis/douban/photos.ts +36 -0
- package/src/clis/douban/utils.test.ts +97 -0
- package/src/clis/douban/utils.ts +232 -1
- package/src/clis/douyin/_shared/browser-fetch.test.ts +38 -0
- package/src/clis/douyin/_shared/browser-fetch.ts +45 -0
- package/src/clis/douyin/_shared/creation-id.test.ts +26 -0
- package/src/clis/douyin/_shared/creation-id.ts +8 -0
- package/src/clis/douyin/_shared/imagex-upload.test.ts +113 -0
- package/src/clis/douyin/_shared/imagex-upload.ts +76 -0
- package/src/clis/douyin/_shared/sts2.ts +20 -0
- package/src/clis/douyin/_shared/text-extra.test.ts +42 -0
- package/src/clis/douyin/_shared/text-extra.ts +33 -0
- package/src/clis/douyin/_shared/timing.test.ts +38 -0
- package/src/clis/douyin/_shared/timing.ts +22 -0
- package/src/clis/douyin/_shared/tos-upload-short-read.test.ts +102 -0
- package/src/clis/douyin/_shared/tos-upload.test.ts +281 -0
- package/src/clis/douyin/_shared/tos-upload.ts +444 -0
- package/src/clis/douyin/_shared/transcode.test.ts +117 -0
- package/src/clis/douyin/_shared/transcode.ts +78 -0
- package/src/clis/douyin/_shared/types.ts +29 -0
- package/src/clis/douyin/activities.test.ts +25 -0
- package/src/clis/douyin/activities.ts +23 -0
- package/src/clis/douyin/collections.test.ts +26 -0
- package/src/clis/douyin/collections.ts +25 -0
- package/src/clis/douyin/delete.test.ts +12 -0
- package/src/clis/douyin/delete.ts +20 -0
- package/src/clis/douyin/draft.test.ts +12 -0
- package/src/clis/douyin/draft.ts +282 -0
- package/src/clis/douyin/drafts.test.ts +12 -0
- package/src/clis/douyin/drafts.ts +27 -0
- package/src/clis/douyin/hashtag.test.ts +28 -0
- package/src/clis/douyin/hashtag.ts +56 -0
- package/src/clis/douyin/location.test.ts +26 -0
- package/src/clis/douyin/location.ts +27 -0
- package/src/clis/douyin/profile.test.ts +12 -0
- package/src/clis/douyin/profile.ts +37 -0
- package/src/clis/douyin/publish.test.ts +45 -0
- package/src/clis/douyin/publish.ts +340 -0
- package/src/clis/douyin/stats.test.ts +25 -0
- package/src/clis/douyin/stats.ts +30 -0
- package/src/clis/douyin/update.test.ts +12 -0
- package/src/clis/douyin/update.ts +43 -0
- package/src/clis/douyin/videos.test.ts +12 -0
- package/src/clis/douyin/videos.ts +49 -0
- package/src/clis/hackernews/search.yaml +1 -1
- package/src/clis/imdb/person.ts +232 -0
- package/src/clis/imdb/reviews.ts +111 -0
- package/src/clis/imdb/search.ts +179 -0
- package/src/clis/imdb/title.ts +121 -0
- package/src/clis/imdb/top.ts +67 -0
- package/src/clis/imdb/trending.ts +66 -0
- package/src/clis/imdb/utils.test.ts +117 -0
- package/src/clis/imdb/utils.ts +305 -0
- package/src/clis/instagram/search.yaml +2 -1
- package/src/clis/jd/item.test.ts +18 -1
- package/src/clis/jd/item.ts +18 -15
- package/src/clis/linux-do/categories.yaml +38 -9
- package/src/clis/linux-do/category.ts +37 -0
- package/src/clis/linux-do/feed.test.ts +132 -0
- package/src/clis/linux-do/feed.ts +501 -0
- package/src/clis/linux-do/hot.ts +26 -0
- package/src/clis/linux-do/latest.ts +19 -0
- package/src/clis/linux-do/search.yaml +3 -1
- package/src/clis/linux-do/tags.yaml +41 -0
- package/src/clis/linux-do/topic.yaml +41 -3
- package/src/clis/linux-do/user-posts.yaml +67 -0
- package/src/clis/linux-do/user-topics.yaml +54 -0
- package/src/clis/medium/search.ts +1 -1
- package/src/clis/paperreview/commands.test.ts +283 -0
- package/src/clis/paperreview/feedback.ts +64 -0
- package/src/clis/paperreview/review.ts +47 -0
- package/src/clis/paperreview/submit.ts +119 -0
- package/src/clis/paperreview/utils.test.ts +68 -0
- package/src/clis/paperreview/utils.ts +276 -0
- package/src/clis/producthunt/browse.ts +109 -0
- package/src/clis/producthunt/hot.ts +127 -0
- package/src/clis/producthunt/posts.ts +29 -0
- package/src/clis/producthunt/today.ts +37 -0
- package/src/clis/producthunt/utils.test.ts +72 -0
- package/src/clis/producthunt/utils.ts +122 -0
- package/src/clis/reuters/search.ts +0 -1
- package/src/clis/twitter/article.ts +5 -28
- package/src/clis/twitter/likes.test.ts +91 -0
- package/src/clis/twitter/likes.ts +256 -0
- package/src/clis/twitter/profile.ts +5 -28
- package/src/clis/twitter/search.test.ts +71 -2
- package/src/clis/twitter/search.ts +8 -4
- package/src/clis/twitter/shared.ts +45 -0
- package/src/clis/twitter/timeline.ts +2 -13
- package/src/clis/weibo/comments.ts +54 -0
- package/src/clis/weibo/feed.ts +57 -0
- package/src/clis/weibo/hot.ts +0 -1
- package/src/clis/weibo/me.ts +77 -0
- package/src/clis/weibo/post.ts +77 -0
- package/src/clis/weibo/user.ts +64 -0
- package/src/clis/weibo/utils.ts +32 -0
- package/src/clis/weixin/download.ts +114 -20
- package/src/clis/weread/book.ts +2 -2
- package/src/clis/weread/commands.test.ts +57 -0
- package/src/clis/weread/highlights.ts +2 -2
- package/src/clis/weread/notebooks.ts +2 -2
- package/src/clis/weread/notes.ts +3 -3
- package/src/clis/weread/search.ts +3 -2
- package/src/clis/weread/shelf.ts +2 -2
- package/src/clis/weread/utils.test.ts +1 -32
- package/src/clis/weread/utils.ts +41 -16
- package/src/clis/xiaohongshu/comments.test.ts +96 -0
- package/src/clis/xiaohongshu/comments.ts +81 -0
- package/src/clis/xiaohongshu/publish.test.ts +137 -0
- package/src/clis/xiaohongshu/publish.ts +129 -18
- package/src/clis/xueqiu/search.yaml +2 -1
- package/src/clis/yahoo-finance/quote.ts +0 -1
- package/src/clis/youtube/channel.ts +155 -0
- package/src/clis/youtube/comments.ts +97 -0
- package/src/clis/youtube/search.ts +0 -1
- package/src/clis/zhihu/search.yaml +2 -1
- package/src/commanderAdapter.test.ts +78 -0
- package/src/commanderAdapter.ts +188 -24
- package/src/daemon.ts +19 -1
- package/src/discovery.ts +8 -15
- package/src/doctor.ts +13 -2
- package/src/download/index.test.ts +14 -4
- package/src/download/index.ts +67 -55
- package/src/errors.ts +25 -66
- package/src/execution.ts +28 -3
- package/src/external-clis.yaml +0 -17
- package/src/hooks.ts +1 -0
- package/src/main.ts +6 -0
- package/src/output.ts +3 -1
- package/src/pipeline/executor.ts +4 -6
- package/src/plugin-manifest.test.ts +223 -0
- package/src/plugin-manifest.ts +206 -0
- package/src/plugin.test.ts +246 -2
- package/src/plugin.ts +338 -36
- package/src/registry.ts +6 -1
- package/src/runtime-detect.test.ts +30 -0
- package/src/runtime-detect.ts +36 -0
- package/src/runtime.ts +1 -1
- package/src/serialization.ts +4 -0
- package/src/types.ts +1 -0
- package/src/update-check.ts +114 -0
- package/src/weixin-download.test.ts +64 -0
- package/src/weread-private-api-regression.test.ts +150 -0
- package/src/weread-search-regression.test.ts +44 -0
- package/src/yaml-schema.ts +20 -0
- package/tests/e2e/browser-auth.test.ts +13 -9
- package/tests/e2e/browser-public-extended.test.ts +162 -0
- package/tests/e2e/browser-public.test.ts +55 -136
- package/tests/e2e/helpers.ts +2 -1
- package/tests/e2e/public-commands.test.ts +37 -3
- package/tests/smoke/api-health.test.ts +1 -1
- package/vitest.config.ts +34 -17
- package/dist/clis/linux-do/category.yaml +0 -51
- package/dist/clis/linux-do/hot.yaml +0 -50
- package/dist/clis/linux-do/latest.yaml +0 -40
- package/src/clis/linux-do/category.yaml +0 -51
- package/src/clis/linux-do/hot.yaml +0 -50
- package/src/clis/linux-do/latest.yaml +0 -40
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
name: Setup Chrome
|
|
2
|
-
description: Install real Chrome
|
|
1
|
+
name: Setup Chrome
|
|
2
|
+
description: Install real Chrome for browser testing (with xvfb on Linux)
|
|
3
3
|
|
|
4
4
|
outputs:
|
|
5
5
|
chrome-path:
|
|
@@ -19,8 +19,9 @@ runs:
|
|
|
19
19
|
shell: bash
|
|
20
20
|
run: |
|
|
21
21
|
echo "Chrome path: ${{ steps.setup-chrome.outputs.chrome-path }}"
|
|
22
|
-
${{ steps.setup-chrome.outputs.chrome-path }} --version
|
|
22
|
+
"${{ steps.setup-chrome.outputs.chrome-path }}" --version
|
|
23
23
|
|
|
24
|
-
- name: Install xvfb
|
|
24
|
+
- name: Install xvfb (Linux only)
|
|
25
|
+
if: runner.os == 'Linux'
|
|
25
26
|
shell: bash
|
|
26
27
|
run: sudo apt-get install -y xvfb
|
|
@@ -39,12 +39,8 @@ jobs:
|
|
|
39
39
|
working-directory: extension
|
|
40
40
|
|
|
41
41
|
- name: Prepare extension package
|
|
42
|
-
run:
|
|
43
|
-
|
|
44
|
-
mkdir -p extension-package
|
|
45
|
-
cp extension/manifest.json extension-package/
|
|
46
|
-
cp -R extension/dist extension-package/
|
|
47
|
-
cp -R extension/icons extension-package/
|
|
42
|
+
run: npm run package:release -- --out ../extension-package
|
|
43
|
+
working-directory: extension
|
|
48
44
|
|
|
49
45
|
- name: Create Extension ZIP
|
|
50
46
|
run: |
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -61,6 +61,27 @@ jobs:
|
|
|
61
61
|
- name: Run unit tests (Node ${{ matrix.node-version }}, shard ${{ matrix.shard }}/2)
|
|
62
62
|
run: npm test -- --reporter=verbose --shard=${{ matrix.shard }}/2
|
|
63
63
|
|
|
64
|
+
# ── Bun compatibility check ──
|
|
65
|
+
bun-test:
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
steps:
|
|
68
|
+
- uses: actions/checkout@v6
|
|
69
|
+
|
|
70
|
+
- uses: oven-sh/setup-bun@v2
|
|
71
|
+
with:
|
|
72
|
+
bun-version: 1.3.5
|
|
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 unit tests under Bun
|
|
83
|
+
run: bun vitest run --project unit --reporter=verbose
|
|
84
|
+
|
|
64
85
|
adapter-test:
|
|
65
86
|
runs-on: ${{ matrix.os }}
|
|
66
87
|
strategy:
|
|
@@ -86,7 +107,13 @@ jobs:
|
|
|
86
107
|
smoke-test:
|
|
87
108
|
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
|
88
109
|
needs: build
|
|
89
|
-
runs-on:
|
|
110
|
+
runs-on: ${{ matrix.os }}
|
|
111
|
+
strategy:
|
|
112
|
+
fail-fast: false
|
|
113
|
+
matrix:
|
|
114
|
+
# NOTE: Windows excluded — browser-actions/setup-chrome hangs during
|
|
115
|
+
# Chrome MSI installation on Windows runners (known issue).
|
|
116
|
+
os: [ubuntu-latest, macos-latest]
|
|
90
117
|
steps:
|
|
91
118
|
- uses: actions/checkout@v6
|
|
92
119
|
|
|
@@ -98,17 +125,24 @@ jobs:
|
|
|
98
125
|
- name: Install dependencies
|
|
99
126
|
run: npm ci
|
|
100
127
|
|
|
101
|
-
- name: Setup Chrome
|
|
128
|
+
- name: Setup Chrome
|
|
102
129
|
uses: ./.github/actions/setup-chrome
|
|
103
130
|
id: setup-chrome
|
|
104
131
|
|
|
105
132
|
- name: Build
|
|
106
133
|
run: npm run build
|
|
107
134
|
|
|
108
|
-
- name: Run smoke tests
|
|
135
|
+
- name: Run smoke tests (Linux, via xvfb)
|
|
136
|
+
if: runner.os == 'Linux'
|
|
109
137
|
run: |
|
|
110
138
|
xvfb-run --auto-servernum --server-args="-screen 0 1280x720x24" \
|
|
111
139
|
npx vitest run tests/smoke/ --reporter=verbose
|
|
112
140
|
env:
|
|
113
141
|
OPENCLI_BROWSER_EXECUTABLE_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
|
|
142
|
+
|
|
143
|
+
- name: Run smoke tests (macOS / Windows)
|
|
144
|
+
if: runner.os != 'Linux'
|
|
145
|
+
run: npx vitest run tests/smoke/ --reporter=verbose
|
|
146
|
+
env:
|
|
147
|
+
OPENCLI_BROWSER_EXECUTABLE_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
|
|
114
148
|
timeout-minutes: 15
|
|
@@ -33,7 +33,13 @@ concurrency:
|
|
|
33
33
|
|
|
34
34
|
jobs:
|
|
35
35
|
e2e-headed:
|
|
36
|
-
runs-on:
|
|
36
|
+
runs-on: ${{ matrix.os }}
|
|
37
|
+
strategy:
|
|
38
|
+
fail-fast: false
|
|
39
|
+
matrix:
|
|
40
|
+
# NOTE: Windows excluded — browser-actions/setup-chrome hangs during
|
|
41
|
+
# Chrome MSI installation on Windows runners (known issue).
|
|
42
|
+
os: [ubuntu-latest, macos-latest]
|
|
37
43
|
timeout-minutes: 20
|
|
38
44
|
steps:
|
|
39
45
|
- uses: actions/checkout@v6
|
|
@@ -46,16 +52,23 @@ jobs:
|
|
|
46
52
|
- name: Install dependencies
|
|
47
53
|
run: npm ci
|
|
48
54
|
|
|
49
|
-
- name: Setup Chrome
|
|
55
|
+
- name: Setup Chrome
|
|
50
56
|
uses: ./.github/actions/setup-chrome
|
|
51
57
|
id: setup-chrome
|
|
52
58
|
|
|
53
59
|
- name: Build
|
|
54
60
|
run: npm run build
|
|
55
61
|
|
|
56
|
-
- name: Run E2E tests (
|
|
62
|
+
- name: Run E2E tests (Linux, via xvfb)
|
|
63
|
+
if: runner.os == 'Linux'
|
|
57
64
|
run: |
|
|
58
65
|
xvfb-run --auto-servernum --server-args="-screen 0 1280x720x24" \
|
|
59
66
|
npx vitest run tests/e2e/ --reporter=verbose
|
|
60
67
|
env:
|
|
61
68
|
OPENCLI_BROWSER_EXECUTABLE_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
|
|
69
|
+
|
|
70
|
+
- name: Run E2E tests (macOS / Windows)
|
|
71
|
+
if: runner.os != 'Linux'
|
|
72
|
+
run: npx vitest run tests/e2e/ --reporter=verbose
|
|
73
|
+
env:
|
|
74
|
+
OPENCLI_BROWSER_EXECUTABLE_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.4.1](https://github.com/jackwener/opencli/compare/v1.4.0...v1.4.1) (2026-03-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **douyin:** add Douyin creator center adapter — 14 commands, 8-phase publish pipeline ([#416](https://github.com/jackwener/opencli/issues/416))
|
|
9
|
+
* **weibo,youtube:** add Weibo commands and YouTube channel/comments ([#418](https://github.com/jackwener/opencli/issues/418))
|
|
10
|
+
* **twitter:** add filter option for search ([#410](https://github.com/jackwener/opencli/issues/410))
|
|
11
|
+
* **extension:** add popup UI, privacy policy, and CSP for Chrome Web Store ([#415](https://github.com/jackwener/opencli/issues/415))
|
|
12
|
+
* add url field to 9 search adapters (67% -> 97% coverage) ([#414](https://github.com/jackwener/opencli/issues/414))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **extension:** improve UX when daemon is not running — show hint in popup, reduce reconnect noise ([#424](https://github.com/jackwener/opencli/issues/424))
|
|
18
|
+
* remove incorrect gws and readwise external CLI entries ([#419](https://github.com/jackwener/opencli/issues/419), [#420](https://github.com/jackwener/opencli/issues/420))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### CI
|
|
22
|
+
|
|
23
|
+
* limit default e2e to bilibili/zhihu/v2ex, gate extended browser tests ([#421](https://github.com/jackwener/opencli/issues/421), [#423](https://github.com/jackwener/opencli/issues/423))
|
|
24
|
+
|
|
25
|
+
|
|
3
26
|
## [1.4.0](https://github.com/jackwener/opencli/compare/v1.3.3...v1.4.0) (2026-03-25)
|
|
4
27
|
|
|
5
28
|
|
package/PRIVACY.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Privacy Policy — OpenCLI Browser Extension
|
|
2
|
+
|
|
3
|
+
**Last updated**: 2026-03-25
|
|
4
|
+
|
|
5
|
+
## What the extension does
|
|
6
|
+
|
|
7
|
+
The OpenCLI Browser Extension is a bridge between the [OpenCLI](https://github.com/jackwener/opencli) command-line tool and your Chrome browser. It receives commands from a **locally running daemon** process via WebSocket (`localhost` only) and executes them in **isolated Chrome windows** that are separate from your normal browsing session.
|
|
8
|
+
|
|
9
|
+
## Data collection
|
|
10
|
+
|
|
11
|
+
The extension does **NOT** collect, store, transmit, or sell any personal data. Specifically:
|
|
12
|
+
|
|
13
|
+
- **No analytics or telemetry** — no data is sent to any remote server.
|
|
14
|
+
- **No user tracking** — no cookies, identifiers, or fingerprints are created.
|
|
15
|
+
- **No external network requests** — all communication is strictly `localhost` (WebSocket to `ws://localhost:19825`).
|
|
16
|
+
|
|
17
|
+
## Permissions explained
|
|
18
|
+
|
|
19
|
+
| Permission | Why it's needed |
|
|
20
|
+
|------------|----------------|
|
|
21
|
+
| `debugger` | Required to use Chrome DevTools Protocol (CDP) for browser automation — executing JavaScript, capturing page content, and taking screenshots in isolated windows. |
|
|
22
|
+
| `tabs` | Required to create and manage isolated automation windows and tabs, separate from the user's browsing session. |
|
|
23
|
+
| `cookies` | Required to read site-specific cookies (scoped by domain) so CLI commands can authenticate with websites the user is already logged into. Cookies are **never written, modified, or transmitted externally**. |
|
|
24
|
+
| `activeTab` | Required to identify the currently active tab for context-aware commands. |
|
|
25
|
+
| `alarms` | Required to maintain the WebSocket connection to the local daemon via periodic keepalive checks. |
|
|
26
|
+
|
|
27
|
+
## Data flow
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
User's terminal (opencli CLI)
|
|
31
|
+
↓ (spawns)
|
|
32
|
+
Local daemon process (localhost:19825)
|
|
33
|
+
↓ (WebSocket, localhost only)
|
|
34
|
+
Chrome Extension (this extension)
|
|
35
|
+
↓ (Chrome APIs)
|
|
36
|
+
Isolated Chrome automation window
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
All data stays on the user's machine. No data leaves `localhost`.
|
|
40
|
+
|
|
41
|
+
## Cookie access
|
|
42
|
+
|
|
43
|
+
The extension reads cookies **only** when explicitly requested by a CLI command, and **only** for the specific domain the command targets. It cannot and does not dump all cookies. Cookie data is returned to the local daemon process and is never sent to any external server.
|
|
44
|
+
|
|
45
|
+
## Third-party services
|
|
46
|
+
|
|
47
|
+
This extension does not integrate with, send data to, or receive data from any third-party service.
|
|
48
|
+
|
|
49
|
+
## Open source
|
|
50
|
+
|
|
51
|
+
This extension is fully open source. You can audit the complete source code at:
|
|
52
|
+
https://github.com/jackwener/opencli/tree/main/extension
|
|
53
|
+
|
|
54
|
+
## Contact
|
|
55
|
+
|
|
56
|
+
For privacy questions or concerns, please open an issue at:
|
|
57
|
+
https://github.com/jackwener/opencli/issues
|
package/README.md
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
> **Make any website, Electron App, or Local Tool your CLI.**
|
|
4
4
|
> Zero risk · Reuse Chrome login · AI-powered discovery · Universal CLI Hub
|
|
5
5
|
|
|
6
|
-
[中文文档](./README.zh-CN.md)
|
|
7
|
-
|
|
6
|
+
[](./README.zh-CN.md)
|
|
8
7
|
[](https://www.npmjs.com/package/@jackwener/opencli)
|
|
9
8
|
[](https://nodejs.org)
|
|
10
9
|
[](./LICENSE)
|
|
@@ -50,11 +49,31 @@ There are many great browser automation tools. Here's when opencli is the right
|
|
|
50
49
|
|
|
51
50
|
## Prerequisites
|
|
52
51
|
|
|
53
|
-
- **Node.js**: >= 20.0.0
|
|
52
|
+
- **Node.js**: >= 20.0.0 (or **Bun** >= 1.0 — see [Runtime Support](#runtime-support) below)
|
|
54
53
|
- **Chrome** running **and logged into the target site** (e.g. bilibili.com, zhihu.com, xiaohongshu.com).
|
|
55
54
|
|
|
56
55
|
> **⚠️ Important**: Browser commands reuse your Chrome login session. You must be logged into the target website in Chrome before running commands. If you get empty data or errors, check your login status first.
|
|
57
56
|
|
|
57
|
+
### Runtime Support
|
|
58
|
+
|
|
59
|
+
OpenCLI works with both **Node.js** (≥ 20) and **Bun** (≥ 1.0). All commands and adapters are runtime-agnostic.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Development with Bun (faster startup)
|
|
63
|
+
npm run dev:bun
|
|
64
|
+
|
|
65
|
+
# Run the built CLI with Bun
|
|
66
|
+
npm run start:bun
|
|
67
|
+
|
|
68
|
+
# Run unit tests under Bun
|
|
69
|
+
npm run test:bun
|
|
70
|
+
|
|
71
|
+
# Run E2E tests with Bun as the runtime
|
|
72
|
+
OPENCLI_TEST_RUNTIME=bun npm run test:e2e
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Use `opencli doctor` to check your current runtime — it displays the active engine (e.g. `node v22.13.0` or `bun 1.1.42`).
|
|
76
|
+
|
|
58
77
|
OpenCLI connects to your browser through a lightweight **Browser Bridge** Chrome Extension + micro-daemon (zero config, auto-start).
|
|
59
78
|
|
|
60
79
|
### Browser Bridge Extension Setup
|
|
@@ -132,7 +151,7 @@ Run `opencli list` for the live registry.
|
|
|
132
151
|
| **v2ex** | `hot` `latest` `topic` `node` `user` `member` `replies` `nodes` `daily` `me` `notifications` | Public / Browser |
|
|
133
152
|
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` `earnings-date` `fund-holdings` `fund-snapshot` | Browser |
|
|
134
153
|
| **antigravity** | `status` `send` `read` `new` `dump` `extract-code` `model` `watch` | Desktop |
|
|
135
|
-
| **chatgpt** | `status` `new` `send` `read` `ask` | Desktop |
|
|
154
|
+
| **chatgpt** | `status` `new` `send` `read` `ask` `model` | Desktop |
|
|
136
155
|
| **xiaohongshu** | `search` `notifications` `feed` `user` `download` `publish` `creator-notes` `creator-note-detail` `creator-notes-summary` `creator-profile` `creator-stats` | Browser |
|
|
137
156
|
| **apple-podcasts** | `search` `episodes` `top` | Public |
|
|
138
157
|
| **xiaoyuzhou** | `podcast` `podcast-episodes` `episode` | Public |
|
|
@@ -147,10 +166,11 @@ Run `opencli list` for the live registry.
|
|
|
147
166
|
| **devto** | `top` `tag` `user` | Public |
|
|
148
167
|
| **dictionary** | `search` `synonyms` `examples` | Public |
|
|
149
168
|
| **arxiv** | `search` `paper` | Public |
|
|
169
|
+
| **paperreview** | `submit` `review` `feedback` | Public |
|
|
150
170
|
| **wikipedia** | `search` `summary` `random` `trending` | Public |
|
|
151
171
|
| **hackernews** | `top` `new` `best` `ask` `show` `jobs` `search` `user` | Public |
|
|
152
172
|
| **jd** | `item` | Browser |
|
|
153
|
-
| **linkedin** | `search` | Browser |
|
|
173
|
+
| **linkedin** | `search` `timeline` | Browser |
|
|
154
174
|
| **reuters** | `search` | Browser |
|
|
155
175
|
| **smzdm** | `search` | Browser |
|
|
156
176
|
| **web** | `read` | Browser |
|
|
@@ -164,13 +184,16 @@ Run `opencli list` for the live registry.
|
|
|
164
184
|
| **jike** | `feed` `search` `create` `like` `comment` `repost` `notifications` `post` `topic` `user` | Browser |
|
|
165
185
|
| **jimeng** | `generate` `history` | Browser |
|
|
166
186
|
| **yollomi** | `generate` `video` `edit` `upload` `models` `remove-bg` `upscale` `face-swap` `restore` `try-on` `background` `object-remover` | Browser |
|
|
167
|
-
| **linux-do** | `
|
|
187
|
+
| **linux-do** | `feed` `categories` `tags` `search` `topic` `user-topics` `user-posts` | Browser |
|
|
168
188
|
| **stackoverflow** | `hot` `search` `bounties` `unanswered` | Public |
|
|
169
189
|
| **steam** | `top-sellers` | Public |
|
|
170
190
|
| **weread** | `shelf` `search` `book` `highlights` `notes` `notebooks` `ranking` | Browser |
|
|
171
|
-
| **douban** | `search` `top250` `subject` `marks` `reviews` `movie-hot` `book-hot` | Browser |
|
|
191
|
+
| **douban** | `search` `top250` `subject` `photos` `download` `marks` `reviews` `movie-hot` `book-hot` | Browser |
|
|
172
192
|
| **facebook** | `feed` `profile` `search` `friends` `groups` `events` `notifications` `memories` `add-friend` `join-group` | Browser |
|
|
173
193
|
| **google** | `news` `search` `suggest` `trends` | Public |
|
|
194
|
+
| **36kr** | `news` `hot` `search` `article` | Public / Browser |
|
|
195
|
+
| **imdb** | `search` `title` `top` `trending` `person` `reviews` | Public |
|
|
196
|
+
| **producthunt** | `posts` `today` `hot` `browse` | Public / Browser |
|
|
174
197
|
| **instagram** | `explore` `profile` `search` `user` `followers` `following` `follow` `unfollow` `like` `unlike` `comment` `save` `unsave` `saved` | Browser |
|
|
175
198
|
| **lobsters** | `hot` `newest` `active` `tag` | Public |
|
|
176
199
|
| **medium** | `feed` `search` `user` | Browser |
|
|
@@ -206,6 +229,8 @@ opencli register mycli
|
|
|
206
229
|
|
|
207
230
|
Each desktop adapter has its own detailed documentation with commands reference, setup guide, and examples:
|
|
208
231
|
|
|
232
|
+
If you want to add support for a new Electron desktop app, start with [docs/guide/electron-app-cli.md](./docs/guide/electron-app-cli.md) and the deeper [Electron guide](./docs/advanced/electron.md).
|
|
233
|
+
|
|
209
234
|
| App | Description | Doc |
|
|
210
235
|
|-----|-------------|-----|
|
|
211
236
|
| **Cursor** | Control Cursor IDE — Composer, chat, code extraction | [Doc](./docs/adapters/desktop/cursor.md) |
|
|
@@ -228,6 +253,7 @@ OpenCLI supports downloading images, videos, and articles from supported platfor
|
|
|
228
253
|
| **xiaohongshu** | Images, Videos | Downloads all media from a note |
|
|
229
254
|
| **bilibili** | Videos | Requires `yt-dlp` installed |
|
|
230
255
|
| **twitter** | Images, Videos | Downloads from user media tab or single tweet |
|
|
256
|
+
| **douban** | Images | Downloads poster / still image lists from movie subjects |
|
|
231
257
|
| **pixiv** | Images | Downloads original-quality illustrations, supports multi-page works |
|
|
232
258
|
| **zhihu** | Articles (Markdown) | Exports articles with optional image download |
|
|
233
259
|
| **weixin** | Articles (Markdown) | Exports WeChat Official Account articles |
|
|
@@ -259,6 +285,9 @@ opencli twitter download elonmusk --limit 20 --output ./twitter
|
|
|
259
285
|
# Download single tweet media
|
|
260
286
|
opencli twitter download --tweet-url "https://x.com/user/status/123" --output ./twitter
|
|
261
287
|
|
|
288
|
+
# Download Douban posters / stills
|
|
289
|
+
opencli douban download 30382501 --output ./douban
|
|
290
|
+
|
|
262
291
|
# Export Zhihu article to Markdown
|
|
263
292
|
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu
|
|
264
293
|
|
package/README.zh-CN.md
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
> **把任何网站、本地工具、Electron 应用变成能够让 AI 调用的命令行!**
|
|
4
4
|
> 零风控 · 复用 Chrome 登录 · AI 自动发现接口 · 全能 CLI 枢纽
|
|
5
5
|
|
|
6
|
-
[English](./README.md)
|
|
7
|
-
|
|
6
|
+
[](./README.md)
|
|
8
7
|
[](https://www.npmjs.com/package/@jackwener/opencli)
|
|
9
8
|
[](https://nodejs.org)
|
|
10
9
|
[](./LICENSE)
|
|
@@ -134,7 +133,7 @@ npm install -g @jackwener/opencli@latest
|
|
|
134
133
|
| **v2ex** | `hot` `latest` `topic` `node` `user` `member` `replies` `nodes` `daily` `me` `notifications` | 公开 / 浏览器 |
|
|
135
134
|
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` `earnings-date` `fund-holdings` `fund-snapshot` | 浏览器 |
|
|
136
135
|
| **antigravity** | `status` `send` `read` `new` `dump` `extract-code` `model` `watch` | 桌面端 |
|
|
137
|
-
| **chatgpt** | `status` `new` `send` `read` `ask` | 桌面端 |
|
|
136
|
+
| **chatgpt** | `status` `new` `send` `read` `ask` `model` | 桌面端 |
|
|
138
137
|
| **xiaohongshu** | `search` `notifications` `feed` `user` `download` `publish` `creator-notes` `creator-note-detail` `creator-notes-summary` `creator-profile` `creator-stats` | 浏览器 |
|
|
139
138
|
| **apple-podcasts** | `search` `episodes` `top` | 公开 |
|
|
140
139
|
| **xiaoyuzhou** | `podcast` `podcast-episodes` `episode` | 公开 |
|
|
@@ -149,10 +148,11 @@ npm install -g @jackwener/opencli@latest
|
|
|
149
148
|
| **devto** | `top` `tag` `user` | 公开 |
|
|
150
149
|
| **dictionary** | `search` `synonyms` `examples` | 公开 |
|
|
151
150
|
| **arxiv** | `search` `paper` | 公开 |
|
|
151
|
+
| **paperreview** | `submit` `review` `feedback` | 公开 |
|
|
152
152
|
| **wikipedia** | `search` `summary` `random` `trending` | 公开 |
|
|
153
153
|
| **hackernews** | `top` `new` `best` `ask` `show` `jobs` `search` `user` | 公共 API |
|
|
154
154
|
| **jd** | `item` | 浏览器 |
|
|
155
|
-
| **linkedin** | `search` | 浏览器 |
|
|
155
|
+
| **linkedin** | `search` `timeline` | 浏览器 |
|
|
156
156
|
| **reuters** | `search` | 浏览器 |
|
|
157
157
|
| **smzdm** | `search` | 浏览器 |
|
|
158
158
|
| **web** | `read` | 浏览器 |
|
|
@@ -166,13 +166,16 @@ npm install -g @jackwener/opencli@latest
|
|
|
166
166
|
| **jike** | `feed` `search` `create` `like` `comment` `repost` `notifications` `post` `topic` `user` | 浏览器 |
|
|
167
167
|
| **jimeng** | `generate` `history` | 浏览器 |
|
|
168
168
|
| **yollomi** | `generate` `video` `edit` `upload` `models` `remove-bg` `upscale` `face-swap` `restore` `try-on` `background` `object-remover` | 浏览器 |
|
|
169
|
-
| **linux-do** | `
|
|
169
|
+
| **linux-do** | `feed` `categories` `tags` `search` `topic` `user-topics` `user-posts` | 浏览器 |
|
|
170
170
|
| **stackoverflow** | `hot` `search` `bounties` `unanswered` | 公开 |
|
|
171
171
|
| **steam** | `top-sellers` | 公开 |
|
|
172
172
|
| **weread** | `shelf` `search` `book` `highlights` `notes` `notebooks` `ranking` | 浏览器 |
|
|
173
|
-
| **douban** | `search` `top250` `subject` `marks` `reviews` `movie-hot` `book-hot` | 浏览器 |
|
|
173
|
+
| **douban** | `search` `top250` `subject` `photos` `download` `marks` `reviews` `movie-hot` `book-hot` | 浏览器 |
|
|
174
174
|
| **facebook** | `feed` `profile` `search` `friends` `groups` `events` `notifications` `memories` `add-friend` `join-group` | 浏览器 |
|
|
175
175
|
| **google** | `news` `search` `suggest` `trends` | 公开 |
|
|
176
|
+
| **36kr** | `news` `hot` `search` `article` | 公开 / 浏览器 |
|
|
177
|
+
| **imdb** | `search` `title` `top` `trending` `person` `reviews` | 公开 |
|
|
178
|
+
| **producthunt** | `posts` `today` `hot` `browse` | 公开 / 浏览器 |
|
|
176
179
|
| **instagram** | `explore` `profile` `search` `user` `followers` `following` `follow` `unfollow` `like` `unlike` `comment` `save` `unsave` `saved` | 浏览器 |
|
|
177
180
|
| **lobsters** | `hot` `newest` `active` `tag` | 公开 |
|
|
178
181
|
| **medium** | `feed` `search` `user` | 浏览器 |
|
|
@@ -233,6 +236,7 @@ OpenCLI 支持从各平台下载图片、视频和文章。
|
|
|
233
236
|
| **Pixiv** | 图片 | 下载原始画质插画,支持多页作品 |
|
|
234
237
|
| **知乎** | 文章(Markdown) | 导出文章,可选下载图片到本地 |
|
|
235
238
|
| **微信公众号** | 文章(Markdown) | 导出微信公众号文章为 Markdown |
|
|
239
|
+
| **豆瓣** | 图片 | 下载电影条目的海报 / 剧照图片 |
|
|
236
240
|
|
|
237
241
|
### 前置依赖
|
|
238
242
|
|
|
@@ -261,6 +265,9 @@ opencli twitter download elonmusk --limit 20 --output ./twitter
|
|
|
261
265
|
# 下载单条推文的媒体
|
|
262
266
|
opencli twitter download --tweet-url "https://x.com/user/status/123" --output ./twitter
|
|
263
267
|
|
|
268
|
+
# 下载豆瓣电影海报 / 剧照
|
|
269
|
+
opencli douban download 30382501 --output ./douban
|
|
270
|
+
|
|
264
271
|
# 导出知乎文章为 Markdown
|
|
265
272
|
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu
|
|
266
273
|
|
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.
|
|
4
|
+
version: 1.4.1
|
|
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
|
---
|
|
@@ -88,6 +88,9 @@ opencli xueqiu watchlist # 获取自选股/持仓列表
|
|
|
88
88
|
opencli xueqiu feed # 我的关注 timeline
|
|
89
89
|
opencli xueqiu hot --limit 10 # 雪球热榜
|
|
90
90
|
opencli xueqiu search "特斯拉" # 搜索 (query positional)
|
|
91
|
+
opencli xueqiu earnings-date SH600519 # 股票财报发布日期 (symbol positional)
|
|
92
|
+
opencli xueqiu fund-holdings # 蛋卷基金持仓明细 (支持 --account 过滤)
|
|
93
|
+
opencli xueqiu fund-snapshot # 蛋卷基金快照(总资产、子账户、持仓)
|
|
91
94
|
|
|
92
95
|
# GitHub (via gh External CLI)
|
|
93
96
|
opencli gh repo list # 列出仓库 (passthrough to gh)
|
|
@@ -106,6 +109,19 @@ opencli twitter follow elonmusk # 关注用户
|
|
|
106
109
|
opencli twitter unfollow elonmusk # 取消关注
|
|
107
110
|
opencli twitter bookmark https://x.com/... # 收藏推文
|
|
108
111
|
opencli twitter unbookmark https://x.com/... # 取消收藏
|
|
112
|
+
opencli twitter post "Hello world" # 发布推文 (text positional)
|
|
113
|
+
opencli twitter like https://x.com/... # 点赞推文 (url positional)
|
|
114
|
+
opencli twitter reply https://x.com/... "Nice!" # 回复推文 (url + text positional)
|
|
115
|
+
opencli twitter delete https://x.com/... # 删除推文 (url positional)
|
|
116
|
+
opencli twitter block elonmusk # 屏蔽用户 (username positional)
|
|
117
|
+
opencli twitter unblock elonmusk # 取消屏蔽 (username positional)
|
|
118
|
+
opencli twitter followers elonmusk # 用户的粉丝列表 (user positional)
|
|
119
|
+
opencli twitter following elonmusk # 用户的关注列表 (user positional)
|
|
120
|
+
opencli twitter notifications --limit 20 # 通知列表
|
|
121
|
+
opencli twitter hide-reply https://x.com/... # 隐藏回复 (url positional)
|
|
122
|
+
opencli twitter download elonmusk # 下载用户媒体 (username positional, 支持 --tweet-url)
|
|
123
|
+
opencli twitter accept "群,微信" # 自动接受含关键词的 DM 请求 (query positional)
|
|
124
|
+
opencli twitter reply-dm "消息内容" # 批量回复 DM (text positional)
|
|
109
125
|
|
|
110
126
|
# Reddit (browser)
|
|
111
127
|
opencli reddit hot --limit 10 # 热门帖子
|
|
@@ -132,9 +148,21 @@ opencli v2ex topic 1024 # 主题详情 (id positional)
|
|
|
132
148
|
opencli v2ex daily # 每日签到 (browser)
|
|
133
149
|
opencli v2ex me # 我的信息 (browser)
|
|
134
150
|
opencli v2ex notifications --limit 10 # 通知 (browser)
|
|
151
|
+
opencli v2ex node python # 节点话题列表 (name positional)
|
|
152
|
+
opencli v2ex nodes --limit 30 # 所有节点列表
|
|
153
|
+
opencli v2ex member username # 用户资料 (username positional)
|
|
154
|
+
opencli v2ex user username # 用户发帖列表 (username positional)
|
|
155
|
+
opencli v2ex replies 1024 # 主题回复列表 (id positional)
|
|
135
156
|
|
|
136
157
|
# Hacker News (public)
|
|
137
158
|
opencli hackernews top --limit 10 # Top stories
|
|
159
|
+
opencli hackernews new --limit 10 # Newest stories
|
|
160
|
+
opencli hackernews best --limit 10 # Best stories
|
|
161
|
+
opencli hackernews ask --limit 10 # Ask HN posts
|
|
162
|
+
opencli hackernews show --limit 10 # Show HN posts
|
|
163
|
+
opencli hackernews jobs --limit 10 # Job postings
|
|
164
|
+
opencli hackernews search "rust" # 搜索 (query positional)
|
|
165
|
+
opencli hackernews user dang # 用户资料 (username positional)
|
|
138
166
|
|
|
139
167
|
# BBC (public)
|
|
140
168
|
opencli bbc news --limit 10 # BBC News RSS headlines
|
|
@@ -204,11 +232,13 @@ opencli jike comment xxx "评论" # 评论 (id + text positional)
|
|
|
204
232
|
opencli jike repost xxx # 转发 (id positional)
|
|
205
233
|
opencli jike notifications # 通知
|
|
206
234
|
|
|
207
|
-
# Linux.do (public)
|
|
235
|
+
# Linux.do (public + browser)
|
|
208
236
|
opencli linux-do hot --limit 10 # 热门话题
|
|
209
237
|
opencli linux-do latest --limit 10 # 最新话题
|
|
210
238
|
opencli linux-do search "rust" # 搜索 (query positional)
|
|
211
239
|
opencli linux-do topic 1024 # 主题详情 (id positional)
|
|
240
|
+
opencli linux-do categories --limit 20 # 分类列表 (browser)
|
|
241
|
+
opencli linux-do category dev 7 # 分类内话题 (slug + id positional, browser)
|
|
212
242
|
|
|
213
243
|
# StackOverflow (public)
|
|
214
244
|
opencli stackoverflow hot --limit 10 # 热门问题
|
|
@@ -234,6 +264,12 @@ opencli yollomi video "提示词" --model kling-2-1 # 视频
|
|
|
234
264
|
opencli yollomi upload ./photo.jpg # 上传得 URL,供 img2img / 工具链使用
|
|
235
265
|
opencli yollomi remove-bg <image-url> # 去背景(免费)
|
|
236
266
|
opencli yollomi edit <image-url> "改成油画风格" # Qwen 图像编辑
|
|
267
|
+
opencli yollomi background <image-url> # AI 背景生成 (5 credits)
|
|
268
|
+
opencli yollomi face-swap --source <url> --target <url> # 换脸 (3 credits)
|
|
269
|
+
opencli yollomi object-remover <image-url> <mask-url> # AI 去除物体 (3 credits)
|
|
270
|
+
opencli yollomi restore <image-url> # AI 修复老照片 (4 credits)
|
|
271
|
+
opencli yollomi try-on --person <url> --cloth <url> # 虚拟试衣 (3 credits)
|
|
272
|
+
opencli yollomi upscale <image-url> # AI 超分辨率 (1 credit, 支持 --scale 2/4)
|
|
237
273
|
|
|
238
274
|
# Grok (default + explicit web)
|
|
239
275
|
opencli grok ask --prompt "问题" # 提问 Grok(兼容默认路径)
|
|
@@ -250,6 +286,8 @@ opencli chaoxing exams # 考试列表
|
|
|
250
286
|
opencli douban search "三体" # 搜索 (query positional)
|
|
251
287
|
opencli douban top250 # 豆瓣 Top 250
|
|
252
288
|
opencli douban subject 1234567 # 条目详情 (id positional)
|
|
289
|
+
opencli douban photos 30382501 # 图片列表 / 直链(默认海报)
|
|
290
|
+
opencli douban download 30382501 # 下载海报 / 剧照
|
|
253
291
|
opencli douban marks --limit 10 # 我的标记
|
|
254
292
|
opencli douban reviews --limit 10 # 短评
|
|
255
293
|
|
|
@@ -334,6 +372,69 @@ opencli devto user username # 用户文章 (username positional)
|
|
|
334
372
|
# Steam (public)
|
|
335
373
|
opencli steam top-sellers --limit 10 # 热销游戏
|
|
336
374
|
|
|
375
|
+
# Apple Podcasts (public)
|
|
376
|
+
opencli apple-podcasts top --limit 10 # 热门播客排行榜 (支持 --country us/cn/gb/jp)
|
|
377
|
+
opencli apple-podcasts search "科技" # 搜索播客 (query positional)
|
|
378
|
+
opencli apple-podcasts episodes 12345 # 播客剧集列表 (id positional, 用 search 获取 ID)
|
|
379
|
+
|
|
380
|
+
# arXiv (public)
|
|
381
|
+
opencli arxiv search "attention" # 搜索论文 (query positional)
|
|
382
|
+
opencli arxiv paper 1706.03762 # 论文详情 (id positional)
|
|
383
|
+
|
|
384
|
+
# Bloomberg (public RSS + browser)
|
|
385
|
+
opencli bloomberg main --limit 10 # Bloomberg 首页头条 (RSS)
|
|
386
|
+
opencli bloomberg markets --limit 10 # 市场新闻 (RSS)
|
|
387
|
+
opencli bloomberg tech --limit 10 # 科技新闻 (RSS)
|
|
388
|
+
opencli bloomberg politics --limit 10 # 政治新闻 (RSS)
|
|
389
|
+
opencli bloomberg economics --limit 10 # 经济新闻 (RSS)
|
|
390
|
+
opencli bloomberg opinions --limit 10 # 观点 (RSS)
|
|
391
|
+
opencli bloomberg industries --limit 10 # 行业新闻 (RSS)
|
|
392
|
+
opencli bloomberg businessweek --limit 10 # Businessweek (RSS)
|
|
393
|
+
opencli bloomberg feeds # 列出所有 RSS feed 别名
|
|
394
|
+
opencli bloomberg news "https://..." # 阅读 Bloomberg 文章全文 (link positional, browser)
|
|
395
|
+
|
|
396
|
+
# Coupang 쿠팡 (browser)
|
|
397
|
+
opencli coupang search "耳机" # 搜索商品 (query positional, 支持 --filter rocket)
|
|
398
|
+
opencli coupang add-to-cart 12345 # 加入购物车 (product-id positional, 或 --url)
|
|
399
|
+
|
|
400
|
+
# Dictionary (public)
|
|
401
|
+
opencli dictionary search "serendipity" # 单词释义 (word positional)
|
|
402
|
+
opencli dictionary synonyms "happy" # 近义词 (word positional)
|
|
403
|
+
opencli dictionary examples "ubiquitous" # 例句 (word positional)
|
|
404
|
+
|
|
405
|
+
# 豆包 Doubao Web (browser)
|
|
406
|
+
opencli doubao status # 检查豆包页面状态
|
|
407
|
+
opencli doubao new # 新建对话
|
|
408
|
+
opencli doubao send "你好" # 发送消息 (text positional)
|
|
409
|
+
opencli doubao read # 读取对话记录
|
|
410
|
+
opencli doubao ask "问题" # 一键提问并等回复 (text positional)
|
|
411
|
+
|
|
412
|
+
# 京东 JD (browser)
|
|
413
|
+
opencli jd item 100291143898 # 商品详情 (sku positional, 含价格/主图/规格)
|
|
414
|
+
|
|
415
|
+
# LinkedIn (browser)
|
|
416
|
+
opencli linkedin search "AI engineer" # 搜索职位 (query positional, 支持 --location/--company/--remote)
|
|
417
|
+
opencli linkedin timeline --limit 20 # 首页动态流
|
|
418
|
+
|
|
419
|
+
# Pixiv (browser)
|
|
420
|
+
opencli pixiv ranking --limit 20 # 插画排行榜 (支持 --mode daily/weekly/monthly)
|
|
421
|
+
opencli pixiv search "風景" # 搜索插画 (query positional)
|
|
422
|
+
opencli pixiv user 12345 # 画师资料 (uid positional)
|
|
423
|
+
opencli pixiv illusts 12345 # 画师作品列表 (user-id positional)
|
|
424
|
+
opencli pixiv detail 12345 # 插画详情 (id positional)
|
|
425
|
+
opencli pixiv download 12345 # 下载插画 (illust-id positional)
|
|
426
|
+
|
|
427
|
+
# Web (browser)
|
|
428
|
+
opencli web read --url "https://..." # 抓取任意网页并导出为 Markdown
|
|
429
|
+
|
|
430
|
+
# 微信公众号 Weixin (browser)
|
|
431
|
+
opencli weixin download --url "https://mp.weixin.qq.com/s/xxx" # 下载公众号文章为 Markdown
|
|
432
|
+
|
|
433
|
+
# 小宇宙 Xiaoyuzhou (public)
|
|
434
|
+
opencli xiaoyuzhou podcast 12345 # 播客资料 (id positional)
|
|
435
|
+
opencli xiaoyuzhou podcast-episodes 12345 # 播客剧集列表 (id positional)
|
|
436
|
+
opencli xiaoyuzhou episode 12345 # 单集详情 (id positional)
|
|
437
|
+
|
|
337
438
|
# Wikipedia (public)
|
|
338
439
|
opencli wikipedia search "AI" # 搜索 (query positional)
|
|
339
440
|
opencli wikipedia summary "Python" # 摘要 (title positional)
|
package/dist/browser/cdp.d.ts
CHANGED
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
* - Shared DOM helper methods extracted to reduce duplication with Page (P1 #5)
|
|
9
9
|
*/
|
|
10
10
|
import type { IPage } from '../types.js';
|
|
11
|
+
import type { IBrowserFactory } from '../runtime.js';
|
|
11
12
|
export interface CDPTarget {
|
|
12
13
|
type?: string;
|
|
13
14
|
url?: string;
|
|
14
15
|
title?: string;
|
|
15
16
|
webSocketDebuggerUrl?: string;
|
|
16
17
|
}
|
|
17
|
-
export declare class CDPBridge {
|
|
18
|
+
export declare class CDPBridge implements IBrowserFactory {
|
|
18
19
|
private _ws;
|
|
19
20
|
private _idCounter;
|
|
20
21
|
private _pending;
|
|
@@ -9,7 +9,10 @@ export { isDaemonRunning };
|
|
|
9
9
|
/**
|
|
10
10
|
* Check daemon status and return connection info.
|
|
11
11
|
*/
|
|
12
|
-
export declare function checkDaemonStatus(
|
|
12
|
+
export declare function checkDaemonStatus(opts?: {
|
|
13
|
+
timeout?: number;
|
|
14
|
+
}): Promise<{
|
|
13
15
|
running: boolean;
|
|
14
16
|
extensionConnected: boolean;
|
|
17
|
+
extensionVersion?: string;
|
|
15
18
|
}>;
|
package/dist/browser/discover.js
CHANGED
|
@@ -10,14 +10,18 @@ export { isDaemonRunning };
|
|
|
10
10
|
/**
|
|
11
11
|
* Check daemon status and return connection info.
|
|
12
12
|
*/
|
|
13
|
-
export async function checkDaemonStatus() {
|
|
13
|
+
export async function checkDaemonStatus(opts) {
|
|
14
14
|
try {
|
|
15
15
|
const port = parseInt(process.env.OPENCLI_DAEMON_PORT ?? String(DEFAULT_DAEMON_PORT), 10);
|
|
16
|
+
const controller = new AbortController();
|
|
17
|
+
const timer = setTimeout(() => controller.abort(), opts?.timeout ?? 2000);
|
|
16
18
|
const res = await fetch(`http://127.0.0.1:${port}/status`, {
|
|
17
19
|
headers: { 'X-OpenCLI': '1' },
|
|
20
|
+
signal: controller.signal,
|
|
18
21
|
});
|
|
19
22
|
const data = await res.json();
|
|
20
|
-
|
|
23
|
+
clearTimeout(timer);
|
|
24
|
+
return { running: true, extensionConnected: data.extensionConnected, extensionVersion: data.extensionVersion };
|
|
21
25
|
}
|
|
22
26
|
catch {
|
|
23
27
|
return { running: false, extensionConnected: false };
|
package/dist/browser/errors.d.ts
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* Simplified — no more token/extension/CDP classification.
|
|
5
5
|
* The daemon architecture has a single failure mode: daemon not reachable or extension not connected.
|
|
6
6
|
*/
|
|
7
|
-
import { BrowserConnectError } from '../errors.js';
|
|
8
|
-
export type ConnectFailureKind =
|
|
7
|
+
import { BrowserConnectError, type BrowserConnectKind } from '../errors.js';
|
|
8
|
+
export type ConnectFailureKind = BrowserConnectKind;
|
|
9
9
|
export declare function formatBrowserConnectError(kind: ConnectFailureKind, detail?: string): BrowserConnectError;
|