Skip to main content

Overview

The post command allows you to create and publish tweets directly from the command line. You can post simple tweets or reply to existing conversations.

Basic Usage

twitter post "Your tweet text here"

Reply to a Tweet

To reply to an existing tweet, use the --reply-to or -r flag with the tweet ID:
twitter post "Great point!" --reply-to 1234567890123456789

Examples

Post a Simple Tweet

twitter post "Just shipped a new feature!"

Post with Quotes

When your tweet contains special characters, make sure to quote properly:
twitter post "Check out this amazing project: https://github.com/user/repo"

Reply to a Conversation

twitter post "Thanks for sharing this!" -r 1234567890123456789

Multi-line Tweet

twitter post "Line 1
Line 2
Line 3"

Command Reference

Arguments

  • text (required): The content of your tweet

Options

OptionShortDescription
--reply-to-rTweet ID to reply to

Output

When successful, the command will display:
  • Confirmation message
  • Direct link to the posted tweet on X/Twitter
 Tweet posted!
🔗 https://x.com/i/status/1234567890123456789

Rate Limits and Anti-Detection

Rate Limit Protection: twitter-cli automatically adds random delays (1.5-4 seconds) after write operations to avoid triggering Twitter’s anti-bot detection systems.
The tool uses advanced anti-detection features including:
  • Chrome TLS fingerprint impersonation
  • Randomized request delays with jitter
  • Automatic retry with exponential backoff
  • Dynamic transaction ID generation

Troubleshooting

Rate Limit Errors

If you encounter rate limit errors:
  • Wait at least 15 minutes before trying again
  • Reduce the frequency of your posts
  • The tool will automatically retry with exponential backoff

Authentication Issues

If posting fails with authentication errors:
  1. Verify your cookies are up to date
  2. Re-run authentication setup
  3. Check that your account has posting permissions

Character Limits

Twitter enforces a character limit on tweets:
  • Standard accounts: 280 characters
  • Twitter Blue subscribers: 25,000 characters
The CLI does not enforce these limits client-side, so Twitter’s API will return an error if you exceed your account’s limit.

Build docs developers (and LLMs) love