mcpField
X
x-cli

x-cli

github.com/dl-alexandreMarketing & growth139 installsUpdated 4w ago
Repository

About x-cli

X CLI is a command-line tool for interacting with the X API, for managing posts, accounts, and social activity. It includes publishing, search, media, lists, bookmarks, and analytics commands.

Key features

  1. 01Post, reply to, and delete tweets
  2. 02Read timelines, mentions, and likes
  3. 03Search posts with query filters
  4. 04Upload media and attach it to posts
  5. 05Manage users, lists, and bookmarks
  6. 06View analytics and export tweets

Use cases

  1. 01Publish posts and threaded updates
  2. 02Find posts matching topics or accounts
  3. 03Review follower growth and export tweet data

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/dl-alexandre/skills --skill x-cli

After installing, type/x-cliin Claude Code to confirm it loaded.

Details

From the project README

X CLI

Interact with X API using the x command-line tool.

Prerequisites

x --version
export X_API_KEY='your-api-key'
export X_API_SECRET='your-api-secret'
export X_ACCESS_TOKEN='your-access-token'
export X_ACCESS_SECRET='your-access-secret'
x auth status

Authentication

  • API credentials from X Developer Portal
  • Environment variables: X_API_KEY, X_API_SECRET, X_ACCESS_TOKEN, X_ACCESS_SECRET
  • Or: x auth login for OAuth flow

Tweets

Create & Manage
x tweet "Hello from the CLI!"
x tweet "Check this out" --media ./image.png
x tweet "Thread part 1" --thread
x tweet "Thread part 2" --reply-to TWEET_ID
x delete TWEET_ID --confirm
Read Timeline
x timeline --limit 50
x timeline --user USERNAME --limit 20
x mentions --limit 20
x likes --user USERNAME
Search
x search --query "#javascript" --limit 100
x search --query "from:elonmusk" --recent
x search --query "AI filter:images" --limit 50

Media

x upload ./image.jpg --alt "Description"
x upload ./video.mp4 --media-type video
x tweet "Video content" --media MEDIA_ID

Users

x user get USERNAME
x user followers USERNAME --limit 100
x user following USERNAME --limit 100
x follow USERNAME
x unfollow USERNAME --confirm

Lists & Bookmarks

x lists list
x lists get LIST_ID --tweets
x lists create "Tech News" --description "Technology updates"
x bookmarks --limit 50

Analytics

x analytics tweets --days 30
x analytics followers --growth
x export tweets --start 2024-01-01 --format csv

Agent Best Practices

  1. Rate limits: Respect X API rate limits (check x limits)
  2. Tweet length: 280 characters max (4,000 for X Premium)
  3. Media formats: JPG, PNG, GIF, MP4 supported
  4. Thread safety: Use --thread flag for multi-tweet threads

Comments

Markdown supported