Simple command-line tool for posting tweets, quote tweets, replies, and deleting tweets on X.
You need X Developer API credentials. Follow these steps:
- Go to X Developer Portal
- Sign in with your X account
- Create a new project (or use the default)
- Create a new app under your project
- Go into the OAuth settings and set it to read & write
- Go to your app's "Keys and Tokens" tab:
- Generate API Key and Secret (Consumer Keys)
- Generate Access Token and Secret (User Context)
Go to Settings > Developers and add these as secrets:
X_API_KEY(API Key from step 1)X_API_KEY_SECRET(API Key Secret from step 1)X_ACCESS_TOKEN(Access Token from step 1)X_ACCESS_TOKEN_SECRET(Access Token Secret from step 1)
# Post a tweet
x post "Hello from X!"
# Quote tweet
x quote https://x.com/someone/status/1234567890 "Great point!"
# Reply to a tweet
x reply https://x.com/someone/status/1234567890 "Thanks!"x post "I'm learning Zo Computer!"x post --media /home/workspace/Images/pegasus_crossroads.png "Zo Computer + art"x quote https://x.com/zocomputer/status/123 "This is so cool"x quote https://x.com/zocomputer/status/123 "Great insight!
This really resonates with me.
Looking forward to more."x reply https://x.com/zocomputer/status/123 "Thanks for sharing"x delete https://x.com/i/status/123All tweets are limited to 280 characters. The CLI will tell you if your text is too long.
Use actual line breaks in your shell for multi-paragraph content:
x quote https://x.com/zocomputer/status/123 "Paragraph one.
Paragraph two."Don't use \n - the shell will handle actual newlines.
x helpThe X CLI comes pre-installed on your Zo Computer. To verify it's working:
x help- Navigate to your Integrations folder:
cd /home/workspace/Integrations- Clone the repository (if not already present):
git clone https://github.com/zocomputer/x.git
cd x- Install dependencies:
bun install- The CLI is now ready to use. Run any of the commands above (e.g.,
x post "Hello").
Once installed, you can run x commands from any directory. The CLI will use your environment variables from Settings > Developers.
- Missing environment variables: Make sure you've added all 4 keys to Settings > Developers
- Character limit error: Count your characters or shorten your message
- API errors: Check your keys are correct in the Developer settings