Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ dist/
*.tsbuildinfo
.opencli/
.worktrees/
.agents/
skills-lock.json
.mcp.json
*.log
.DS_Store
Expand Down
373 changes: 123 additions & 250 deletions README.md

Large diffs are not rendered by default.

403 changes: 122 additions & 281 deletions README.zh-CN.md

Large diffs are not rendered by default.

19 changes: 13 additions & 6 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ export default defineConfig({
themeConfig: {
nav: [
{ text: 'Guide', link: '/guide/getting-started' },
{ text: 'Agent Ops', link: '/guide/ai-agent-operations' },
{ text: 'Adapters', link: '/adapters/' },
{ text: 'Developer', link: '/developer/contributing' },
{ text: 'Advanced', link: '/advanced/cdp' },
{ text: 'Advanced', link: '/advanced/browserbase' },
],
sidebar: {
'/guide/': [
Expand All @@ -29,6 +30,8 @@ export default defineConfig({
items: [
{ text: 'Getting Started', link: '/guide/getting-started' },
{ text: 'Installation', link: '/guide/installation' },
{ text: 'AI Agent Operations', link: '/guide/ai-agent-operations' },
{ text: 'Skills for AI Agents', link: '/guide/skills' },
{ text: 'Comparison', link: '/comparison' },
{ text: 'Browser Bridge', link: '/guide/browser-bridge' },
{ text: 'Remote Orchestration', link: '/guide/remote-orchestration' },
Expand Down Expand Up @@ -206,9 +209,10 @@ export default defineConfig({
themeConfig: {
nav: [
{ text: '指南', link: '/zh/guide/getting-started' },
{ text: 'Agent 操作', link: '/zh/guide/ai-agent-operations' },
{ text: '适配器', link: '/zh/adapters/' },
{ text: '开发者', link: '/zh/developer/contributing' },
{ text: '进阶', link: '/zh/advanced/cdp' },
{ text: '进阶', link: '/zh/advanced/browserbase' },
],
sidebar: {
'/zh/guide/': [
Expand All @@ -217,6 +221,8 @@ export default defineConfig({
items: [
{ text: '快速开始', link: '/zh/guide/getting-started' },
{ text: '安装', link: '/zh/guide/installation' },
{ text: 'AI Agent 操作指南', link: '/zh/guide/ai-agent-operations' },
{ text: '给 AI Agent 的 Skills', link: '/zh/guide/skills' },
{ text: 'Browser Bridge', link: '/zh/guide/browser-bridge' },
{ text: '给新 Electron 应用生成 CLI', link: '/zh/guide/electron-app-cli' },
{ text: '扩展 OpenCLI', link: '/zh/guide/extending-opencli' },
Expand All @@ -229,6 +235,7 @@ export default defineConfig({
text: '适配器概览',
items: [
{ text: '所有适配器', link: '/zh/adapters/' },
{ text: '社交平台 Comments', link: '/zh/adapters/social-comments' },
],
},
],
Expand All @@ -245,6 +252,7 @@ export default defineConfig({
text: '进阶',
items: [
{ text: 'Chrome DevTools Protocol', link: '/zh/advanced/cdp' },
{ text: 'Browserbase', link: '/zh/advanced/browserbase' },
],
},
],
Expand All @@ -259,18 +267,17 @@ export default defineConfig({
},

socialLinks: [
{ icon: 'github', link: 'https://github.com/jackwener/opencli' },
{ icon: 'npm', link: 'https://www.npmjs.com/package/@jackwener/opencli' },
{ icon: 'github', link: 'https://github.com/albertcyhe/opencli' },
],

editLink: {
pattern: 'https://github.com/jackwener/opencli/edit/main/docs/:path',
pattern: 'https://github.com/albertcyhe/opencli/edit/main/docs/:path',
text: 'Edit this page on GitHub',
},

footer: {
message: 'Released under the Apache-2.0 License.',
copyright: 'Copyright © 2024-present jackwener',
copyright: 'Copyright © 2024-present OpenCLI contributors',
},
},
})
83 changes: 48 additions & 35 deletions docs/adapters/social-comments.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@
# Social Comment Support

OpenCLI exposes comment workflows for the major social adapters through the
same browser-backed runtime used by normal site commands. These commands reuse
your logged-in browser session, or a Browserbase account profile when you pass
`--browserbase-account`.
OpenCLI exposes social comment workflows as atomic adapter commands. Use them directly, or route them through Browserbase accounts when identity, login state, or proxy matters.

## Support Matrix

| Platform | Read comments | Post top-level comment | Reply to comment | Notes |
|----------|---------------|------------------------|------------------|-------|
| Twitter / X | `twitter get-comments` | `twitter reply` | `twitter reply` | Tweet replies are represented as comment rows with reply-able `comment_id` values. |
| YouTube | `youtube comments` | `youtube reply` | `youtube reply-comment` | `reply-comment` needs the original video URL for page context. |
| Reddit | `reddit read`, `reddit get-comments` | `reddit comment` | `reddit reply` | `read --expand-more` expands threaded comments; `get-comments` returns a flat top-level list with IDs. |
| LinkedIn | `linkedin timeline` comment counts | Not exposed | Not exposed | Current LinkedIn support reports timeline post `comments` counts, but does not extract or write comment threads. |
| Instagram | `instagram get-comments` | `instagram comment` | `instagram reply` | `get-comments` accepts a username plus post index, or a post/reel URL. |
| TikTok | `tiktok get-comments` | `tiktok comment` | `tiktok reply` | Reply can fall back to `--comment-text` and `--comment-author` when an ID cannot be matched. |
| Xiaohongshu | `xiaohongshu comments` | Not exposed | `xiaohongshu reply` | `comments --with-replies` includes nested replies; note URLs need `xsec_token`. |
| Platform | Read comments | Top-level write | Reply write | Browserbase account example |
| --- | --- | --- | --- | --- |
| Reddit | `reddit read`, `reddit get-comments` | `reddit comment` | `reddit reply` | `opencli --browserbase-account reddit1 reddit get-comments <url> -f json` |
| Twitter / X | `twitter get-comments`, `twitter thread` | `twitter post` / tweet reply with `twitter reply` | `twitter reply` | `opencli --browserbase-account x-main-1 twitter get-comments <url> -f json` |
| YouTube | `youtube comments` | `youtube reply` | `youtube reply-comment` | `opencli --browserbase-account yt1 youtube comments <url> -f json` |
| Instagram | `instagram get-comments` | `instagram comment` | `instagram reply` | `opencli --browserbase-account ig1 instagram get-comments <url> -f json` |
| TikTok | `tiktok get-comments` | `tiktok comment` | `tiktok reply` | `opencli --browserbase-account tiktok1 tiktok get-comments <url> -f json` |
| Xiaohongshu | `xiaohongshu comments` | Not exposed | `xiaohongshu reply` | `opencli --browserbase-account xhs1 xiaohongshu comments <url> -f json` |
| LinkedIn | `linkedin timeline` comment counts | Not exposed | Not exposed | `opencli --browserbase-account linkedin1 linkedin timeline -f json` |

## Common Patterns
## Read Recipes

Read comments in JSON so the returned IDs can be reused:
Read comments in JSON so returned IDs can be reused by reply commands:

```bash
opencli reddit get-comments https://www.reddit.com/r/example/comments/1abc123/title/ --limit 100 -f json
opencli twitter get-comments https://x.com/user/status/123 --limit 50 -f json
opencli reddit get-comments "https://www.reddit.com/r/example/comments/1abc123/title/" --limit 100 -f json
opencli reddit read "https://www.reddit.com/r/example/comments/1abc123/title/" --expand-more -f json

opencli twitter get-comments "https://x.com/user/status/123" --limit 50 -f json
opencli twitter thread "https://x.com/user/status/123" -f json

opencli youtube comments "https://www.youtube.com/watch?v=VIDEO_ID" --limit 100 -f json
opencli instagram get-comments https://www.instagram.com/p/SHORTCODE/ --limit 50 -f json
opencli instagram get-comments "https://www.instagram.com/p/SHORTCODE/" --limit 50 -f json
opencli tiktok get-comments "https://www.tiktok.com/@user/video/123" --limit 50 -f json
opencli xiaohongshu comments "https://www.xiaohongshu.com/search_result/<id>?xsec_token=..." --with-replies -f json
opencli linkedin timeline --limit 20 -f json
```

Post or reply only when you intentionally want a write action:
## Write Recipes

Only run write commands when the user explicitly wants to post or reply.

```bash
opencli reddit comment 1abc123 "Comment text"
opencli reddit reply t1_okf3s7u "Reply text"

opencli twitter reply "https://x.com/user/status/123" "Reply text"

opencli youtube reply "https://www.youtube.com/watch?v=VIDEO_ID" "Comment text"
opencli youtube reply-comment Ugxxx "Reply text" --url "https://www.youtube.com/watch?v=VIDEO_ID"

Expand All @@ -48,26 +54,33 @@ opencli tiktok reply "https://www.tiktok.com/@user/video/123" "COMMENT_ID" "Repl
opencli xiaohongshu reply "https://www.xiaohongshu.com/search_result/<id>?xsec_token=..." "COMMENT_ID" "Reply text"
```

## Browserbase Accounts
## Browserbase Identity Pattern

Use a Browserbase account when login state and exit IP should travel together:

```bash
opencli browserbase account set-proxy reddit1 reddit1-proxy

opencli --browserbase-account reddit1 \
reddit get-comments "https://www.reddit.com/r/example/comments/1abc123/title/" \
--limit 100 \
-f json
```

Use Browserbase when the comment workflow needs a cloud browser, a fixed proxy,
or multiple logged-in identities:
For many jobs:

```bash
opencli --browserbase-account reddit1 reddit get-comments https://www.reddit.com/r/example/comments/1abc123/title/
opencli --browserbase-account x-main-1 twitter get-comments https://x.com/user/status/123
opencli run --browserbase \
--accounts reddit1,reddit2,reddit3 \
--parallel 3 \
jobs.jsonl
```

For durable login state, proxy CRUD, account-to-proxy binding, and pooled
parallel sessions, see [Browserbase Accounts, Login State, Proxies, and Parallel Sessions](../advanced/browserbase.md).
See [Browserbase Accounts, Proxies, and Parallel Sessions](../advanced/browserbase.md).

## Limits And Safety
## Safety Notes

- Read commands return the rows exposed by the platform's current web APIs or
UI state. Some platforms hide replies behind paginated "more" affordances or
rate limits.
- Write commands require a valid logged-in session. They raise typed errors on
auth walls, malformed IDs, captcha/rate-limit states, or failed post-click
verification instead of returning silent success rows.
- Treat returned comment IDs as platform-scoped IDs. Reuse them only with the
same platform adapter that produced them.
- Read commands return what the current platform API or UI exposes; pagination, hidden replies, auth walls, and rate limits can reduce coverage.
- Write commands require a valid logged-in identity and may have irreversible social effects. Do not run them without explicit user intent.
- Treat comment IDs as platform-scoped. Reuse a returned ID only with the same platform adapter.
- Do not print cookies, proxy passwords, Browserbase connect URLs, or API keys in final output.
Loading
Loading