twitter-cli: Twitter/X CLI Without API Keys
March 10, 2026
Category:
Practical Open Source Projects
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! π
Original Article:
View Original