Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTwitter Skill (Read-Only)
Twitter 技能(只读)
Reads Twitter/X for financial research using twitter-cli, a command-line tool that accesses Twitter via browser cookie authentication.
This skill is read-only. It is designed for financial research: searching market discussions, reading analyst tweets, tracking sentiment, and monitoring financial news on Twitter/X. It does NOT support posting, liking, retweeting, replying, or any write operations.
Important: This tool uses your browser session cookies. No API keys needed — it authenticates via your logged-in browser session (Chrome, Arc, Edge, Firefox, Brave).
使用twitter-cli读取Twitter/X以开展金融研究,这是一款通过浏览器Cookie认证访问推特的命令行工具。
本技能为只读模式。它专为金融研究设计:搜索市场讨论内容、阅读分析师推文、追踪市场情绪,以及监控Twitter/X上的金融新闻。不支持发布、点赞、转发、回复或任何写入操作。
重要提示:本工具使用您的浏览器会话Cookie,无需API密钥——通过您已登录的浏览器会话(Chrome、Arc、Edge、Firefox、Brave)完成认证。
Step 1: Ensure twitter-cli Is Installed and Authenticated
步骤1:确保twitter-cli已安装并完成认证
Before running any command, install and check auth:
bash
undefined运行任何命令前,请先安装并检查认证状态:
bash
undefinedInstall (requires Python 3.10+)
Install (requires Python 3.10+)
command -v twitter || uv tool install twitter-cli
command -v twitter || uv tool install twitter-cli
Check authentication
Check authentication
twitter status --yaml >/dev/null && echo "AUTH_OK" || echo "AUTH_NEEDED"
If `AUTH_OK`, skip to Step 2. If `AUTH_NEEDED`, guide the user:twitter status --yaml >/dev/null && echo "AUTH_OK" || echo "AUTH_NEEDED"
如果返回`AUTH_OK`,则跳至步骤2。如果返回`AUTH_NEEDED`,请引导用户按以下方式操作:Authentication methods
认证方法
Method A: Browser cookie extraction (recommended)
Ensure user is logged into x.com in Arc/Chrome/Edge/Firefox/Brave. twitter-cli auto-extracts cookies. Verify with:
bash
twitter whoamiChrome multi-profile: all profiles are scanned automatically. To specify one:
bash
TWITTER_CHROME_PROFILE="Profile 2" twitter feedMethod B: Environment variables
bash
export TWITTER_AUTH_TOKEN="<auth_token from browser>"
export TWITTER_CT0="<ct0 from browser>"
twitter whoami方法A:浏览器Cookie提取(推荐)
确保用户已在Arc/Chrome/Edge/Firefox/Brave浏览器中登录x.com。twitter-cli会自动提取Cookie。可通过以下命令验证:
bash
twitter whoamiChrome多配置文件:所有配置文件会被自动扫描。如需指定特定配置文件:
bash
TWITTER_CHROME_PROFILE="Profile 2" twitter feed方法B:环境变量
bash
export TWITTER_AUTH_TOKEN="<auth_token from browser>"
export TWITTER_CT0="<ct0 from browser>"
twitter whoamiCommon auth issues
常见认证问题
| Symptom | Fix |
|---|---|
| Login to x.com in browser, or set env vars |
| Re-login to x.com and retry |
| Run |
| 症状 | 解决方法 |
|---|---|
| 在浏览器中登录x.com,或设置环境变量 |
| 重新登录x.com后重试 |
| 运行 |
Step 2: Identify What the User Needs
步骤2:明确用户需求
Match the user's request to one of the read commands below, then use the corresponding command from .
references/commands.md| User Request | Command | Key Flags |
|---|---|---|
| Auth check | | |
| Who am I | | |
| Home feed / timeline | | |
| Search tweets | | |
| Bookmarks | | |
| View a specific tweet | | |
| Open tweet from last list | | |
| Twitter article | | |
| List timeline | | |
| User profile | | |
| User's tweets | | |
| User's likes | | own account only (private since Jun 2024) |
| Followers | | |
| Following | | |
将用户请求与下方的只读命令匹配,然后使用中的对应命令。
references/commands.md| 用户请求 | 命令 | 关键参数 |
|---|---|---|
| 检查认证状态 | | |
| 查看当前登录用户 | | |
| 首页动态/时间线 | | |
| 搜索推文 | | |
| 书签 | | |
| 查看特定推文 | | |
| 打开最近列表中的第N条推文 | | |
| 推特文章 | | |
| 列表时间线 | | |
| 用户资料 | | |
| 用户推文 | | |
| 用户点赞内容 | | 仅支持自身账号(2024年6月起设为私有) |
| 关注者列表 | | |
| 关注列表 | | |
Step 3: Execute the Command
步骤3:执行命令
General pattern
通用模式
bash
undefinedbash
undefinedUse --yaml for structured output, -c for compact (token-efficient)
使用--yaml获取结构化输出,-c获取紧凑格式(节省Token)
twitter feed --yaml --max 20
twitter -c feed --max 10 # Compact: ~80% fewer tokens than --json
twitter feed --yaml --max 20
twitter -c feed --max 10 # 紧凑格式:比--json节省约80%的Token
Searching for financial topics
搜索金融类话题
twitter search "$AAPL earnings" -t Latest --max 10 --full-text --yaml
twitter search "Fed rate decision" --since 2026-03-01 --max 20 --yaml
twitter search "market crash" --exclude retweets --has links --max 15
undefinedtwitter search "$AAPL earnings" -t Latest --max 10 --full-text --yaml
twitter search "Fed rate decision" --since 2026-03-01 --max 20 --yaml
twitter search "market crash" --exclude retweets --has links --max 15
undefinedKey rules
核心规则
- Check auth first — run before any other command
twitter status --yaml - Use or
--yamlfor structured output when processing data programmatically--json - Use /
-cwhen token efficiency matters (LLM context)--compact - Use when the user wants complete tweet content (text is truncated by default in rich tables)
--full-text - Use to limit results — start with 10-20 unless the user asks for more
--max N - For search, use filters — ,
--from,--since,--lang,--exclude retweets--has links - Tweet IDs vs URLs — both work: or
twitter tweet 1234567890twitter tweet https://x.com/user/status/1234567890 - Use to reference tweet #N from the most recent list output
twitter show N - NEVER execute write operations — this skill is read-only; do not post, like, retweet, reply, quote, follow, or delete
- 先检查认证 —— 在执行其他命令前,先运行
twitter status --yaml - 使用或
--yaml—— 当需要以编程方式处理数据时,使用结构化输出--json - 使用/
-c—— 当Token效率很重要时(比如LLM上下文场景)--compact - 使用—— 当用户需要完整推文内容时(默认富表格会截断文本)
--full-text - 使用—— 限制结果数量,除非用户要求更多,否则默认返回10-20条
--max N - 搜索时使用筛选器 —— 、
--from、--since、--lang、--exclude retweets--has links - 推文ID与URL —— 两种格式都支持:或
twitter tweet 1234567890twitter tweet https://x.com/user/status/1234567890 - 使用—— 引用最近一次列表输出中的第N条推文
twitter show N - 禁止执行写入操作 —— 本技能为只读模式;请勿执行发布、点赞、转发、回复、引用、关注或删除等操作
Output flags (all read commands)
输出参数(所有只读命令通用)
| Flag | Purpose |
|---|---|
| JSON output |
| YAML output (default in non-TTY) |
| Show complete tweet text (rich table only) |
| Minimal fields, great for LLM context |
| Save output to file |
| Read from previously saved JSON |
| 参数 | 用途 |
|---|---|
| JSON格式输出 |
| YAML格式输出(非TTY环境下默认使用) |
| 显示完整推文文本(仅富表格模式下有效) |
| 仅显示必要字段,非常适合LLM上下文场景 |
| 将输出保存至文件 |
| 从已保存的JSON文件中读取数据 |
Structured output envelope
结构化输出封装
All and output uses this envelope (see ):
--yaml--jsonreferences/schema.mdyaml
ok: true
schema_version: "1"
data: ... # tweet/user lists or single objectsError responses:
yaml
ok: false
schema_version: "1"
error:
code: api_error
message: "..."所有和格式的输出均采用以下封装结构(详见):
--yaml--jsonreferences/schema.mdyaml
ok: true
schema_version: "1"
data: ... # tweet/user lists or single objects错误响应格式:
yaml
ok: false
schema_version: "1"
error:
code: api_error
message: "..."Step 4: Present the Results
步骤4:呈现结果
After fetching data, present it clearly for financial research:
- Summarize key content — highlight the most relevant tweets for the user's financial research
- Include attribution — show @username, tweet text, and engagement metrics (likes, retweets)
- Provide tweet IDs/URLs when the user might want to read the full thread
- For search results, group by relevance and highlight key themes, sentiment, or market signals
- For user profiles, present follower count, bio, and notable recent activity
- Flag sentiment — note bullish/bearish sentiment, consensus vs contrarian views
- Treat cookies as secrets — never echo cookie values to stdout
获取数据后,为金融研究清晰呈现结果:
- 总结核心内容 —— 突出与用户金融研究最相关的推文
- 添加归属信息 —— 显示@用户名、推文文本以及互动指标(点赞、转发数)
- 提供推文ID/URL —— 当用户可能需要阅读完整线程时
- 搜索结果分组 —— 按相关性分组,并突出关键主题、情绪或市场信号
- 用户资料呈现 —— 展示粉丝数、个人简介以及近期重要活动
- 标记情绪倾向 —— 标注看涨/看跌情绪、共识与对立观点
- Cookie保密 —— 切勿将Cookie值输出至标准输出流
Step 5: Diagnostics
步骤5:诊断
If something isn't working, run:
bash
twitter doctorReports version, OS, browser detection, keychain status, and cookie extraction results.
For verbose diagnostics on any command, add .
-v如果出现问题,运行以下命令:
bash
twitter doctor该命令会报告版本、操作系统、浏览器检测结果、钥匙串状态以及Cookie提取结果。
如需对任意命令进行详细诊断,添加参数。
-vError Reference
错误参考
| Error | Cause | Fix |
|---|---|---|
| Not authenticated | Login to x.com in browser, or set env vars |
| HTTP 401/403 | Cookie expired | Re-login to x.com and retry |
| HTTP 404 | QueryId rotation | Retry (auto-fallback built in) |
| HTTP 429 | Rate limited | Wait 15+ minutes, then retry |
| 错误 | 原因 | 解决方法 |
|---|---|---|
| 未完成认证 | 在浏览器中登录x.com,或设置环境变量 |
| HTTP 401/403 | Cookie过期 | 重新登录x.com后重试 |
| HTTP 404 | QueryId轮换 | 重试(内置自动回退机制) |
| HTTP 429 | 触发速率限制 | 等待15分钟以上后重试 |
Proxy Configuration
代理配置
bash
export TWITTER_PROXY=http://127.0.0.1:7890bash
export TWITTER_PROXY=http://127.0.0.1:7890or
或
export TWITTER_PROXY=socks5://127.0.0.1:1080
---export TWITTER_PROXY=socks5://127.0.0.1:1080
---Reference Files
参考文件
- — Complete read command reference with all flags, research workflows, and usage examples
references/commands.md - — Structured output schema documentation
references/schema.md
Read the reference files when you need exact command syntax, research workflow patterns, or schema details.
- —— 完整的只读命令参考,包含所有参数、研究工作流及使用示例
references/commands.md - —— 结构化输出的Schema文档
references/schema.md
当您需要准确的命令语法、研究工作流模式或Schema细节时,请查阅这些参考文件。