Use xfetch CLI to fetch X/Twitter data - tweets, user profiles, search results, timelines, lists, DMs, and notifications. Use this skill whenever you need to retrieve any data from X/Twitter, whether the user asks to "get tweets", "look up a Twitter user", "search X for...", "check my timeline", "fetch bookmarks", "read DMs", or any variation involving X/Twitter data retrieval. Also use when the user pastes a tweet URL and wants its content, or asks to export Twitter data to CSV/JSON/SQLite.
xfetch 是一个基于 Cookie 的 X/Twitter 命令行抓取工具。它不需要 API 密钥——只需浏览器 Cookie 即可进行身份验证。它作为 xfetch 全局安装(或可通过 npx @lxgic/xfetch / bunx @lxgic/xfetch 运行)。
必须先设置身份验证。使用以下命令检查:
bash
xfetch auth check
如果未通过身份验证,从用户浏览器中提取 Cookie:
bash
xfetch auth extract --browser chrome # 或 firefox, safari, arc, brave
xfetch auth extract --browser chrome --profile Profile 1 # 指定配置文件
或直接设置令牌:
bash
xfetch auth set --auth-token
接受推文 URL 或数字 ID:
bash
xfetch tweet https://x.com/user/status/123456789
xfetch tweet 123456789
也支持 X 文章 URL(/article/ID)。
bash
xfetch user @handle # 通过用户名(@ 可选)
xfetch user 12345678 # 通过数字 ID
bash
xfetch tweets @handle # 最新 20 条推文
xfetch tweets @handle -n 50 # 每页 50 条
xfetch tweets @handle --replies # 包含回复
xfetch tweets @handle --all # 所有页面(分页)
xfetch tweets @handle --max-pages 5 # 限制为 5 页
bash
xfetch thread
bash
xfetch search query # 热门结果
xfetch search query --type latest # 最新推文
xfetch search query --type people # 用户结果
xfetch search query --type photos # 图片推文
xfetch search query --type videos # 视频推文
xfetch search from:handle since:2024-01-01 # 高级运算符
xfetch search query -n 100 --all # 所有页面
搜索类型:top(默认)、latest、people、photos、videos。
bash
xfetch home # 算法推荐首页时间线
xfetch home --following # 按时间顺序(仅关注)
xfetch bookmarks # 你的书签
xfetch likes @handle # 用户点赞的推文
bash
xfetch followers @handle -n 100
xfetch following @handle -n 100
bash
xfetch lists @handle # 用户的列表
xfetch list
xfetch list-members
xfetch list-tweets
bash
xfetch dms # 收件箱概览
xfetch dms inbox # 同上
xfetch dms conversation
xfetch dms
bash
xfetch notifications # 所有通知
xfetch mentions # 仅提及
xfetch verified-notifications # 来自认证账户
bash
xfetch auth check # 显示身份验证状态
xfetch auth extract --browser chrome # 提取 Cookie
xfetch auth set --auth-token
xfetch auth clear # 清除保存的身份验证
xfetch auth browsers # 列出可用浏览器和配置文件
bash
xfetch query-ids --refresh # 从 X 前端获取最新查询 ID
xfetch query-ids --list # 显示缓存的查询 ID
所有列表类命令(tweets、search、followers、following、likes、bookmarks、home、notifications、mentions、list-members、list-tweets、dms inbox、dms conversation)都支持以下分页选项:
| 标志 | 描述 |
|---|---|
| -n, --count <N> | 每页结果数(默认:20) |
| --all |
使用 --format 控制输出:
bash
xfetch tweets @handle --format json # 美化打印的 JSON(默认)
xfetch tweets @handle --format jsonl # 换行分隔的 JSON(流式)
xfetch tweets @handle --format csv # 带标题的 CSV
xfetch tweets @handle --format sqlite --db tweets.db # SQLite 数据库
额外输出标志:
使用 shell 重定向管道到文件:
bash
xfetch tweets @handle -n 100 --format csv > tweets.csv
xfetch search AI --all --format jsonl > results.jsonl
这些选项可传递给任何命令:
| 标志 | 描述 |
|---|---|
| --auth-token <token> | 覆盖 auth_token Cookie |
| --ct0 <token> |
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 xfetch-1776200545 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 xfetch-1776200545 技能
skillhub install xfetch-1776200545
文件大小: 2.99 KB | 发布时间: 2026-4-15 11:51