twitter-cli: Twitter/X CLI Without API Keys

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_PROXY environment 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)

  1. βœ… Use proxies: export TWITTER_PROXY=socks5://127.0.0.1:1080
  2. βœ… Limit requests: --max 20 instead of --max 500
  3. βœ… Browser cookies: Full fingerprint protection
  4. βœ… Residential proxies > datacenter IPs
  5. βœ… 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! πŸš€

GitHub Repo | PyPI

Original Article: View Original

Share this article