Twitter Skill (Read-Only)
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).
Step 1: Ensure twitter-cli Is Installed and Authenticated
Before running any command, install and check auth:
bash
# Install (requires Python 3.10+)
command -v twitter || uv tool install twitter-cli
# Check authentication
twitter status --yaml >/dev/null && echo "AUTH_OK" || echo "AUTH_NEEDED"
If
, skip to Step 2. If
, guide the user:
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:
Chrome multi-profile: all profiles are scanned automatically. To specify one:
bash
TWITTER_CHROME_PROFILE="Profile 2" twitter feed
Method B: Environment variables
bash
export TWITTER_AUTH_TOKEN="<auth_token from browser>"
export TWITTER_CT0="<ct0 from browser>"
twitter whoami
Common auth issues
| Symptom | Fix |
|---|
| Login to x.com in browser, or set env vars |
| Re-login to x.com and retry |
Unable to get key for cookie decryption
(macOS) | Run security unlock-keychain ~/Library/Keychains/login.keychain-db
for SSH, or allow Terminal in Keychain Access |
Step 2: Identify What the User Needs
Match the user's request to one of the read commands below, then use the corresponding command from
.
| User Request | Command | Key Flags |
|---|
| Auth check | | |
| Who am I | | , |
| Home feed / timeline | | , , , |
| Search tweets | | , , , , , , |
| Bookmarks | | , |
| View a specific tweet | twitter tweet TWEET_ID_OR_URL
| |
| Open tweet from last list | | , |
| Twitter article | twitter article ID_OR_URL
| , , |
| List timeline | | , |
| User profile | | |
| User's tweets | twitter user-posts USERNAME
| , , |
| User's likes | | own account only (private since Jun 2024) |
| Followers | twitter followers USERNAME
| |
| Following | twitter following USERNAME
| |
Step 3: Execute the Command
General pattern
bash
# Use --yaml for structured output, -c for compact (token-efficient)
twitter feed --yaml --max 20
twitter -c feed --max 10 # Compact: ~80% fewer tokens than --json
# 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
Key rules
- Check auth first — run before any other command
- Use or for structured output when processing data programmatically
- Use / when token efficiency matters (LLM context)
- Use when the user wants complete tweet content (text is truncated by default in rich tables)
- Use to limit results — start with 10-20 unless the user asks for more
- For search, use filters — , , , ,
- Tweet IDs vs URLs — both work: or
twitter tweet https://x.com/user/status/1234567890
- Use to reference tweet #N from the most recent list output
- NEVER execute write operations — this skill is read-only; do not post, like, retweet, reply, quote, follow, or delete
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 |
Structured output envelope
All
and
output uses this envelope (see
):
yaml
ok: true
schema_version: "1"
data: ... # tweet/user lists or single objects
Error responses:
yaml
ok: false
schema_version: "1"
error:
code: api_error
message: "..."
Step 4: Present the Results
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
Step 5: Diagnostics
If something isn't working, run:
Reports version, OS, browser detection, keychain status, and cookie extraction results.
For verbose diagnostics on any command, add
.
Error 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 |
Proxy Configuration
bash
export TWITTER_PROXY=http://127.0.0.1:7890
# or
export TWITTER_PROXY=socks5://127.0.0.1:1080
Reference Files
- — Complete read command reference with all flags, research workflows, and usage examples
- — Structured output schema documentation
Read the reference files when you need exact command syntax, research workflow patterns, or schema details.