docs: rename rt/unrt → retweet/unretweet, update SKILL.md + README.md

- Rename rt/unrt commands to retweet/unretweet for clarity
- SKILL.md: fix Python version, add --output/--filter examples, safety notes
- README.md: dynamic Chrome fingerprint, write delays, --output examples
- Sync Chinese section with English changes
This commit is contained in:
jackwener
2026-03-09 21:20:05 +08:00
parent 8313a7012f
commit bbe0bc8de3
5 changed files with 25 additions and 7 deletions

View File

@@ -37,9 +37,10 @@ A terminal-first CLI for Twitter/X: read timelines, bookmarks, and user profiles
**Auth & Anti-Detection:**
- Cookie auth: use browser cookies or environment variables
- Full cookie forwarding: extracts ALL browser cookies for true browser fingerprint
- TLS fingerprint impersonation: `curl_cffi` with Chrome 133 JA3/HTTP2
- TLS fingerprint impersonation: `curl_cffi` with dynamic Chrome version matching
- `x-client-transaction-id` header generation
- Request timing jitter to avoid pattern detection
- Write operation delays (1.54s random) to mitigate rate limits
- Proxy support via `TWITTER_PROXY` environment variable
### Installation
@@ -89,6 +90,8 @@ twitter favorites --max 30 --json
twitter search "Claude Code"
twitter search "AI agent" -t Latest --max 50
twitter search "机器学习" --json
twitter search "topic" -o results.json # Save to file
twitter search "trending" --filter # Apply ranking filter
# Tweet detail (view tweet + replies)
twitter tweet 1234567890
@@ -100,7 +103,9 @@ twitter list 1539453138322673664
# User
twitter user elonmusk
twitter user-posts elonmusk --max 20
twitter user-posts elonmusk -o tweets.json
twitter likes elonmusk --max 30
twitter likes elonmusk -o likes.json
twitter followers elonmusk --max 50
twitter following elonmusk --max 50
@@ -290,9 +295,10 @@ After installation, OpenClaw can call `twitter-cli` commands directly.
**认证与反风控:**
- Cookie 认证:支持环境变量和浏览器自动提取
- 完整 Cookie 转发:提取浏览器中所有 Twitter Cookie
- TLS 指纹伪装:`curl_cffi` Chrome 133 JA3/HTTP2
- TLS 指纹伪装:`curl_cffi` 动态匹配 Chrome 版本
- `x-client-transaction-id` 请求头生成
- 请求时序随机化jitter
- 写操作随机延迟1.54 秒),降低频率风控
- 代理支持:`TWITTER_PROXY` 环境变量
### 安装
@@ -316,6 +322,8 @@ twitter favorites
# 搜索
twitter search "Claude Code"
twitter search "AI agent" -t Latest --max 50
twitter search "topic" -o results.json # 保存到文件
twitter search "trending" --filter # 启用排序筛选
# 推文详情
twitter tweet 1234567890
@@ -326,7 +334,9 @@ twitter list 1539453138322673664
# 用户
twitter user elonmusk
twitter user-posts elonmusk --max 20
twitter user-posts elonmusk -o tweets.json
twitter likes elonmusk --max 30
twitter likes elonmusk -o likes.json
twitter followers elonmusk
twitter following elonmusk

View File

@@ -18,7 +18,7 @@ Use this skill when the user wants to read or interact with Twitter/X content fr
## Prerequisites
```bash
# Install (requires Python 3.10+)
# Install (requires Python 3.8+)
uv tool install twitter-cli
# Or: pipx install twitter-cli
```
@@ -55,6 +55,8 @@ twitter favorites --filter # Apply ranking filter
twitter search "keyword"
twitter search "AI agent" -t Latest --max 50
twitter search "机器学习" --json
twitter search "topic" -o results.json # Save to file
twitter search "trending" --filter # Apply ranking filter
```
### Tweet Detail
@@ -75,7 +77,9 @@ twitter list 1539453138322673664 # Fetch tweets from a Twitter List
```bash
twitter user elonmusk # User profile
twitter user-posts elonmusk --max 20 # User's tweets
twitter user-posts elonmusk -o tweets.json # Save to file
twitter likes elonmusk --max 30 # User's likes
twitter likes elonmusk -o likes.json # Save to file
twitter followers elonmusk --max 50 # User's followers
twitter following elonmusk --max 50 # User's following
```
@@ -101,6 +105,8 @@ twitter feed --json > tweets.json
twitter feed --input tweets.json
twitter user-posts elonmusk --json | jq '.[0].text'
twitter search "keyword" --json | jq 'length'
twitter search "topic" -o results.json
twitter likes elonmusk -o likes.json
```
## Ranking Filter
@@ -149,6 +155,8 @@ twitter favorites --filter
## Safety Notes
- Write operations have built-in random delays (1.54s) to avoid rate limits.
- TLS fingerprint and User-Agent are automatically matched to the Chrome version used.
- 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`.

View File

@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "twitter-cli"
version = "0.4.4"
version = "0.4.5"
description = "A CLI for Twitter/X — feed, bookmarks, and user timeline in terminal"
readme = "README.md"
license = "Apache-2.0"

View File

@@ -486,7 +486,7 @@ def unlike(tweet_id):
@cli.command()
@click.argument("tweet_id")
def rt(tweet_id):
def retweet(tweet_id):
# type: (str,) -> None
"""Retweet a tweet. TWEET_ID is the numeric tweet ID."""
_write_action("🔄", "Retweeting", "retweet", tweet_id)
@@ -494,7 +494,7 @@ def rt(tweet_id):
@cli.command()
@click.argument("tweet_id")
def unrt(tweet_id):
def unretweet(tweet_id):
# type: (str,) -> None
"""Undo a retweet. TWEET_ID is the numeric tweet ID."""
_write_action("🔄", "Undoing retweet", "unretweet", tweet_id)

2
uv.lock generated
View File

@@ -950,7 +950,7 @@ wheels = [
[[package]]
name = "twitter-cli"
version = "0.4.3"
version = "0.4.4"
source = { editable = "." }
dependencies = [
{ name = "beautifulsoup4" },