hume-x
Fast X/Twitter CLI using GraphQL + cookie auth. Full API coverage for tweets, timelines, search, engagement, social, lists, trending, notifications, bookmarks, likes, and scheduled tweets.
Authentication
Uses cookie-based auth. Credentials are resolved in order:
- 1. CLI flags:
--auth-token and INLINECODE1 - Environment variables:
X_AUTH_TOKEN + X_CT0 (or AUTH_TOKEN + CT0) - Config file: INLINECODE6
- Browser cookies: Firefox (preferred) or Chrome
Run hume-x check to verify credentials. Use hume-x whoami to see the logged-in user.
Posting
CODEBLOCK0
Supports media upload: images (jpg/png/webp), GIFs, videos with chunked upload.
Reading
CODEBLOCK1
Accepts tweet ID or full URL (e.g. https://x.com/user/status/123).
Timeline
CODEBLOCK2
Supports cursor-based pagination with --cursor and --pages flags.
Search
CODEBLOCK3
Engagement
CODEBLOCK4
Collections
CODEBLOCK5
Social
CODEBLOCK6
Lists
CODEBLOCK7
Trending
CODEBLOCK8
Tabs: for-you (default), trending, news, sports, entertainment.
Notifications
CODEBLOCK9
Scheduled Tweets
CODEBLOCK10
User Info
CODEBLOCK11
Utility
CODEBLOCK12
Output Flags
- -
--json — parsed JSON output (pipe to jq for filtering) - INLINECODE18 — raw API response JSON
- INLINECODE19 — plain text without colors
- INLINECODE20 — disable ANSI colors
CODEBLOCK13
Global Flags
- -
--auth-token <token> — X auth token - INLINECODE22 — X ct0 CSRF token
- INLINECODE23 — request timeout
- INLINECODE24 — HTTPS/SOCKS5 proxy
- INLINECODE25 — number of results (default varies by command)
Important
- - Posting is rate-limited by X. If blocked, wait before retrying.
- Query IDs are auto-scraped from x.com with 24h cache. Use
hume-x refresh-ids if you get 404 errors. - Uses curl-impersonate for reliable HTTP requests to X's GraphQL API.
hume-x
使用GraphQL + cookie认证的快速X/Twitter命令行工具。完整API覆盖推文、时间线、搜索、互动、社交、列表、趋势、通知、书签、点赞和定时推文。
认证
采用基于cookie的认证方式。凭证按以下顺序解析:
- 1. 命令行标志:--auth-token 和 --ct0
- 环境变量:XAUTHTOKEN + XCT0(或 AUTHTOKEN + CT0)
- 配置文件:~/.config/hume-x/config.json
- 浏览器cookie:Firefox(首选)或Chrome
运行 hume-x check 验证凭证。使用 hume-x whoami 查看当前登录用户。
发布
bash
hume-x tweet 你好世界
hume-x tweet 看看这个 --media image.png --alt 描述
hume-x reply 好帖!
hume-x quote 有趣的观点
hume-x delete <推文id>
支持媒体上传:图片(jpg/png/webp)、GIF、视频(分块上传)。
阅读
bash
hume-x read
hume-x thread
hume-x replies -n 50
接受推文ID或完整链接(例如 https://x.com/user/status/123)。
时间线
bash
hume-x home -n 30
hume-x home --following
hume-x home --cursor abc123 --pages 3
hume-x user-tweets <用户名> -n 10
支持基于游标的分页,使用 --cursor 和 --pages 标志。
搜索
bash
hume-x search 查询 -n 20
hume-x search from:用户名 -n 10
hume-x mentions
hume-x mentions --user <用户名>
互动
bash
hume-x like <推文id>
hume-x retweet <推文id>
hume-x bookmark <推文id>
hume-x pin <推文id>
收藏
bash
hume-x bookmarks
hume-x likes
社交
bash
hume-x follow <用户名>
hume-x unfollow <用户名>
hume-x mute <用户名>
hume-x block <用户名>
hume-x following <用户名>
hume-x followers <用户名>
列表
bash
hume-x lists
hume-x lists --member-of
hume-x list-timeline <列表id>
趋势
bash
hume-x trending
hume-x trending --tab news
hume-x trending --tab sports
hume-x trending --tab entertainment
标签页:for-you(默认)、trending、news、sports、entertainment。
通知
bash
hume-x notifications
定时推文
bash
hume-x schedule 未来推文 --at 2025-06-01T12:00:00Z
用户信息
bash
hume-x whoami
hume-x about <用户名>
工具
bash
hume-x check # 验证认证凭证
hume-x query-ids # 显示缓存的GraphQL查询ID
hume-x refresh-ids # 从x.com强制刷新查询ID
输出标志
- - --json — 解析后的JSON输出(可管道至jq进行过滤)
- --json-full — 原始API响应JSON
- --plain — 纯文本,无颜色
- --no-color — 禁用ANSI颜色
bash
hume-x home --json | jq .[0].text
hume-x search 主题 --json -n 5
全局标志
- - --auth-token <令牌> — X认证令牌
- --ct0 <令牌> — X ct0 CSRF令牌
- --timeout <毫秒> — 请求超时
- --proxy <链接> — HTTPS/SOCKS5代理
- -n <数量> — 结果数量(默认值因命令而异)
重要提示
- - 发布受X的速率限制。若被限制,请等待后重试。
- 查询ID自动从x.com抓取,缓存24小时。若遇到404错误,请使用 hume-x refresh-ids。
- 使用curl-impersonate确保对X的GraphQL API的可靠HTTP请求。