Your Automated Twitter Assistant via GitHub Actions
Xarvis is a lightweight automation system that posts scheduled tweets to X (formerly Twitter) using GitHub Actions. Built for developers, creators, and marketers, Xarvis enables seamless tweet automation directly from your GitHub repository—no need for external servers or paid scheduling tools.
-
🚀 Automated Tweet Posting
Schedule and post tweets using GitHub Actions at defined intervals (daily, weekly, custom CRON). -
📝 Fully Customizable Tweets
Store your tweets in a.txtfile, post them in order or randomly, and even include hashtags and emojis. -
🧠 No Server Required
Powered by GitHub’s free infrastructure. Deploy once and let it run forever. -
🔐 Secure API Integration
Uses encrypted GitHub Secrets to safely store and access your X API keys and tokens.
-
Prepare Your Tweet File
Create a file namedtweets.txtin the root of your repo. Each line represents a new tweet. -
Configure GitHub Secrets
Store the following keys in your repo’sSettings > Secrets and Variables > Actions:X_API_KEYX_API_SECRETX_ACCESS_TOKENX_ACCESS_SECRET
-
GitHub Actions Workflow
The.github/workflows/tweet.ymlworkflow reads thetweets.txtfile and posts tweets based on your schedule.
📦Xarvis/
┣ 📜 tweets.txt # Your tweet content
┣ 📜 tweet.py # The script that posts to X
┣ 📂 .github/workflows/
┃ ┗ 📜 tweet.yml # GitHub Actions workflow
┗ 📜 README.md # Project documentation
-
Fork or Clone this Repository
git clone https://github.com/QuantumAlchemist03/Xarvis.git cd Xarvis -
Add Your Tweets Edit
tweets.txtto include your tweet lines. -
Add Secrets Go to your GitHub repo settings and add your API credentials.
-
Customize the Workflow (Optional) Change the CRON schedule in
.github/workflows/tweet.ymlto control tweet timing. -
Push and Watch it Tweet! Once the workflow is live, Xarvis will begin tweeting automatically at the set intervals.
🔄 Example Tweet Schedule (CRON)
# Every day at 12:00 PM UTC
schedule:
- cron: '0 12 * * *'
Use crontab.guru to generate your desired CRON syntax.-
Tweets are posted in order from top to bottom. You can randomize them in the script if you wish.
-
Ensure your X Developer account is approved and has write permissions for the API.
-
Support for media/image uploads 🖼️
-
Threaded tweets support 🧵
-
Integration with OpenAI or RSS feeds for dynamic content
-
Analytics and logging of tweet status
-
Python 🐍
-
GitHub Actions ⚙️
-
Twitter/X Developer API 🐦
Find me on Twitter 🐦 |
Check my code on GitHub 💻
This project is licensed under the MIT License.