explaingit

sferik/x-cli

5,545RubyAudience · developerComplexity · 2/5Setup · moderate

TLDR

A command-line tool for interacting with X (formerly Twitter) from a terminal, search posts, stream live feeds, manage lists, and switch between multiple accounts without opening a browser.

Mindmap

mindmap
  root((repo))
    What it does
      X API client
      Terminal interface
      Multi-account support
    Features
      Live post streaming
      List management
      Tab completion
    Setup
      Ruby runtime
      API credentials
      YAML config file
    Use Cases
      Monitor keywords
      Bulk post deletion
      Automation scripts
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Stream live posts matching a keyword filter directly to your terminal for real-time monitoring without opening a browser.

USE CASE 2

Write a shell script that bulk-deletes old posts or manages follower lists without touching the X website.

USE CASE 3

Watch activity from a specific list of accounts and pipe the output into a file or another script.

Tech stack

Ruby

Getting it running

Difficulty · moderate Time to first run · 30min

Requires X developer API credentials and OAuth setup before first use, prebuilt binaries available for Windows, macOS, and Linux.

License not specified in the explanation.

In plain English

x-cli is a command-line tool for interacting with the X (formerly Twitter) API from a terminal. Instead of using the X website or a mobile app, you type commands to search posts, manage lists, delete content, follow streams of activity, and switch between multiple accounts. The tool supports both the older and newer versions of the X API and handles authentication automatically using industry-standard login protocols. When the API returns a temporary error, the tool retries the request on its own rather than failing immediately. You can configure it with a YAML file stored in your home directory, and it includes tab completion for the shell so you do not need to remember every command name. Output is formatted in aligned columns for easier reading in a terminal. Stream commands let you watch a live feed of posts matching filters, a sample of all public posts, or activity from specific users or lists. A setting lets you cap how many events a stream emits, which is useful when writing scripts or running automated tests against the tool. The project ships prebuilt binaries for Windows, macOS, and Linux on both regular and ARM chips, so you do not need to compile anything to get started. The README is brief and covers the main command groups and configuration basics without going into detail on every option.

Copy-paste prompts

Prompt 1
Using x-cli, write a shell one-liner that streams posts matching a keyword and saves new results to a CSV file every hour.
Prompt 2
I have x-cli configured. Show me the commands to delete all my posts from before a specific date in bulk.
Prompt 3
Help me set up x-cli for two different X accounts using YAML config and show me how to switch between them when posting.
Prompt 4
Using x-cli, write a script that watches a list for new posts containing a specific term and sends a desktop notification for each match.
Open on GitHub → Explain another repo

← sferik on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.