BNBot - Control Twitter/X via AI
BNBot operates through a real browser session via Chrome Extension. 40+ CLI tools for posting, engagement, scraping, user profiles, content fetching, articles, and job searching.
First-time setup (run once after install)
After bnbot-cli is installed, start the WebSocket daemon:
CODEBLOCK0
Confirm port 18900 is LISTEN before proceeding.
Before using any bnbot tool
Check if the daemon is still running:
CODEBLOCK1
If empty, restart it:
CODEBLOCK2
How to use tools
All tools are executed via the bnbot CLI:
CODEBLOCK3
Output is JSON.
Auto-thread for multiple images: When post-tweet receives more than 4 images (Twitter's limit), it automatically splits into a thread — first tweet gets the text + first 4 images, subsequent tweets get remaining images in batches of 4. You don't need to manually use post-thread for this.
Media support: Parameters like --media, --image, --headerImage, --bodyImages accept both local file paths (~/Downloads/image.png) and URLs (https://example.com/image.jpg). Files are auto-converted to base64 before sending.
If extension is not connected
If bnbot get-extension-status shows connected: false, tell the user:
Chrome Extension is not connected. Please:
- 1. Install extension: https://chromewebstore.google.com/detail/bnbot-your-ai-growth-agen/haammgigdkckogcgnbkigfleejpaiiln
- Open https://x.com in Chrome
- Open BNBot sidebar → Settings → turn on OpenClaw
Available CLI commands
Status
- -
bnbot get-extension-status — Check if extension is connected - INLINECODE13 — Get current Twitter/X page info
Navigation
- - INLINECODE14
- INLINECODE15
- INLINECODE16
- INLINECODE17
- INLINECODE18
- INLINECODE19
Posting
- - INLINECODE20
- INLINECODE21
- INLINECODE22
- INLINECODE23
Engagement
- - INLINECODE24
- INLINECODE25
- INLINECODE26
- INLINECODE27
- INLINECODE28
- INLINECODE29
- INLINECODE30
- INLINECODE31
- INLINECODE32
Scraping
- - INLINECODE33
- INLINECODE34
- INLINECODE35
- INLINECODE36
- INLINECODE37
- INLINECODE38
User Profiles
- - INLINECODE39
- INLINECODE40
Content Fetching
- - INLINECODE41
- INLINECODE42
- INLINECODE43
Articles
- - INLINECODE44
- INLINECODE45
- INLINECODE46
- INLINECODE47
- INLINECODE48
- INLINECODE49
Authentication
- -
bnbot login [--email <email>] — Login to BNBot via email verification
Jobs
BNBot - 通过AI控制Twitter/X
BNBot通过Chrome扩展在真实浏览器会话中运行。提供40多个CLI工具,用于发帖、互动、数据抓取、用户资料、内容获取、文章和职位搜索。
首次设置(安装后运行一次)
安装bnbot-cli后,启动WebSocket守护进程:
bash
nohup bnbot serve > /tmp/bnbot.log 2>&1 &
sleep 1
lsof -i :18900 -P 2>/dev/null | grep LISTEN
在继续之前,确认端口18900处于LISTEN状态。
使用任何bnbot工具之前
检查守护进程是否仍在运行:
bash
lsof -i :18900 -P 2>/dev/null | grep LISTEN
如果没有输出,重新启动:
bash
nohup bnbot serve > /tmp/bnbot.log 2>&1 &
如何使用工具
所有工具都通过bnbot CLI执行:
bash
bnbot get-extension-status
bnbot post-tweet --text Hello world!
bnbot scrape-timeline --limit 10
输出为JSON格式。
多图自动线程:当post-tweet接收超过4张图片(Twitter限制)时,会自动拆分为线程——第一条推文包含文本和前4张图片,后续推文以每批4张的方式包含剩余图片。无需手动使用post-thread。
媒体支持:--media、--image、--headerImage、--bodyImages等参数支持本地文件路径(~/Downloads/image.png)和URL(https://example.com/image.jpg)。文件在发送前会自动转换为base64格式。
如果扩展未连接
如果bnbot get-extension-status显示connected: false,请告知用户:
Chrome扩展未连接。请:
- 1. 安装扩展:https://chromewebstore.google.com/detail/bnbot-your-ai-growth-agen/haammgigdkckogcgnbkigfleejpaiiln
- 在Chrome中打开 https://x.com
- 打开BNBot侧边栏 → 设置 → 开启OpenClaw
可用CLI命令
状态
- - bnbot get-extension-status — 检查扩展是否已连接
- bnbot get-current-page-info — 获取当前Twitter/X页面信息
导航
- - bnbot navigate-to-tweet --tweetUrl
- bnbot navigate-to-search [--query ...] [--sort top|latest|people|media]
- bnbot navigate-to-bookmarks
- bnbot navigate-to-notifications
- bnbot navigate-to-following
- bnbot return-to-timeline
发帖
- - bnbot post-tweet --text ... [--media file1.png file2.jpg] [--draftOnly]
- bnbot post-thread --tweets [{text:...},{text:...}]
- bnbot submit-reply --text ... [--tweetUrl ] [--image ]
- bnbot quote-tweet --tweetUrl --text ... [--media ...] [--draftOnly]
互动
- - bnbot like-tweet [--tweetUrl ]
- bnbot unlike-tweet [--tweetUrl ]
- bnbot retweet [--tweetUrl ]
- bnbot unretweet [--tweetUrl ]
- bnbot follow-user [--username ]
- bnbot unfollow-user [--username ]
- bnbot bookmark-tweet [--tweetUrl ]
- bnbot unbookmark-tweet [--tweetUrl ]
- bnbot delete-tweet [--tweetUrl ]
数据抓取
- - bnbot scrape-timeline [--limit ] [--scrollAttempts ]
- bnbot scrape-bookmarks [--limit ]
- bnbot scrape-search-results --query ... [--tab top|latest|people|media|lists] [--limit ] [--from ] [--since YYYY-MM-DD] [--until YYYY-MM-DD] [--lang en] [--has images|videos|links|media] [--minLikes ] [--minRetweets ] [--minReplies ] [--excludeReplies] [--excludeRetweets]
- bnbot scrape-current-view
- bnbot scrape-thread [--tweetUrl ] [--maxScrolls ]
- bnbot account-analytics [--startDate YYYY-MM-DD] [--endDate YYYY-MM-DD] [--granularity Daily|Weekly|Monthly]
用户资料
- - bnbot scrape-user-profile --username
- bnbot scrape-user-tweets --username [--limit ] [--scrollAttempts ]
内容获取
- - bnbot fetch-wechat-article --url
- bnbot fetch-tiktok-video --url [--savePath ]
- bnbot fetch-xiaohongshu-note --url
文章
- - bnbot open-article-editor
- bnbot fill-article-title --title ...
- bnbot fill-article-body --content ... [--format plain|markdown|html] [--bodyImages img1 img2]
- bnbot upload-article-header-image --headerImage
- bnbot publish-article [--publish] [--asDraft]
- bnbot create-article --title ... --content ... [--format plain|markdown|html] [--headerImage ] [--bodyImages img1 img2] [--publish]
认证
- - bnbot login [--email ] — 通过邮箱验证登录BNBot
职位
- - bnbot search-jobs [--type boost|hire|all] [--status active|completed|expired] [--sort created_at|reward|deadline] [--limit ] [--keyword ...] [--endingSoon] [--token ETH|USDC|USDT]