Skip to main content

Overview

twitter-cli is a powerful command-line tool that brings Twitter/X functionality directly to your terminal. Unlike traditional Twitter clients that require API keys and OAuth registration, twitter-cli uses browser cookie authentication to provide seamless access to Twitter’s features.

What is twitter-cli?

twitter-cli is a Python-based CLI tool that allows you to:
  • Read timelines, bookmarks, search results, and user profiles
  • Write tweets, replies, likes, retweets, and bookmarks
  • Export data as JSON for scripting and automation
  • Filter content with customizable engagement scoring
  • Stay anonymous with built-in anti-detection features
All from the comfort of your terminal, without needing to register for API access.

Key Features

Read Operations

  • Fetch home timeline (For You & Following feeds)
  • View bookmarks and saved tweets
  • Search tweets by keyword with multiple filters
  • View tweet details and replies
  • Browse user profiles, posts, and likes
  • List followers and following
  • Access Twitter List timelines

Write Operations

  • Post new tweets and replies
  • Delete your tweets
  • Like and unlike tweets
  • Retweet and unretweet
  • Bookmark and unbookmark tweets

Data Export

  • Export any data as JSON
  • Save filtered results to files
  • Process tweets programmatically
  • Build automation workflows

Advanced Features

  • Browser cookie authentication
  • TLS fingerprint impersonation
  • Full cookie forwarding for stealth
  • Proxy support (HTTP & SOCKS5)
  • Request timing jitter
  • Engagement-based ranking filters

How It Works

1

Cookie Authentication

twitter-cli automatically extracts cookies from your browser (Chrome, Firefox, Edge, or Brave) or uses environment variables. No API keys needed.
2

Anti-Detection

The tool uses curl_cffi for TLS fingerprint impersonation and forwards all browser cookies to make requests indistinguishable from real browser traffic.
3

Direct API Access

Communicates directly with Twitter’s GraphQL API endpoints, just like the web interface does.

Why twitter-cli?

Twitter’s official API requires registration, approval, and comes with strict rate limits. twitter-cli uses browser authentication, eliminating these barriers.
Perfect for developers who live in the terminal. Integrate Twitter into your shell scripts, automation workflows, and command-line tools.
Export any data as JSON for backup, analysis, or migration. Your data remains local and under your control.
Route requests through proxies, use residential IPs, and control your digital fingerprint. All cookies stay local—never uploaded.

Example Use Cases

  • Research & Analysis: Export tweets for sentiment analysis, trend research, or academic studies
  • Content Curation: Filter high-engagement tweets and save them for later
  • Automation: Build bots that monitor keywords and respond automatically
  • Backup: Archive your tweets, bookmarks, and likes locally
  • Multi-Account Management: Switch between accounts using different cookie sources
  • AI Agent Integration: Use as a skill for Claude Code, OpenClaw, or other AI agents

System Requirements

  • Python: 3.8 or higher
  • Browsers (for cookie extraction): Chrome, Firefox, Edge, or Brave
  • Operating Systems: Linux, macOS, or Windows
On macOS, Chrome cookies require Keychain access. The tool automatically handles this by running cookie extraction in the main process.

Getting Help

If you encounter issues or have questions:

Next Steps

Installation

Install twitter-cli using uv, pipx, or from source

Quick Start

Get from zero to your first successful command in minutes

Build docs developers (and LLMs) love