- Change Console() to Console(stderr=True) so all status/progress messages go to stderr, keeping stdout pure JSON when --json is used - Add missing exception handling in likes command for fetch_user - Fix SKILL.md: favorite -> favorites (correct command name)
78 lines
1.5 KiB
Markdown
78 lines
1.5 KiB
Markdown
---
|
|
name: twitter-cli
|
|
description: CLI skill for Twitter/X to read timelines, bookmarks, user posts, and profiles from the terminal without API keys
|
|
author: jackwener
|
|
version: "1.0.0"
|
|
tags:
|
|
- twitter
|
|
- x
|
|
- social-media
|
|
- terminal
|
|
- cli
|
|
---
|
|
|
|
# twitter-cli Skill
|
|
|
|
Use this skill when the user wants to read Twitter/X content from terminal without API keys.
|
|
|
|
## Requirements
|
|
|
|
- `twitter-cli` installed and available in PATH.
|
|
- User is logged in to `x.com` in Chrome/Edge/Firefox/Brave, or sets:
|
|
- `TWITTER_AUTH_TOKEN`
|
|
- `TWITTER_CT0`
|
|
|
|
## Core Commands
|
|
|
|
```bash
|
|
# Home timeline (For You)
|
|
twitter feed
|
|
|
|
# Following timeline
|
|
twitter feed -t following
|
|
|
|
# Bookmarks
|
|
twitter favorites
|
|
|
|
# User profile and posts
|
|
twitter user <screen_name>
|
|
twitter user-posts <screen_name> --max 20
|
|
```
|
|
|
|
## JSON / Scripting
|
|
|
|
```bash
|
|
# Export feed as JSON
|
|
twitter feed --json > tweets.json
|
|
|
|
# Read from local JSON file
|
|
twitter feed --input tweets.json
|
|
```
|
|
|
|
## Ranking Filter
|
|
|
|
Filtering is opt-in (disabled by default). Enable with `--filter`.
|
|
|
|
```bash
|
|
twitter feed --filter
|
|
twitter favorites --filter
|
|
```
|
|
|
|
The scoring formula:
|
|
|
|
```text
|
|
score = likes_w * likes
|
|
+ retweets_w * retweets
|
|
+ replies_w * replies
|
|
+ bookmarks_w * bookmarks
|
|
+ views_log_w * log10(max(views, 1))
|
|
```
|
|
|
|
Configure weights and mode in `config.yaml`.
|
|
|
|
## Safety Notes
|
|
|
|
- Do not ask users to share raw cookie values in chat logs.
|
|
- Prefer local browser cookie extraction over manual secret copy/paste.
|
|
- If auth fails with 401/403, ask the user to re-login to `x.com`.
|