Tweet from Console is a Python-based command-line tool that lets you tweet directly from your console, command prompt, or terminal. Say goodbye to distracting web interfaces.
Good for programmers and devs who want to send tweets without leaving their console.
- 📝 Send text-based tweets from the command line
- ⏲️ Fast, simple and straight-forward
- 🔑 Secure integration with Twitter API
- 🐍 Python 3.6 or higher
- 🐦 Twitter Developer Account and API keys
- Clone the repository:
- Create and activate a virtual environment:
- Install the required dependencies:
- Set up your Twitter API credentials:
- Rename
scripts/.env.example
toscripts/.env
- Open
scripts/.env
and fill in your Twitter API credentials
- Rename
git clone https://github.com/yourusername/tweet-from-console.git
cd tweet-from-console
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Script\activate`
pip install -r requirements.txt
Ensure your scripts/.env
file contains these Twitter API credentials:
TWITTER_API_KEY=your_api_key
TWITTER_API_SECRET_KEY=your_api_secret_key
TWITTER_ACCESS_TOKEN=your_access_token
TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret
Following guides would help you get the API keys from Twitter/X Developers Platform:
python tweet.py "Your awesome tweet goes here!"
This will give you a confirmation message like the following:
You sure you want to post "Your awesome tweet goes here!" ?
[ (Y)es / (N)o ] :
Type Here:
python tweet.py "Your awesome tweet goes here!" --
This would not ask for a confirmation message. It directly posts your tweet.
python tweet.py -th
python tweet.py --tweethistory
Where <num>
is the number of recent items to display.
python tweet.py
Running this simple code would allow users to send multiline tweets. This is helpful since consoles are usually limited to inline inputs.
After writing the tweet, go to new line and then type :q
to exit.
Note: If you want to skip the confirmation message, just like Usage 1, execute python tweet.py --
Note: You can execute multiline tweets in a single line using the \n
. The following is an example:
python tweet.py "Line 1 \n Line 2"
Here is the format of the tweet that would be posted:
Line 1
Line 2
python tweet.py -e
python tweet.py --error
Contributions are welcome! Feel free to submit a Pull Request and join our tweeting revolution! 🌟
This tool is for educational purposes only. Always comply with Twitter's terms of service and API usage guidelines. Tweet responsibly.