X (Twitter) API

CLI tool for authenticated X (Twitter) API requests. Post tweets, reply, quote, search, read posts, manage followers, send DMs, and upload media.

xurl is X's (Twitter's) official CLI tool, built by the X Developer Platform team and optimized for AI agent workflows. It gives OpenClaw authenticated access to the full X API v2 — posting tweets, replying, quoting, searching, reading timelines, managing followers, sending DMs, and uploading media. All through clean one-liner commands that return JSON. The tool supports two modes: shortcut commands (human and agent-friendly one-liners like `xurl post 'Hello world'`) and raw curl-style access to any v2 endpoint for advanced use cases. Authentication is handled via OAuth 2.0, with credentials stored securely in ~/.xurl. The skill enforces strict security — it explicitly forbids reading or exposing credential files, using verbose mode (which can leak tokens), or passing secrets as command arguments. xurl supports action chaining for complex workflows — read a thread, analyze sentiment, draft a reply, post it. Multiple apps can be registered for different accounts, and you switch between them seamlessly. It's available via Homebrew, npm, Go install, or a direct install script. This is the recommended way to give your OpenClaw agent a Twitter/X presence. Whether you're building a personal posting workflow, monitoring mentions, researching topics, or automating engagement, xurl provides the API access with proper guardrails. The skill's security model is notably careful — a refreshing approach for a social media integration.

Tags: twitter, x, social-media, api, posting

Category: Social Media

Use Cases

  • Automated posting — schedule and publish tweets from your AI workflow
  • Mention monitoring — track replies and mentions, draft responses
  • Research and analysis — search tweets on topics for market research
  • Thread publishing — write and post multi-tweet threads
  • Engagement automation — like, reply, and retweet based on criteria
  • Content repurposing — turn blog posts or notes into tweet threads

Tips

  • Run `xurl auth status` to verify credentials are configured before any operations
  • Use `xurl search` for research and trend monitoring — powerful for content strategy
  • Register multiple apps for different accounts and switch between them
  • Pair with cron for scheduled posting — draft tweets and queue them for optimal times
  • Use `xurl thread` to post multi-tweet threads in a single command
  • Always verify tweet content before posting — the skill confirms but double-check anyway

Known Issues & Gotchas

  • NEVER use --verbose/-v in agent sessions — it exposes auth tokens in output
  • Credential file ~/.xurl must be set up manually by the user, never by the AI agent
  • X API v2 has strict rate limits — 1500 tweets/month on free tier, 100 reads per 15 min
  • OAuth 2.0 tokens expire — re-auth with `xurl auth oauth2` when you get 401 errors
  • Free tier X API is severely limited — most useful features require Basic ($100/mo) or Pro ($5000/mo)
  • Media uploads require separate API calls before attaching to tweets — not a single command

Alternatives

  • Postiz Agent
  • bird (community skill)
  • x-research-skill
  • Typefully API

Community Feedback

Excited to push xurl 1.0.3 — our official X API CLI tool optimized for agents. Action chaining, reusable skills.

— X (Twitter) - @chrisparkX

Built a CLI for X (twitter). Just wanted to share this with you in case you might find it useful. The agent integration is what makes it special.

— Reddit r/GrowthHacking

A complete guide to every OpenClaw skill that posts to Twitter/X. Installation, configuration, security warnings about malicious skills.

— OpenTweet Blog

Use bird to read/search X and post tweets/replies. Quick start with bird whoami. There are multiple Twitter skills but xurl is the official one.

— Reddit r/myclaw

Configuration Examples

Initial authentication

# Check if credentials exist
xurl auth status

# Set up OAuth 2.0 (do this manually, NOT in agent session)
xurl auth oauth2

# Verify identity
xurl whoami

Common operations

# Post a tweet
xurl post "Hello from my AI agent!"

# Search tweets
xurl search "openclaw" --limit 10

# Read a user's timeline
xurl timeline @username --limit 5

# Post a thread
xurl thread "First tweet" "Second tweet" "Final tweet"

Raw API access

# Any v2 endpoint
xurl raw GET /2/users/me

# With query parameters
xurl raw GET /2/tweets/search/recent --query "AI agents" --max_results 10

Installation

brew install xdevplatform/tap/xurl

Source: bundled