@jackwener/opencli 1.1.1 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build-extension.yml +3 -3
- package/.github/workflows/ci.yml +6 -6
- package/.github/workflows/doc-check.yml +3 -3
- package/.github/workflows/e2e-headed.yml +2 -2
- package/.github/workflows/pkg-pr-new.yml +2 -2
- package/.github/workflows/release.yml +3 -3
- package/.github/workflows/security.yml +2 -2
- package/CONTRIBUTING.md +39 -1
- package/README.md +13 -10
- package/README.zh-CN.md +43 -17
- package/SKILL.md +10 -5
- package/dist/browser/cdp.d.ts +4 -4
- package/dist/browser/cdp.js +39 -16
- package/dist/browser/daemon-client.d.ts +4 -2
- package/dist/browser/daemon-client.js +17 -4
- package/dist/browser/dom-helpers.js +38 -7
- package/dist/browser/dom-snapshot.d.ts +86 -0
- package/dist/browser/dom-snapshot.js +729 -0
- package/dist/browser/dom-snapshot.test.d.ts +11 -0
- package/dist/browser/dom-snapshot.test.js +212 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.js +1 -0
- package/dist/browser/mcp.js +3 -1
- package/dist/browser/page.d.ts +14 -24
- package/dist/browser/page.js +46 -6
- package/dist/build-manifest.d.ts +11 -4
- package/dist/build-manifest.js +59 -21
- package/dist/build-manifest.test.js +58 -2
- package/dist/cli-manifest.json +3856 -1509
- package/dist/cli.js +66 -0
- package/dist/clis/barchart/greeks.js +1 -1
- package/dist/clis/barchart/options.js +1 -1
- package/dist/clis/barchart/quote.js +1 -1
- package/dist/clis/bilibili/download.js +1 -1
- package/dist/clis/bilibili/following.js +1 -1
- package/dist/clis/bilibili/subtitle.js +1 -1
- package/dist/clis/bilibili/user-videos.js +1 -1
- package/dist/clis/boss/batchgreet.js +10 -97
- package/dist/clis/boss/chatlist.js +8 -25
- package/dist/clis/boss/chatmsg.js +11 -42
- package/dist/clis/boss/common.d.ts +92 -0
- package/dist/clis/boss/common.js +223 -0
- package/dist/clis/boss/detail.js +7 -49
- package/dist/clis/boss/exchange.js +13 -79
- package/dist/clis/boss/greet.js +18 -145
- package/dist/clis/boss/invite.js +26 -121
- package/dist/clis/boss/joblist.js +6 -31
- package/dist/clis/boss/mark.js +12 -85
- package/dist/clis/boss/recommend.js +10 -49
- package/dist/clis/boss/resume.js +18 -118
- package/dist/clis/boss/search.js +12 -60
- package/dist/clis/boss/send.js +17 -151
- package/dist/clis/boss/stats.js +18 -69
- package/dist/clis/coupang/add-to-cart.js +1 -1
- package/dist/clis/devto/tag.yaml +34 -0
- package/dist/clis/devto/top.yaml +29 -0
- package/dist/clis/devto/user.yaml +33 -0
- package/dist/clis/douban/book-hot.d.ts +1 -0
- package/dist/clis/douban/book-hot.js +14 -0
- package/dist/clis/douban/marks.d.ts +1 -0
- package/dist/clis/douban/marks.js +115 -0
- package/dist/clis/douban/movie-hot.d.ts +1 -0
- package/dist/clis/douban/movie-hot.js +14 -0
- package/dist/clis/douban/reviews.d.ts +1 -0
- package/dist/clis/douban/reviews.js +106 -0
- package/dist/clis/douban/search.d.ts +1 -0
- package/dist/clis/douban/search.js +16 -0
- package/dist/clis/douban/shared.d.ts +4 -0
- package/dist/clis/douban/shared.js +155 -0
- package/dist/clis/douban/subject.yaml +76 -0
- package/dist/clis/douban/top250.yaml +70 -0
- package/dist/clis/douban/utils.d.ts +35 -0
- package/dist/clis/douban/utils.js +48 -0
- package/dist/clis/facebook/add-friend.yaml +43 -0
- package/dist/clis/facebook/events.yaml +44 -0
- package/dist/clis/facebook/feed.yaml +63 -0
- package/dist/clis/facebook/friends.yaml +42 -0
- package/dist/clis/facebook/groups.yaml +50 -0
- package/dist/clis/facebook/join-group.yaml +44 -0
- package/dist/clis/facebook/memories.yaml +39 -0
- package/dist/clis/facebook/notifications.yaml +40 -0
- package/dist/clis/facebook/profile.yaml +37 -0
- package/dist/clis/facebook/search.yaml +46 -0
- package/dist/clis/google/news.d.ts +5 -0
- package/dist/clis/google/news.js +58 -0
- package/dist/clis/google/search.d.ts +10 -0
- package/dist/clis/google/search.js +127 -0
- package/dist/clis/google/suggest.d.ts +5 -0
- package/dist/clis/google/suggest.js +34 -0
- package/dist/clis/google/trends.d.ts +5 -0
- package/dist/clis/google/trends.js +38 -0
- package/dist/clis/google/utils.d.ts +9 -0
- package/dist/clis/google/utils.js +23 -0
- package/dist/clis/google/utils.test.d.ts +1 -0
- package/dist/clis/google/utils.test.js +75 -0
- package/dist/clis/grok/ask.d.ts +14 -0
- package/dist/clis/grok/ask.js +257 -65
- package/dist/clis/grok/ask.test.d.ts +1 -0
- package/dist/clis/grok/ask.test.js +36 -0
- package/dist/clis/instagram/comment.yaml +52 -0
- package/dist/clis/instagram/explore.yaml +43 -0
- package/dist/clis/instagram/follow.yaml +41 -0
- package/dist/clis/instagram/followers.yaml +51 -0
- package/dist/clis/instagram/following.yaml +51 -0
- package/dist/clis/instagram/like.yaml +46 -0
- package/dist/clis/instagram/profile.yaml +42 -0
- package/dist/clis/instagram/save.yaml +46 -0
- package/dist/clis/instagram/saved.yaml +40 -0
- package/dist/clis/instagram/search.yaml +43 -0
- package/dist/clis/instagram/unfollow.yaml +38 -0
- package/dist/clis/instagram/unlike.yaml +46 -0
- package/dist/clis/instagram/unsave.yaml +46 -0
- package/dist/clis/instagram/user.yaml +54 -0
- package/dist/clis/jike/repost.js +1 -1
- package/dist/clis/jimeng/generate.yaml +1 -0
- package/dist/clis/linux-do/category.yaml +1 -0
- package/dist/clis/lobsters/active.yaml +29 -0
- package/dist/clis/lobsters/hot.yaml +29 -0
- package/dist/clis/lobsters/newest.yaml +29 -0
- package/dist/clis/lobsters/tag.yaml +34 -0
- package/dist/clis/medium/feed.d.ts +1 -0
- package/dist/clis/medium/feed.js +15 -0
- package/dist/clis/medium/search.d.ts +1 -0
- package/dist/clis/medium/search.js +15 -0
- package/dist/clis/medium/shared.d.ts +5 -0
- package/dist/clis/medium/shared.js +78 -0
- package/dist/clis/medium/user.d.ts +1 -0
- package/dist/clis/medium/user.js +15 -0
- package/dist/clis/reddit/comment.js +1 -1
- package/dist/clis/reddit/read.js +1 -1
- package/dist/clis/reddit/save.js +1 -1
- package/dist/clis/reddit/subreddit.yaml +1 -0
- package/dist/clis/reddit/subscribe.js +1 -1
- package/dist/clis/reddit/upvote.js +1 -1
- package/dist/clis/sinablog/article.d.ts +1 -0
- package/dist/clis/sinablog/article.js +14 -0
- package/dist/clis/sinablog/hot.d.ts +1 -0
- package/dist/clis/sinablog/hot.js +14 -0
- package/dist/clis/sinablog/search.d.ts +1 -0
- package/dist/clis/sinablog/search.js +51 -0
- package/dist/clis/sinablog/shared.d.ts +7 -0
- package/dist/clis/sinablog/shared.js +187 -0
- package/dist/clis/sinablog/user.d.ts +1 -0
- package/dist/clis/sinablog/user.js +15 -0
- package/dist/clis/substack/feed.d.ts +1 -0
- package/dist/clis/substack/feed.js +15 -0
- package/dist/clis/substack/publication.d.ts +1 -0
- package/dist/clis/substack/publication.js +15 -0
- package/dist/clis/substack/search.d.ts +1 -0
- package/dist/clis/substack/search.js +77 -0
- package/dist/clis/substack/shared.d.ts +4 -0
- package/dist/clis/substack/shared.js +129 -0
- package/dist/clis/tiktok/comment.yaml +66 -0
- package/dist/clis/tiktok/explore.yaml +39 -0
- package/dist/clis/tiktok/follow.yaml +39 -0
- package/dist/clis/tiktok/following.yaml +46 -0
- package/dist/clis/tiktok/friends.yaml +47 -0
- package/dist/clis/tiktok/like.yaml +38 -0
- package/dist/clis/tiktok/live.yaml +51 -0
- package/dist/clis/tiktok/notifications.yaml +52 -0
- package/dist/clis/tiktok/profile.yaml +45 -0
- package/dist/clis/tiktok/save.yaml +34 -0
- package/dist/clis/tiktok/search.yaml +46 -0
- package/dist/clis/tiktok/unfollow.yaml +44 -0
- package/dist/clis/tiktok/unlike.yaml +38 -0
- package/dist/clis/tiktok/unsave.yaml +36 -0
- package/dist/clis/tiktok/user.yaml +44 -0
- package/dist/clis/twitter/download.d.ts +1 -1
- package/dist/clis/twitter/download.js +3 -3
- package/dist/clis/twitter/followers.js +1 -1
- package/dist/clis/twitter/following.js +1 -1
- package/dist/clis/twitter/thread.js +1 -1
- package/dist/clis/twitter/timeline.d.ts +23 -0
- package/dist/clis/twitter/timeline.js +42 -14
- package/dist/clis/twitter/timeline.test.d.ts +1 -0
- package/dist/clis/twitter/timeline.test.js +102 -0
- package/dist/clis/wikipedia/random.d.ts +1 -0
- package/dist/clis/wikipedia/random.js +19 -0
- package/dist/clis/wikipedia/search.js +3 -3
- package/dist/clis/wikipedia/summary.js +4 -9
- package/dist/clis/wikipedia/trending.d.ts +1 -0
- package/dist/clis/wikipedia/trending.js +35 -0
- package/dist/clis/wikipedia/utils.d.ts +28 -0
- package/dist/clis/wikipedia/utils.js +13 -0
- package/dist/clis/xiaohongshu/creator-note-detail.js +1 -1
- package/dist/clis/xiaohongshu/creator-note-detail.test.js +2 -0
- package/dist/clis/xiaohongshu/creator-notes.test.js +2 -0
- package/dist/clis/xiaohongshu/download.js +1 -1
- package/dist/clis/xueqiu/earnings-date.yaml +69 -0
- package/dist/clis/xueqiu/search.yaml +2 -1
- package/dist/clis/xueqiu/stock.yaml +2 -0
- package/dist/clis/yahoo-finance/quote.js +1 -1
- package/dist/commanderAdapter.js +13 -7
- package/dist/daemon.js +21 -0
- package/dist/discovery.d.ts +8 -0
- package/dist/discovery.js +105 -19
- package/dist/doctor.js +3 -1
- package/dist/doctor.test.js +46 -2
- package/dist/engine.test.d.ts +0 -3
- package/dist/engine.test.js +74 -6
- package/dist/execution.d.ts +4 -2
- package/dist/execution.js +31 -7
- package/dist/explore.d.ts +76 -3
- package/dist/explore.js +11 -4
- package/dist/generate.d.ts +41 -2
- package/dist/generate.js +5 -4
- package/dist/main.js +2 -1
- package/dist/pipeline/executor.d.ts +4 -2
- package/dist/pipeline/executor.js +54 -15
- package/dist/pipeline/executor.test.js +33 -6
- package/dist/pipeline/registry.d.ts +1 -1
- package/dist/pipeline/steps/browser.d.ts +7 -7
- package/dist/pipeline/steps/browser.js +15 -7
- package/dist/pipeline/steps/fetch.d.ts +1 -1
- package/dist/pipeline/steps/fetch.js +11 -7
- package/dist/pipeline/steps/transform.d.ts +6 -5
- package/dist/pipeline/steps/transform.js +30 -9
- package/dist/pipeline/template.d.ts +6 -6
- package/dist/pipeline/template.js +43 -5
- package/dist/pipeline/template.test.js +18 -0
- package/dist/pipeline/transform.test.js +11 -0
- package/dist/plugin.d.ts +31 -0
- package/dist/plugin.js +216 -0
- package/dist/plugin.test.d.ts +4 -0
- package/dist/plugin.test.js +76 -0
- package/dist/registry-api.d.ts +11 -0
- package/dist/registry-api.js +9 -0
- package/dist/registry.d.ts +11 -0
- package/dist/registry.js +6 -1
- package/dist/synthesize.d.ts +94 -4
- package/dist/synthesize.js +5 -4
- package/dist/types.d.ts +39 -26
- package/dist/validate.js +8 -2
- package/docs/.vitepress/config.mts +6 -4
- package/docs/adapters/browser/barchart.md +6 -5
- package/docs/adapters/browser/bilibili.md +9 -0
- package/docs/adapters/browser/devto.md +35 -0
- package/docs/adapters/browser/douban.md +38 -0
- package/docs/adapters/browser/facebook.md +36 -0
- package/docs/adapters/browser/google.md +62 -0
- package/docs/adapters/browser/grok.md +26 -8
- package/docs/adapters/browser/instagram.md +46 -0
- package/docs/adapters/browser/lobsters.md +32 -0
- package/docs/adapters/browser/medium.md +32 -0
- package/docs/adapters/browser/reddit.md +9 -0
- package/docs/adapters/browser/sinablog.md +36 -0
- package/docs/adapters/browser/substack.md +38 -0
- package/docs/adapters/browser/tiktok.md +68 -0
- package/docs/adapters/browser/wikipedia.md +11 -2
- package/docs/adapters/browser/xueqiu.md +10 -0
- package/docs/adapters/browser/yahoo-finance.md +6 -5
- package/docs/adapters/desktop/antigravity.md +6 -0
- package/docs/adapters/desktop/chatgpt.md +2 -1
- package/docs/adapters/desktop/codex.md +5 -1
- package/docs/adapters/desktop/cursor.md +4 -0
- package/docs/adapters/desktop/discord.md +7 -7
- package/docs/adapters/index.md +1 -4
- package/docs/guide/getting-started.md +1 -0
- package/docs/guide/plugins.md +153 -0
- package/docs/zh/guide/plugins.md +107 -0
- package/extension/dist/background.js +91 -23
- package/extension/src/background.ts +82 -29
- package/extension/src/cdp.ts +42 -1
- package/package.json +10 -5
- package/scripts/clean-dist.cjs +13 -0
- package/src/browser/cdp.ts +71 -31
- package/src/browser/daemon-client.ts +21 -5
- package/src/browser/dom-helpers.ts +38 -7
- package/src/browser/dom-snapshot.test.ts +249 -0
- package/src/browser/dom-snapshot.ts +770 -0
- package/src/browser/index.ts +2 -0
- package/src/browser/mcp.ts +3 -1
- package/src/browser/page.ts +57 -21
- package/src/build-manifest.test.ts +70 -2
- package/src/build-manifest.ts +94 -26
- package/src/cli.ts +71 -2
- package/src/clis/barchart/greeks.ts +1 -1
- package/src/clis/barchart/options.ts +1 -1
- package/src/clis/barchart/quote.ts +1 -1
- package/src/clis/bilibili/download.ts +1 -1
- package/src/clis/bilibili/following.ts +1 -1
- package/src/clis/bilibili/subtitle.ts +1 -1
- package/src/clis/bilibili/user-videos.ts +1 -1
- package/src/clis/boss/batchgreet.ts +14 -106
- package/src/clis/boss/chatlist.ts +12 -26
- package/src/clis/boss/chatmsg.ts +16 -40
- package/src/clis/boss/common.ts +287 -0
- package/src/clis/boss/detail.ts +8 -54
- package/src/clis/boss/exchange.ts +15 -89
- package/src/clis/boss/greet.ts +23 -160
- package/src/clis/boss/invite.ts +36 -133
- package/src/clis/boss/joblist.ts +7 -36
- package/src/clis/boss/mark.ts +13 -94
- package/src/clis/boss/recommend.ts +12 -57
- package/src/clis/boss/resume.ts +19 -124
- package/src/clis/boss/search.ts +13 -66
- package/src/clis/boss/send.ts +21 -161
- package/src/clis/boss/stats.ts +19 -74
- package/src/clis/coupang/add-to-cart.ts +1 -1
- package/src/clis/devto/tag.yaml +34 -0
- package/src/clis/devto/top.yaml +29 -0
- package/src/clis/devto/user.yaml +33 -0
- package/src/clis/douban/book-hot.ts +15 -0
- package/src/clis/douban/marks.ts +135 -0
- package/src/clis/douban/movie-hot.ts +15 -0
- package/src/clis/douban/reviews.ts +127 -0
- package/src/clis/douban/search.ts +17 -0
- package/src/clis/douban/shared.ts +165 -0
- package/src/clis/douban/subject.yaml +76 -0
- package/src/clis/douban/top250.yaml +70 -0
- package/src/clis/douban/utils.ts +81 -0
- package/src/clis/facebook/add-friend.yaml +43 -0
- package/src/clis/facebook/events.yaml +44 -0
- package/src/clis/facebook/feed.yaml +63 -0
- package/src/clis/facebook/friends.yaml +42 -0
- package/src/clis/facebook/groups.yaml +50 -0
- package/src/clis/facebook/join-group.yaml +44 -0
- package/src/clis/facebook/memories.yaml +39 -0
- package/src/clis/facebook/notifications.yaml +40 -0
- package/src/clis/facebook/profile.yaml +37 -0
- package/src/clis/facebook/search.yaml +46 -0
- package/src/clis/google/news.ts +66 -0
- package/src/clis/google/search.ts +133 -0
- package/src/clis/google/suggest.ts +40 -0
- package/src/clis/google/trends.ts +44 -0
- package/src/clis/google/utils.test.ts +82 -0
- package/src/clis/google/utils.ts +24 -0
- package/src/clis/grok/ask.test.ts +53 -0
- package/src/clis/grok/ask.ts +300 -69
- package/src/clis/instagram/comment.yaml +52 -0
- package/src/clis/instagram/explore.yaml +43 -0
- package/src/clis/instagram/follow.yaml +41 -0
- package/src/clis/instagram/followers.yaml +51 -0
- package/src/clis/instagram/following.yaml +51 -0
- package/src/clis/instagram/like.yaml +46 -0
- package/src/clis/instagram/profile.yaml +42 -0
- package/src/clis/instagram/save.yaml +46 -0
- package/src/clis/instagram/saved.yaml +40 -0
- package/src/clis/instagram/search.yaml +43 -0
- package/src/clis/instagram/unfollow.yaml +38 -0
- package/src/clis/instagram/unlike.yaml +46 -0
- package/src/clis/instagram/unsave.yaml +46 -0
- package/src/clis/instagram/user.yaml +54 -0
- package/src/clis/jike/repost.ts +1 -1
- package/src/clis/jimeng/generate.yaml +1 -0
- package/src/clis/linux-do/category.yaml +1 -0
- package/src/clis/lobsters/active.yaml +29 -0
- package/src/clis/lobsters/hot.yaml +29 -0
- package/src/clis/lobsters/newest.yaml +29 -0
- package/src/clis/lobsters/tag.yaml +34 -0
- package/src/clis/medium/feed.ts +16 -0
- package/src/clis/medium/search.ts +16 -0
- package/src/clis/medium/shared.ts +83 -0
- package/src/clis/medium/user.ts +16 -0
- package/src/clis/reddit/comment.ts +1 -1
- package/src/clis/reddit/read.ts +1 -1
- package/src/clis/reddit/save.ts +1 -1
- package/src/clis/reddit/subreddit.yaml +1 -0
- package/src/clis/reddit/subscribe.ts +1 -1
- package/src/clis/reddit/upvote.ts +1 -1
- package/src/clis/sinablog/article.ts +15 -0
- package/src/clis/sinablog/hot.ts +15 -0
- package/src/clis/sinablog/search.ts +56 -0
- package/src/clis/sinablog/shared.ts +198 -0
- package/src/clis/sinablog/user.ts +16 -0
- package/src/clis/substack/feed.ts +16 -0
- package/src/clis/substack/publication.ts +16 -0
- package/src/clis/substack/search.ts +91 -0
- package/src/clis/substack/shared.ts +132 -0
- package/src/clis/tiktok/comment.yaml +66 -0
- package/src/clis/tiktok/explore.yaml +39 -0
- package/src/clis/tiktok/follow.yaml +39 -0
- package/src/clis/tiktok/following.yaml +46 -0
- package/src/clis/tiktok/friends.yaml +47 -0
- package/src/clis/tiktok/like.yaml +38 -0
- package/src/clis/tiktok/live.yaml +51 -0
- package/src/clis/tiktok/notifications.yaml +52 -0
- package/src/clis/tiktok/profile.yaml +45 -0
- package/src/clis/tiktok/save.yaml +34 -0
- package/src/clis/tiktok/search.yaml +46 -0
- package/src/clis/tiktok/unfollow.yaml +44 -0
- package/src/clis/tiktok/unlike.yaml +38 -0
- package/src/clis/tiktok/unsave.yaml +36 -0
- package/src/clis/tiktok/user.yaml +44 -0
- package/src/clis/twitter/download.ts +3 -3
- package/src/clis/twitter/followers.ts +1 -1
- package/src/clis/twitter/following.ts +1 -1
- package/src/clis/twitter/thread.ts +1 -1
- package/src/clis/twitter/timeline.test.ts +109 -0
- package/src/clis/twitter/timeline.ts +59 -19
- package/src/clis/wikipedia/random.ts +19 -0
- package/src/clis/wikipedia/search.ts +10 -4
- package/src/clis/wikipedia/summary.ts +4 -9
- package/src/clis/wikipedia/trending.ts +41 -0
- package/src/clis/wikipedia/utils.ts +31 -0
- package/src/clis/xiaohongshu/creator-note-detail.test.ts +2 -0
- package/src/clis/xiaohongshu/creator-note-detail.ts +1 -1
- package/src/clis/xiaohongshu/creator-notes.test.ts +2 -0
- package/src/clis/xiaohongshu/download.ts +1 -1
- package/src/clis/xueqiu/earnings-date.yaml +69 -0
- package/src/clis/xueqiu/search.yaml +2 -1
- package/src/clis/xueqiu/stock.yaml +2 -0
- package/src/clis/yahoo-finance/quote.ts +1 -1
- package/src/commanderAdapter.ts +17 -10
- package/src/daemon.ts +23 -0
- package/src/discovery.ts +134 -24
- package/src/doctor.test.ts +59 -2
- package/src/doctor.ts +4 -2
- package/src/engine.test.ts +79 -6
- package/src/execution.ts +42 -16
- package/src/explore.ts +77 -9
- package/src/generate.ts +58 -9
- package/src/main.ts +2 -1
- package/src/pipeline/executor.test.ts +35 -6
- package/src/pipeline/executor.ts +68 -19
- package/src/pipeline/registry.ts +3 -3
- package/src/pipeline/steps/browser.ts +24 -15
- package/src/pipeline/steps/fetch.ts +18 -13
- package/src/pipeline/steps/transform.ts +40 -15
- package/src/pipeline/template.test.ts +18 -0
- package/src/pipeline/template.ts +86 -13
- package/src/pipeline/transform.test.ts +15 -2
- package/src/plugin.test.ts +86 -0
- package/src/plugin.ts +254 -0
- package/src/registry-api.ts +12 -0
- package/src/registry.ts +19 -1
- package/src/synthesize.ts +102 -21
- package/src/types.ts +44 -12
- package/src/validate.ts +19 -4
- package/tests/e2e/browser-public.test.ts +11 -0
- package/tests/e2e/public-commands.test.ts +64 -0
- package/dist/clis/feishu/new.d.ts +0 -1
- package/dist/clis/feishu/new.js +0 -27
- package/dist/clis/feishu/read.d.ts +0 -1
- package/dist/clis/feishu/read.js +0 -40
- package/dist/clis/feishu/search.d.ts +0 -1
- package/dist/clis/feishu/search.js +0 -30
- package/dist/clis/feishu/send.d.ts +0 -1
- package/dist/clis/feishu/send.js +0 -39
- package/dist/clis/feishu/status.d.ts +0 -1
- package/dist/clis/feishu/status.js +0 -28
- package/dist/clis/neteasemusic/like.d.ts +0 -1
- package/dist/clis/neteasemusic/like.js +0 -25
- package/dist/clis/neteasemusic/lyrics.d.ts +0 -1
- package/dist/clis/neteasemusic/lyrics.js +0 -47
- package/dist/clis/neteasemusic/next.d.ts +0 -1
- package/dist/clis/neteasemusic/next.js +0 -26
- package/dist/clis/neteasemusic/play.d.ts +0 -1
- package/dist/clis/neteasemusic/play.js +0 -26
- package/dist/clis/neteasemusic/playing.d.ts +0 -1
- package/dist/clis/neteasemusic/playing.js +0 -59
- package/dist/clis/neteasemusic/playlist.d.ts +0 -1
- package/dist/clis/neteasemusic/playlist.js +0 -46
- package/dist/clis/neteasemusic/prev.d.ts +0 -1
- package/dist/clis/neteasemusic/prev.js +0 -25
- package/dist/clis/neteasemusic/search.d.ts +0 -1
- package/dist/clis/neteasemusic/search.js +0 -52
- package/dist/clis/neteasemusic/status.d.ts +0 -1
- package/dist/clis/neteasemusic/status.js +0 -16
- package/dist/clis/neteasemusic/volume.d.ts +0 -1
- package/dist/clis/neteasemusic/volume.js +0 -54
- package/dist/clis/wechat/chats.d.ts +0 -1
- package/dist/clis/wechat/chats.js +0 -28
- package/dist/clis/wechat/contacts.d.ts +0 -1
- package/dist/clis/wechat/contacts.js +0 -28
- package/dist/clis/wechat/read.d.ts +0 -1
- package/dist/clis/wechat/read.js +0 -58
- package/dist/clis/wechat/search.d.ts +0 -1
- package/dist/clis/wechat/search.js +0 -31
- package/dist/clis/wechat/send.d.ts +0 -1
- package/dist/clis/wechat/send.js +0 -42
- package/dist/clis/wechat/status.d.ts +0 -1
- package/dist/clis/wechat/status.js +0 -29
- package/dist/pipeline.d.ts +0 -7
- package/dist/pipeline.js +0 -7
- package/docs/adapters/browser/github.md +0 -26
- package/docs/adapters/desktop/feishu.md +0 -20
- package/docs/adapters/desktop/neteasemusic.md +0 -31
- package/docs/adapters/desktop/wechat.md +0 -28
- package/src/clis/antigravity/README.md +0 -5
- package/src/clis/antigravity/README.zh-CN.md +0 -51
- package/src/clis/chaoxing/README.md +0 -14
- package/src/clis/chaoxing/README.zh-CN.md +0 -35
- package/src/clis/chatgpt/README.md +0 -5
- package/src/clis/chatgpt/README.zh-CN.md +0 -44
- package/src/clis/chatwise/README.md +0 -5
- package/src/clis/chatwise/README.zh-CN.md +0 -38
- package/src/clis/codex/README.md +0 -5
- package/src/clis/codex/README.zh-CN.md +0 -33
- package/src/clis/cursor/README.md +0 -5
- package/src/clis/cursor/README.zh-CN.md +0 -33
- package/src/clis/discord-app/README.md +0 -5
- package/src/clis/discord-app/README.zh-CN.md +0 -28
- package/src/clis/feishu/README.md +0 -5
- package/src/clis/feishu/README.zh-CN.md +0 -20
- package/src/clis/feishu/new.ts +0 -32
- package/src/clis/feishu/read.ts +0 -48
- package/src/clis/feishu/search.ts +0 -35
- package/src/clis/feishu/send.ts +0 -46
- package/src/clis/feishu/status.ts +0 -34
- package/src/clis/neteasemusic/README.md +0 -5
- package/src/clis/neteasemusic/README.zh-CN.md +0 -31
- package/src/clis/neteasemusic/like.ts +0 -28
- package/src/clis/neteasemusic/lyrics.ts +0 -53
- package/src/clis/neteasemusic/next.ts +0 -30
- package/src/clis/neteasemusic/play.ts +0 -30
- package/src/clis/neteasemusic/playing.ts +0 -62
- package/src/clis/neteasemusic/playlist.ts +0 -51
- package/src/clis/neteasemusic/prev.ts +0 -29
- package/src/clis/neteasemusic/search.ts +0 -58
- package/src/clis/neteasemusic/status.ts +0 -18
- package/src/clis/neteasemusic/volume.ts +0 -61
- package/src/clis/notion/README.md +0 -5
- package/src/clis/notion/README.zh-CN.md +0 -29
- package/src/clis/wechat/README.md +0 -5
- package/src/clis/wechat/README.zh-CN.md +0 -28
- package/src/clis/wechat/chats.ts +0 -33
- package/src/clis/wechat/contacts.ts +0 -33
- package/src/clis/wechat/read.ts +0 -72
- package/src/clis/wechat/search.ts +0 -36
- package/src/clis/wechat/send.ts +0 -49
- package/src/clis/wechat/status.ts +0 -35
- package/src/pipeline.ts +0 -8
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# TikTok
|
|
2
|
+
|
|
3
|
+
**Mode**: 🔐 Browser · **Domain**: `tiktok.com`
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
| Command | Description |
|
|
8
|
+
|---------|-------------|
|
|
9
|
+
| `opencli tiktok profile` | Get user profile info |
|
|
10
|
+
| `opencli tiktok search` | Search videos |
|
|
11
|
+
| `opencli tiktok explore` | Trending videos from explore page |
|
|
12
|
+
| `opencli tiktok user` | Get recent videos from a user |
|
|
13
|
+
| `opencli tiktok following` | List accounts you follow |
|
|
14
|
+
| `opencli tiktok friends` | Friend suggestions |
|
|
15
|
+
| `opencli tiktok live` | Browse live streams |
|
|
16
|
+
| `opencli tiktok notifications` | Get notifications |
|
|
17
|
+
| `opencli tiktok like` | Like a video |
|
|
18
|
+
| `opencli tiktok unlike` | Unlike a video |
|
|
19
|
+
| `opencli tiktok save` | Add to Favorites |
|
|
20
|
+
| `opencli tiktok unsave` | Remove from Favorites |
|
|
21
|
+
| `opencli tiktok follow` | Follow a user |
|
|
22
|
+
| `opencli tiktok unfollow` | Unfollow a user |
|
|
23
|
+
| `opencli tiktok comment` | Comment on a video |
|
|
24
|
+
|
|
25
|
+
## Usage Examples
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# View a user's profile
|
|
29
|
+
opencli tiktok profile --username tiktok
|
|
30
|
+
|
|
31
|
+
# Search videos
|
|
32
|
+
opencli tiktok search --query "cooking" --limit 10
|
|
33
|
+
|
|
34
|
+
# Trending explore videos
|
|
35
|
+
opencli tiktok explore --limit 20
|
|
36
|
+
|
|
37
|
+
# Browse live streams
|
|
38
|
+
opencli tiktok live --limit 10
|
|
39
|
+
|
|
40
|
+
# List who you follow
|
|
41
|
+
opencli tiktok following
|
|
42
|
+
|
|
43
|
+
# Friend suggestions
|
|
44
|
+
opencli tiktok friends --limit 10
|
|
45
|
+
|
|
46
|
+
# Like/unlike a video
|
|
47
|
+
opencli tiktok like --url "https://www.tiktok.com/@user/video/123"
|
|
48
|
+
opencli tiktok unlike --url "https://www.tiktok.com/@user/video/123"
|
|
49
|
+
|
|
50
|
+
# Save/unsave (Favorites)
|
|
51
|
+
opencli tiktok save --url "https://www.tiktok.com/@user/video/123"
|
|
52
|
+
opencli tiktok unsave --url "https://www.tiktok.com/@user/video/123"
|
|
53
|
+
|
|
54
|
+
# Follow/unfollow
|
|
55
|
+
opencli tiktok follow --username nasa
|
|
56
|
+
opencli tiktok unfollow --username nasa
|
|
57
|
+
|
|
58
|
+
# Comment on a video
|
|
59
|
+
opencli tiktok comment --url "https://www.tiktok.com/@user/video/123" --text "Great!"
|
|
60
|
+
|
|
61
|
+
# JSON output
|
|
62
|
+
opencli tiktok profile --username tiktok -f json
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Prerequisites
|
|
66
|
+
|
|
67
|
+
- Chrome running and **logged into** tiktok.com
|
|
68
|
+
- [Browser Bridge extension](/guide/browser-bridge) installed
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|---------|-------------|
|
|
9
9
|
| `opencli wikipedia search` | Search Wikipedia articles |
|
|
10
10
|
| `opencli wikipedia summary` | Get Wikipedia article summary |
|
|
11
|
+
| `opencli wikipedia random` | Get a random Wikipedia article |
|
|
12
|
+
| `opencli wikipedia trending` | Most-read articles (yesterday) |
|
|
11
13
|
|
|
12
14
|
## Usage Examples
|
|
13
15
|
|
|
@@ -16,10 +18,17 @@
|
|
|
16
18
|
opencli wikipedia search "quantum computing" --limit 10
|
|
17
19
|
|
|
18
20
|
# Get article summary
|
|
19
|
-
opencli wikipedia summary
|
|
21
|
+
opencli wikipedia summary "Artificial intelligence"
|
|
20
22
|
|
|
21
|
-
#
|
|
23
|
+
# Get a random article
|
|
24
|
+
opencli wikipedia random
|
|
25
|
+
|
|
26
|
+
# Most-read articles (yesterday)
|
|
27
|
+
opencli wikipedia trending --limit 5
|
|
28
|
+
|
|
29
|
+
# Use with other languages
|
|
22
30
|
opencli wikipedia search "人工智能" --lang zh
|
|
31
|
+
opencli wikipedia random --lang ja
|
|
23
32
|
|
|
24
33
|
# JSON output
|
|
25
34
|
opencli wikipedia search "Rust" -f json
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
| Command | Description |
|
|
8
8
|
|---------|-------------|
|
|
9
9
|
| `opencli xueqiu feed` | |
|
|
10
|
+
| `opencli xueqiu earnings-date` | |
|
|
10
11
|
| `opencli xueqiu hot-stock` | |
|
|
11
12
|
| `opencli xueqiu hot` | |
|
|
12
13
|
| `opencli xueqiu search` | |
|
|
@@ -19,6 +20,15 @@
|
|
|
19
20
|
# Quick start
|
|
20
21
|
opencli xueqiu feed --limit 5
|
|
21
22
|
|
|
23
|
+
# Search stocks
|
|
24
|
+
opencli xueqiu search 茅台
|
|
25
|
+
|
|
26
|
+
# View one stock
|
|
27
|
+
opencli xueqiu stock SH600519
|
|
28
|
+
|
|
29
|
+
# Upcoming earnings dates
|
|
30
|
+
opencli xueqiu earnings-date SH600519 --next
|
|
31
|
+
|
|
22
32
|
# JSON output
|
|
23
33
|
opencli xueqiu feed -f json
|
|
24
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Yahoo Finance
|
|
2
2
|
|
|
3
|
-
**Mode**:
|
|
3
|
+
**Mode**: 🔐 Browser · **Domain**: `finance.yahoo.com`
|
|
4
4
|
|
|
5
5
|
## Commands
|
|
6
6
|
|
|
@@ -12,15 +12,16 @@
|
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
# Quick start
|
|
15
|
-
opencli yahoo-finance quote
|
|
15
|
+
opencli yahoo-finance quote AAPL
|
|
16
16
|
|
|
17
17
|
# JSON output
|
|
18
|
-
opencli yahoo-finance quote -f json
|
|
18
|
+
opencli yahoo-finance quote TSLA -f json
|
|
19
19
|
|
|
20
20
|
# Verbose mode
|
|
21
|
-
opencli yahoo-finance quote -v
|
|
21
|
+
opencli yahoo-finance quote NVDA -v
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Prerequisites
|
|
25
25
|
|
|
26
|
-
-
|
|
26
|
+
- Chrome running and able to open `finance.yahoo.com`
|
|
27
|
+
- [Browser Bridge extension](/guide/browser-bridge) installed
|
|
@@ -36,6 +36,9 @@ Scrape the entire current conversation history block as pure text.
|
|
|
36
36
|
### `opencli antigravity new`
|
|
37
37
|
Click the "New Conversation" button to instantly clear the UI state and start fresh.
|
|
38
38
|
|
|
39
|
+
### `opencli antigravity dump`
|
|
40
|
+
Dump the current DOM and snapshot artifacts to `/tmp` for reverse-engineering and selector debugging.
|
|
41
|
+
|
|
39
42
|
### `opencli antigravity extract-code`
|
|
40
43
|
Extract any multi-line code blocks from the current conversation view. Ideal for automated script extraction (e.g. `opencli antigravity extract-code > script.sh`).
|
|
41
44
|
|
|
@@ -44,3 +47,6 @@ Quickly target and switch the active LLM engine. Example: `opencli antigravity m
|
|
|
44
47
|
|
|
45
48
|
### `opencli antigravity watch`
|
|
46
49
|
A long-running, streaming process that continuously polls the Antigravity UI for chat updates and outputs them in real-time to standard output.
|
|
50
|
+
|
|
51
|
+
### `opencli antigravity serve --port 8082`
|
|
52
|
+
Start an Anthropic-compatible `/v1/messages` proxy backed by the local Antigravity app. Useful when you want external tools to talk to Antigravity through an API-shaped interface.
|
|
@@ -15,6 +15,7 @@ The current built-in commands use native AppleScript automation — no extra lau
|
|
|
15
15
|
- `opencli chatgpt new`: Activate ChatGPT and press `Cmd+N` to start a new conversation.
|
|
16
16
|
- `opencli chatgpt send "message"`: Copy your message to clipboard, activate ChatGPT, paste, and submit.
|
|
17
17
|
- `opencli chatgpt read`: Read the last visible message from the focused ChatGPT window via the Accessibility tree.
|
|
18
|
+
- `opencli chatgpt ask "message"`: Send a prompt and wait for the visible reply in one shot.
|
|
18
19
|
|
|
19
20
|
## Approach 2: CDP (Advanced, Electron Debug Mode)
|
|
20
21
|
|
|
@@ -29,7 +30,7 @@ ChatGPT Desktop is also an Electron app and can be launched with a remote debugg
|
|
|
29
30
|
export OPENCLI_CDP_ENDPOINT="http://127.0.0.1:9224"
|
|
30
31
|
```
|
|
31
32
|
|
|
32
|
-
> The CDP approach
|
|
33
|
+
> The CDP approach is primarily for advanced automation and future desktop-only commands. The built-in command set above still works in the default AppleScript path unless you explicitly route through `OPENCLI_CDP_ENDPOINT`.
|
|
33
34
|
|
|
34
35
|
## How It Works
|
|
35
36
|
|
|
@@ -14,7 +14,7 @@ Control the **OpenAI Codex Desktop App** headless or headfully via Chrome DevToo
|
|
|
14
14
|
## Setup
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
export
|
|
17
|
+
export OPENCLI_CDP_ENDPOINT="http://127.0.0.1:9222"
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Commands
|
|
@@ -22,11 +22,15 @@ export OPENCLI_CODEX_CDP_ENDPOINT="http://127.0.0.1:9222"
|
|
|
22
22
|
### Diagnostics
|
|
23
23
|
- `opencli codex status`: Checks connection and reads the current active window URL/title.
|
|
24
24
|
- `opencli codex dump`: Dumps the full UI DOM and Accessibility tree into `/tmp`.
|
|
25
|
+
- `opencli codex screenshot`: Captures DOM + snapshot artifacts of the current window.
|
|
25
26
|
|
|
26
27
|
### Agent Manipulation
|
|
27
28
|
- `opencli codex new`: Simulates `Cmd+N` to start a completely fresh and isolated Git Worktree thread context.
|
|
28
29
|
- `opencli codex send "message"`: Robustly finds the active Thread Composer and injects your text.
|
|
29
30
|
- *Pro-tip*: You can trigger internal shortcuts, e.g., `opencli codex send "/review"`.
|
|
31
|
+
- `opencli codex ask "message"`: Send + wait + read in one shot.
|
|
30
32
|
- `opencli codex read`: Extracts the entire current thread history and AI reasoning logs.
|
|
31
33
|
- `opencli codex extract-diff`: Automatically scrapes any visual Patch chunks and Code Diffs.
|
|
32
34
|
- `opencli codex model`: Get the currently active AI model.
|
|
35
|
+
- `opencli codex history`: List recent conversation threads from the sidebar.
|
|
36
|
+
- `opencli codex export`: Export the current conversation as Markdown.
|
|
@@ -21,13 +21,17 @@ export OPENCLI_CDP_ENDPOINT="http://127.0.0.1:9226"
|
|
|
21
21
|
### Diagnostics
|
|
22
22
|
- `opencli cursor status`: Check CDP connection status.
|
|
23
23
|
- `opencli cursor dump`: Dump the full DOM and Accessibility snapshot to `/tmp/cursor-dom.html` and `/tmp/cursor-snapshot.json`.
|
|
24
|
+
- `opencli cursor screenshot`: Capture DOM + snapshot artifacts of the current window.
|
|
24
25
|
|
|
25
26
|
### Chat Manipulation
|
|
26
27
|
- `opencli cursor new`: Press `Cmd+N` to start a new file/tab.
|
|
27
28
|
- `opencli cursor send "message"`: Inject text into the active Composer/Chat input and submit.
|
|
29
|
+
- `opencli cursor ask "message"`: Send + wait + read in one shot.
|
|
28
30
|
- `opencli cursor read`: Extract the full conversation history from the active chat panel.
|
|
29
31
|
|
|
30
32
|
### AI Features
|
|
31
33
|
- `opencli cursor composer "prompt"`: Open the Composer panel (`Cmd+I`) and send a prompt for inline AI editing.
|
|
32
34
|
- `opencli cursor model`: Get the currently active AI model (e.g., `claude-4.5-sonnet`).
|
|
33
35
|
- `opencli cursor extract-code`: Extract all code blocks from the current conversation.
|
|
36
|
+
- `opencli cursor history`: List recent chat/composer sessions from the sidebar.
|
|
37
|
+
- `opencli cursor export`: Export the current conversation as Markdown.
|
|
@@ -19,10 +19,10 @@ export OPENCLI_CDP_ENDPOINT="http://127.0.0.1:9232"
|
|
|
19
19
|
|
|
20
20
|
| Command | Description |
|
|
21
21
|
|---------|-------------|
|
|
22
|
-
| `opencli discord status` | Check CDP connection |
|
|
23
|
-
| `opencli discord send "message"` | Send a message in the active channel |
|
|
24
|
-
| `opencli discord read` | Read recent messages |
|
|
25
|
-
| `opencli discord channels` | List channels in the current server |
|
|
26
|
-
| `opencli discord servers` | List all joined servers |
|
|
27
|
-
| `opencli discord search "query"` | Search messages (Cmd+F) |
|
|
28
|
-
| `opencli discord members` | List online members |
|
|
22
|
+
| `opencli discord-app status` | Check CDP connection |
|
|
23
|
+
| `opencli discord-app send "message"` | Send a message in the active channel |
|
|
24
|
+
| `opencli discord-app read` | Read recent messages |
|
|
25
|
+
| `opencli discord-app channels` | List channels in the current server |
|
|
26
|
+
| `opencli discord-app servers` | List all joined servers |
|
|
27
|
+
| `opencli discord-app search "query"` | Search messages (Cmd+F) |
|
|
28
|
+
| `opencli discord-app members` | List online members |
|
package/docs/adapters/index.md
CHANGED
|
@@ -34,8 +34,8 @@ Run `opencli list` for the live registry.
|
|
|
34
34
|
| Site | Commands | Mode |
|
|
35
35
|
|------|----------|------|
|
|
36
36
|
| **[hackernews](/adapters/browser/hackernews)** | `top` | 🌐 Public |
|
|
37
|
-
| **[github](/adapters/browser/github)** | `search` | 🌐 Public |
|
|
38
37
|
| **[bbc](/adapters/browser/bbc)** | `news` | 🌐 Public |
|
|
38
|
+
| **[devto](/adapters/browser/devto)** | `top` `tag` `user` | 🌐 Public |
|
|
39
39
|
| **[apple-podcasts](/adapters/browser/apple-podcasts)** | `search` `episodes` `top` | 🌐 Public |
|
|
40
40
|
| **[xiaoyuzhou](/adapters/browser/xiaoyuzhou)** | `podcast` `podcast-episodes` `episode` | 🌐 Public |
|
|
41
41
|
| **[yahoo-finance](/adapters/browser/yahoo-finance)** | `quote` | 🌐 Public |
|
|
@@ -57,6 +57,3 @@ Run `opencli list` for the live registry.
|
|
|
57
57
|
| **[ChatWise](/adapters/desktop/chatwise)** | Multi-LLM client | `status` `new` `send` `read` `ask` `model` `history` `export` `screenshot` |
|
|
58
58
|
| **[Notion](/adapters/desktop/notion)** | Search, read, write pages | `status` `search` `read` `new` `write` `sidebar` `favorites` `export` |
|
|
59
59
|
| **[Discord](/adapters/desktop/discord)** | Desktop messages & channels | `status` `send` `read` `channels` `servers` `search` `members` |
|
|
60
|
-
| **[Feishu](/adapters/desktop/feishu)** | 飞书/Lark via AppleScript | `status` `send` `read` `search` `new` |
|
|
61
|
-
| **[WeChat](/adapters/desktop/wechat)** | 微信 via AppleScript | `status` `send` `read` `search` `chats` `contacts` |
|
|
62
|
-
| **[NeteaseMusic](/adapters/desktop/neteasemusic)** | 网易云音乐 via CDP | `status` `playing` `play` `next` `prev` `search` `playlist` `like` `lyrics` `volume` |
|
|
@@ -52,5 +52,6 @@ opencli bilibili hot -v # Verbose: show pipeline debug
|
|
|
52
52
|
|
|
53
53
|
- [Installation details](/guide/installation)
|
|
54
54
|
- [Browser Bridge setup](/guide/browser-bridge)
|
|
55
|
+
- [Plugins — extend with community adapters](/guide/plugins)
|
|
55
56
|
- [All available adapters](/adapters/)
|
|
56
57
|
- [For developers / AI agents](/developer/contributing)
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Plugins
|
|
2
|
+
|
|
3
|
+
OpenCLI supports community-contributed plugins. Install third-party adapters from GitHub, and they're automatically discovered alongside built-in commands.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install a plugin
|
|
9
|
+
opencli plugin install github:ByteYue/opencli-plugin-github-trending
|
|
10
|
+
|
|
11
|
+
# List installed plugins
|
|
12
|
+
opencli plugin list
|
|
13
|
+
|
|
14
|
+
# Use the plugin (it's just a regular command)
|
|
15
|
+
opencli github-trending repos --limit 10
|
|
16
|
+
|
|
17
|
+
# Remove a plugin
|
|
18
|
+
opencli plugin uninstall github-trending
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## How Plugins Work
|
|
22
|
+
|
|
23
|
+
Plugins live in `~/.opencli/plugins/<name>/`. Each subdirectory is scanned at startup for `.yaml`, `.ts`, or `.js` command files — the same formats used by built-in adapters.
|
|
24
|
+
|
|
25
|
+
### Supported Source Formats
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
opencli plugin install github:user/repo
|
|
29
|
+
opencli plugin install https://github.com/user/repo
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The repo name prefix `opencli-plugin-` is automatically stripped for the local directory name. For example, `opencli-plugin-hot-digest` becomes `hot-digest`.
|
|
33
|
+
|
|
34
|
+
## Creating a Plugin
|
|
35
|
+
|
|
36
|
+
### Option 1: YAML Plugin (Simplest)
|
|
37
|
+
|
|
38
|
+
Zero dependencies, no build step. Just create a `.yaml` file:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
my-plugin/
|
|
42
|
+
├── my-command.yaml
|
|
43
|
+
└── README.md
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Example `my-command.yaml`:
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
site: my-plugin
|
|
50
|
+
name: my-command
|
|
51
|
+
description: My custom command
|
|
52
|
+
strategy: public
|
|
53
|
+
browser: false
|
|
54
|
+
|
|
55
|
+
args:
|
|
56
|
+
limit:
|
|
57
|
+
type: int
|
|
58
|
+
default: 10
|
|
59
|
+
|
|
60
|
+
pipeline:
|
|
61
|
+
- fetch:
|
|
62
|
+
url: https://api.example.com/data
|
|
63
|
+
- map:
|
|
64
|
+
title: ${{ item.title }}
|
|
65
|
+
score: ${{ item.score }}
|
|
66
|
+
- limit: ${{ args.limit }}
|
|
67
|
+
|
|
68
|
+
columns: [title, score]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Option 2: TypeScript Plugin
|
|
72
|
+
|
|
73
|
+
For richer logic (multi-source aggregation, custom transformations, etc.):
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
my-plugin/
|
|
77
|
+
├── package.json
|
|
78
|
+
├── my-command.ts
|
|
79
|
+
└── README.md
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`package.json`:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"name": "opencli-plugin-my-plugin",
|
|
87
|
+
"version": "0.1.0",
|
|
88
|
+
"type": "module",
|
|
89
|
+
"peerDependencies": {
|
|
90
|
+
"@jackwener/opencli": ">=1.0.0"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`my-command.ts`:
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
99
|
+
|
|
100
|
+
cli({
|
|
101
|
+
site: 'my-plugin',
|
|
102
|
+
name: 'my-command',
|
|
103
|
+
description: 'My custom command',
|
|
104
|
+
strategy: Strategy.PUBLIC,
|
|
105
|
+
browser: false,
|
|
106
|
+
args: [
|
|
107
|
+
{ name: 'limit', type: 'int', default: 10, help: 'Number of items' },
|
|
108
|
+
],
|
|
109
|
+
columns: ['title', 'score'],
|
|
110
|
+
func: async (_page, kwargs) => {
|
|
111
|
+
const res = await fetch('https://api.example.com/data');
|
|
112
|
+
const data = await res.json();
|
|
113
|
+
return data.items.slice(0, kwargs.limit).map((item: any, i: number) => ({
|
|
114
|
+
title: item.title,
|
|
115
|
+
score: item.score,
|
|
116
|
+
}));
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### TS Plugin Install Lifecycle
|
|
122
|
+
|
|
123
|
+
When you run `opencli plugin install`, TS plugins are automatically set up:
|
|
124
|
+
|
|
125
|
+
1. **Clone** — `git clone --depth 1` from GitHub
|
|
126
|
+
2. **npm install** — Resolves regular dependencies
|
|
127
|
+
3. **Host symlink** — Links the running `@jackwener/opencli` into the plugin's `node_modules/` so `import from '@jackwener/opencli/registry'` always resolves against the host
|
|
128
|
+
4. **Transpile** — Compiles `.ts` → `.js` via `esbuild` (production `node` cannot load `.ts` directly)
|
|
129
|
+
|
|
130
|
+
On startup, if both `my-command.ts` and `my-command.js` exist, the `.js` version is loaded to avoid duplicate registration.
|
|
131
|
+
|
|
132
|
+
## Example Plugins
|
|
133
|
+
|
|
134
|
+
| Repo | Type | Description |
|
|
135
|
+
|------|------|-------------|
|
|
136
|
+
| [opencli-plugin-github-trending](https://github.com/ByteYue/opencli-plugin-github-trending) | YAML | GitHub Trending repositories |
|
|
137
|
+
| [opencli-plugin-hot-digest](https://github.com/ByteYue/opencli-plugin-hot-digest) | TS | Multi-platform trending aggregator (zhihu, weibo, bilibili, v2ex, stackoverflow, reddit, linux-do) |
|
|
138
|
+
| [opencli-plugin-juejin](https://github.com/Astro-Han/opencli-plugin-juejin) | YAML | 稀土掘金 (Juejin) hot articles, categories, and article feed |
|
|
139
|
+
|
|
140
|
+
## Troubleshooting
|
|
141
|
+
|
|
142
|
+
### Command not found after install
|
|
143
|
+
|
|
144
|
+
Restart opencli (or open a new terminal) — plugins are discovered at startup.
|
|
145
|
+
|
|
146
|
+
### TS plugin import errors
|
|
147
|
+
|
|
148
|
+
If you see `Cannot find module '@jackwener/opencli/registry'`, the host symlink may be broken. Reinstall the plugin:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
opencli plugin uninstall my-plugin
|
|
152
|
+
opencli plugin install github:user/opencli-plugin-my-plugin
|
|
153
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# 插件
|
|
2
|
+
|
|
3
|
+
OpenCLI 支持社区贡献的 plugins。你可以从 GitHub 安装第三方 adapters,它们会和内置 commands 一起在启动时自动发现。
|
|
4
|
+
|
|
5
|
+
## 安装插件
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# 安装插件
|
|
9
|
+
opencli plugin install github:ByteYue/opencli-plugin-github-trending
|
|
10
|
+
|
|
11
|
+
# 列出已安装插件
|
|
12
|
+
opencli plugin list
|
|
13
|
+
|
|
14
|
+
# 使用插件(本质上就是普通 command)
|
|
15
|
+
opencli github-trending today
|
|
16
|
+
|
|
17
|
+
# 卸载插件
|
|
18
|
+
opencli plugin uninstall github-trending
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 插件目录结构
|
|
22
|
+
|
|
23
|
+
Plugins 存放在 `~/.opencli/plugins/<name>/`。每个子目录都会在启动时扫描 `.yaml`、`.ts`、`.js` 命令文件,格式与内置 adapters 相同。
|
|
24
|
+
|
|
25
|
+
## 安装来源
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
opencli plugin install github:user/repo
|
|
29
|
+
opencli plugin install https://github.com/user/repo
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
如果仓库名带 `opencli-plugin-` 前缀,本地目录会自动去掉这个前缀。例如 `opencli-plugin-hot-digest` 会变成 `hot-digest`。
|
|
33
|
+
|
|
34
|
+
## YAML plugin 示例
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
my-plugin/
|
|
38
|
+
hot.yaml
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
site: my-plugin
|
|
43
|
+
name: hot
|
|
44
|
+
description: Example plugin command
|
|
45
|
+
strategy: public
|
|
46
|
+
browser: false
|
|
47
|
+
|
|
48
|
+
pipeline:
|
|
49
|
+
- evaluate: |
|
|
50
|
+
() => [{ title: 'hello', url: 'https://example.com' }]
|
|
51
|
+
|
|
52
|
+
columns: [title, url]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## TypeScript plugin 示例
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
my-plugin/
|
|
59
|
+
index.ts
|
|
60
|
+
package.json
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"name": "opencli-plugin-my-plugin",
|
|
66
|
+
"type": "module"
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
72
|
+
|
|
73
|
+
cli({
|
|
74
|
+
site: 'my-plugin',
|
|
75
|
+
name: 'hot',
|
|
76
|
+
description: 'Example TS plugin command',
|
|
77
|
+
strategy: Strategy.PUBLIC,
|
|
78
|
+
browser: false,
|
|
79
|
+
columns: ['title', 'url'],
|
|
80
|
+
func: async () => [{ title: 'hello', url: 'https://example.com' }],
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
运行 `opencli plugin install` 时,TS plugins 会自动完成基础设置:
|
|
85
|
+
|
|
86
|
+
1. 安装 plugin 自身依赖
|
|
87
|
+
2. 补齐 TypeScript 运行环境
|
|
88
|
+
3. 将宿主 `@jackwener/opencli` 链接到 plugin 的 `node_modules/`,保证 `@jackwener/opencli/registry` 指向当前宿主版本
|
|
89
|
+
|
|
90
|
+
## 示例 plugins
|
|
91
|
+
|
|
92
|
+
- `opencli-plugin-github-trending`:GitHub Trending 仓库
|
|
93
|
+
- `opencli-plugin-hot-digest`:多平台热点聚合(zhihu、weibo、bilibili、v2ex、stackoverflow、reddit、linux-do)
|
|
94
|
+
- `opencli-plugin-juejin`:稀土掘金热榜、分类和文章流
|
|
95
|
+
|
|
96
|
+
## 排查问题
|
|
97
|
+
|
|
98
|
+
### TS plugin import 报错
|
|
99
|
+
|
|
100
|
+
如果看到 `Cannot find module '@jackwener/opencli/registry'`,通常是宿主 symlink 失效。重新安装 plugin 即可:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
opencli plugin uninstall my-plugin
|
|
104
|
+
opencli plugin install github:user/opencli-plugin-my-plugin
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
安装或卸载 plugin 后,建议重新打开一个终端,确保启动时重新发现命令。
|