Skip to main content

Overview

The retweet and unretweet commands allow you to share tweets with your followers or undo previous retweets.

Retweet

twitter retweet <tweet_id>
Share a tweet to your followers. The retweeted post will appear on your profile and in your followers’ timelines.

Unretweet

twitter unretweet <tweet_id>
Remove a retweet. This undoes a previous retweet action.

Examples

Retweet a Post

twitter retweet 1234567890123456789
Output:
🔄 Retweeting 1234567890123456789...
✅ Done.

Unretweet a Post

twitter unretweet 1234567890123456789
Output:
🔄 Undoing retweet 1234567890123456789...
✅ Done.

Retweet from Feed

You can combine commands to retweet from your feed:
# First, find interesting tweets
twitter feed -n 20

# Then retweet by ID
twitter retweet 1234567890123456789

Command Reference

Retweet

Arguments:
  • tweet_id (required): The numeric tweet ID to retweet
Syntax:
twitter retweet <tweet_id>

Unretweet

Arguments:
  • tweet_id (required): The numeric tweet ID to unretweet (the original tweet ID, not your retweet ID)
Syntax:
twitter unretweet <tweet_id>
When unretweeting, use the original tweet ID, not the ID of your retweet. The API will automatically find and remove your retweet of that original tweet.

Finding Tweet IDs

You can find tweet IDs from:
  1. Tweet URLs: Extract from https://x.com/user/status/[ID]
  2. CLI commands: Use twitter feed, twitter search, or twitter user-posts
  3. Tweet detail: Use twitter tweet <url> for detailed information

Rate Limits and Anti-Detection

Retweet Limits: Twitter enforces strict limits on retweet operations:
  • Standard limit: ~100-200 retweets per day
  • Short-term burst limit: ~10-20 retweets per 15 minutes
  • Exceeding these limits triggers temporary blocks (15+ minutes)
Anti-Detection Features:
  • Random delays (1.5-4 seconds) after each operation
  • Chrome TLS fingerprint impersonation
  • Dynamic transaction IDs for authenticity
  • Automatic exponential backoff on rate limits
Safe limits:
  • Maximum: 15 retweets per 15-minute window
  • Recommended: 8-10 retweets per 15 minutes
  • Daily maximum: Keep under 150 retweets
If rate limited:
  • Wait at least 15-20 minutes before retrying
  • The CLI will automatically retry with exponential backoff
  • Error code 348 indicates retweet rate limit

Error Handling

Common Errors

Already retweeted:
 Twitter API: You have already retweeted this tweet (code 327)
Haven’t retweeted:
 Twitter API: You have not retweeted this tweet
Rate limited:
 Rate limited: Retweet limit exceeded (try again later, recommended wait: 15+ minutes)
Tweet not found:
 Twitter API error 404: Tweet not found
Protected tweet:
 Twitter API: You cannot retweet this protected tweet
Error codes 348 and 349 specifically indicate write operation rate limits. The CLI automatically handles these with user-friendly messages and retry logic.

Retweet vs Quote Tweet

The retweet command creates a standard retweet (boost). To add your own commentary, use the post command with a quote:
twitter post "Great insight! https://x.com/user/status/1234567890123456789"
Quote tweets are not currently automated via a dedicated command.

Best Practices

Avoid Automation Patterns:
  • Don’t retweet in rapid succession
  • Vary your activity (mix likes, retweets, and original posts)
  • Maintain human-like timing
  • Twitter actively monitors for bot behavior
Recommended workflow:
  1. Browse your feed naturally: twitter feed
  2. Wait a few seconds/minutes between actions
  3. Mix retweets with other interactions
  4. Don’t retweet everything from a single user in quick succession

Build docs developers (and LLMs) love