xurl — X (Twitter) API CLI
xurl is a CLI tool for the X API. It supports posting tweets, searching, reading posts, managing followers, and interacting with any X API v2 endpoint.
Prerequisites
This skill requires the xurl CLI utility and X API credentials:
-
X_API_KEY
-
Your X API key
-
X_API_SECRET
-
Your X API secret
-
X_ACCESS_TOKEN
-
Your access token
-
X_ACCESS_SECRET
-
Your access token secret
Install the CLI:
Via Homebrew
brew install --cask xdevplatform/tap/xurl
Via npm
npm install -g @xdevplatform/xurl
Via Go
go install github.com/xdevplatform/xurl@latest
Common Commands
Post a Tweet
xurl tweet "Your tweet content here"
Reply to a Tweet
xurl reply <tweet_id> "Your reply content"
Quote Tweet
xurl quote <tweet_id> "Your quote comment"
Search Tweets
xurl search "query" --max-results 10
Get User Tweets
xurl user <username> --limit 10
Get Tweet by ID
xurl tweet-id <tweet_id>
Get User Info
xurl user-info <username>
Follow/Unfollow
xurl follow <username> xurl unfollow <username>
Get Followers
xurl followers <username> --limit 10
Get Following
xurl following <username> --limit 10
Send DM
xurl dm <username> "Your message"
Upload Media
xurl upload <image_path>
Post Tweet with Media
xurl tweet "Check this out!" --media <image_path>
Security Notes
-
Never expose credentials in logs or chat
-
Use environment variables for sensitive data
-
Keep tokens secure and rotate periodically