Install
openclaw skills install @tobewin/x-helperFull-featured X (Twitter) assistant — search, post with media, thread, DM, Lists, bookmarks, trends, articles, block/mute, and more. Pure Python stdlib.
openclaw skills install @tobewin/x-helper通过自然语言操作 X(Twitter)。纯 Python stdlib,覆盖 X API v2 完整能力。
搜帖子 · 查用户 · 发推(带图/视频/GIF) · 发线程 · 管书签 · 看趋势 · 发文章 · DM · Lists · 屏蔽/静音 · 关注/取关
⚠️ 数据外发提醒:推文内容、私信、媒体文件、搜索查询、用户信息及 Bearer Token 将被发送至 X API 服务器(api.x.com / api.twitter.com)。请勿在自动化环境中处理敏感/机密内容。
⚠️ 凭据由你掌握:推荐把 Bearer Token 放进自己的环境变量
X_BEARER_TOKEN(你自己执行 export,AI 只读取、不存储、不中转)。Token 通过 Python 内存传递,不会暴露在进程列表或 shell 历史中。
http://localhost:8080/callback在你自己电脑的终端里执行(AI 不会看到你输入的 token):
export X_BEARER_TOKEN='你的 X API Bearer Token'
💡 从 X Developer Portal 的 App 页面复制 Bearer Token,自己粘贴到终端。 这个 token 存在你自己的 shell 环境变量里,AI 只读取、不存储、不中转。
auth authorize 会跑一次 OAuth 2.0 浏览器授权,把 Token 缓存到
~/.x-helper/auth.json。本 skill 不会自动读取该文件来发请求——
授权完成后请把拿到的 Token 自己 export X_BEARER_TOKEN=... 再使用。
(缓存文件仅由你手动运行的 auth status / auth logout 读取。)
python3 scripts/x_client.py auth authorize --client-id YOUR_CLIENT_ID
python3 scripts/x_client.py auth status
search postssearch posts --archivesearch userssearch newsuser getuser meuser timelineuser mentionsuser followers / followinguser likedtweet post(带 --media 可发图片)tweet deletetweet gettweet like / unliketweet retweetthread post --text1 "" --text2 ""trendstrends listbookmark listbookmark addbookmark removearticle draft --title "" --text ""article draft --title "" --text "" --richarticle publishdm listdm conversation [conversation-id]dm send username textdm deletelist createlist mylist memberslist add-memberlist remove-memberlist followlist postsblockunblockblockedmuteunmutemutedfollowunfollow search posts <query> [--max N] [--archive] 搜帖子(--archive 全量归档)
search users <query> [--max N] 搜用户
search news <query> [--max N] 搜新闻
user get <username> 用户信息
user me 当前用户
user timeline <username> [--max N] 最近推文
user mentions <username> [--max N] 提及
user followers <username> [--max N] 关注者
user following <username> [--max N] 正在关注
user liked <username> [--max N] 赞过的推文
tweet post <text> [--reply-to ID] [--media path]...
tweet get <id>
tweet delete <id>
tweet like <id>
tweet unlike <id>
tweet retweet <id>
tweet unretweet <id>
tweet likers <id> [--max N]
tweet retweeters <id> [--max N]
tweet quote-tweets <id> [--max N]
thread post --text1 "第一段" --text2 "第二段" [--text3 "第三段" ...] [--media path]
trends [--woeid N]
trends list
bookmark list [--max N]
bookmark add <tweet-id>
bookmark remove <tweet-id>
article draft --title "标题" --text "内容" [--rich]
article publish <article-id>
dm list [--max N]
dm conversation <id> [--max N]
dm send <username> <text> --confirm
dm delete <event-id> --confirm
⚠️ 私信敏感:
dm conversation输出的是私信内容(非公开数据),不要外泄。dm send/dm delete为不可逆操作,必须显式加--confirm才会执行。
list create <name> [--description <desc>]
list get <id>
list delete <id>
list members <id> [--max N]
list posts <id> [--max N]
list followers <id> [--max N]
list add-member <list-id> <username>
list remove-member <list-id> <username>
list follow <list-id>
list unfollow <list-id>
list my [--max N]
block <username>
unblock <username>
blocked [--max N]
mute <username>
unmute <username>
muted [--max N]
follow <username>
unfollow <username>
--rich 支持 # 标题、加粗、斜体、列表--archive 走 /tweets/search/all(需对应 API tier)图片发推: python3 scripts/x_client.py tweet post "内容" --media photo.jpg --media photo2.png
发线程: python3 scripts/x_client.py thread post --text1 "第一段" --text2 "第二段"
看趋势指定地点: python3 scripts/x_client.py trends --woeid 23424856(WOEID 23424856 = 日本)
全量搜索: python3 scripts/x_client.py search posts "from:user since:2020-01-01" --archive