twitter-cli: Twitter/X CLI Without API Keys
Discover twitter-cli, the ultimate terminal tool for Twitter/X that bypasses API keys using browser cookies. Read timelines, bookmarks, search tweets, view profiles, and even post/delete/like—all from your command line. With anti-detection features like TLS fingerprinting and proxy support, it's ban-resistant and perfect for power users and AI agents. Install with one command and manage Twitter without restrictions.
twitter-cli: Power Twitter/X from Your Terminal (No API Keys Needed)
In a world where Twitter/X API access costs thousands monthly, twitter-cli offers a free, powerful alternative. This Python CLI uses your browser cookies for authentication, making requests indistinguishable from real browser traffic. No API keys, no rate limits from official restrictions—just pure terminal power.
🚀 Key Features
Read Operations
- Timeline: For-you and following feeds (
twitter feed) - Bookmarks: List your saved tweets (
twitter bookmarks) - Search: Keyword search with Top/Latest/Photos tabs
- User Profiles: Tweets, likes, followers, following
- Tweet Details: View tweets + threaded replies
- JSON Export: Perfect for scripting/automation
- Smart Filtering: Engagement-based tweet scoring
Write Operations
- Post tweets and replies
- Delete your tweets
- Like/unlike, retweet/unretweet
- Bookmark/unbookmark tweets
Anti-Detection Magic
- Full Cookie Forwarding: All browser cookies extracted
- TLS Fingerprint: Impersonates Chrome dynamically
- Request Jitter: Random timing to evade patterns
- Proxy Support:
TWITTER_PROXYenvironment variable - Rate Limiting: Built-in delays and retries
🎯 Quick Start
# Install (1 command)
uv tool install twitter-cli
# Your timeline
twitter feed
# Following only
twitter feed -t following
# Elon Musk's recent posts
twitter user-posts elonmusk --max 20
# Search with ranking filter
twitter search "AI agents" --filter
# Export to JSON
twitter bookmarks --json > my_bookmarks.json
🔐 Authentication (Zero Setup)
Automatic: Logs into your default browser (Chrome/Arc/Edge/Firefox/Brave)
Manual: Set TWITTER_AUTH_TOKEN + TWITTER_CT0 environment variables
⚙️ Configuration
Create config.yaml:
fetch:
count: 50
filter:
mode: "topN"
topN: 20
weights:
likes: 1.0
retweets: 3.0
bookmarks: 5.0
rateLimit:
requestDelay: 2.5
maxRetries: 3
🛡️ Stay Safe (Anti-Ban Best Practices)
- ✅ Use proxies:
export TWITTER_PROXY=socks5://127.0.0.1:1080 - ✅ Limit requests:
--max 20instead of--max 500 - ✅ Browser cookies: Full fingerprint protection
- ✅ Residential proxies > datacenter IPs
- ✅ Random delays built-in
🤖 AI Agent Integration
Includes SKILL.md for Claude Code, OpenClaw, and other AI frameworks:
# For Claude/Antigravity
mkdir -p .agents/skills
curl -o .agents/skills/twitter-cli/SKILL.md https://raw.githubusercontent.com/jackwener/twitter-cli/main/SKILL.md
📦 Installation Options
# Fastest: uv tool (recommended)
uv tool install twitter-cli
# pipx
pipx install twitter-cli
# From source
git clone https://github.com/jackwener/twitter-cli.git
cd twitter-cli
uv sync
Why twitter-cli Stands Out
| Feature | twitter-cli | Official API | Scrapers |
|---|---|---|---|
| Cost | Free | $100-5000/mo | Free |
| Rate Limits | Browser-like | Strict quotas | Frequent bans |
| Auth | Cookies | API keys | Complex |
| Write Support | ✅ Post/Delete/Like | ✅ | ❌ Usually |
| Anti-Detection | Advanced | N/A | Basic |
Stars: 1.1k+ | Apache 2.0 License | Actively maintained
Get twitter-cli today and reclaim control of your Twitter/X experience from the terminal! 🚀