A powerful command-line tool designed to automate posting to multiple social media platforms, including Instagram and X (formerly Twitter), directly from your terminal.
Valid Social streamlines your social media workflow by leveraging browser automation to post content on your behalf. It uses a persistent browser profile to save your login sessions, so you only need to log in once. The interactive CLI guides you through selecting platforms, writing captions, and uploading media, making cross-platform posting fast and efficient.
- Multi-Platform Support: Post to Instagram, Facebook and X simultaneously. Support for TikTok and LinkedIn is planned for future releases.
- Persistent Login: Log in once manually through the CLI. Your session is securely saved for all future automated posts.
- Interactive Interface: An intuitive command-line interface guides you through composing your posts, from writing captions to selecting media.
- Media Uploads: Attach images and videos to your posts with a simple file selector.
- Stealth Automation: Utilizes Playwright with stealth configurations to mimic human behavior and reduce the risk of detection.
Follow these instructions to get the project up and running on your local machine.
- Python 3.9+
pipandvenv
-
Clone the Repository
git clone https://github.com/thevalidcode/valid-social.git cd valid-social -
Create and Activate a Virtual Environment
- On macOS/Linux:
python3 -m venv venv source venv/bin/activate - On Windows:
python -m venv venv .\venv\Scripts\activate
- On macOS/Linux:
-
Install Dependencies Install the project and its dependencies from
pyproject.toml.pip install . -
Install Browser Binaries Playwright requires browser binaries to function. This command will download them.
playwright install
Using Valid Social involves two main steps: logging in to save your session and then creating posts.
You must first log in to each platform you want to automate. This command opens a browser window for you to log in manually. Once you're done, your session cookies are saved for future use.
-
For Instagram:
valid-social login --platform instagram
-
For X (Twitter):
valid-social login --platform x
After running the command, a browser will open. Log in to your account as you normally would. Once you see your feed, you can close the browser and return to the terminal.
To create a new post, use the post command. You can run it interactively or provide all the details via flags.
This is the easiest way to get started. The CLI will prompt you for each step.
valid-social postYou will be guided through:
- Selecting Platforms: A numbered list of available platforms will be displayed.
- Writing a Caption: An editor will open for you to type your caption. Type
ENDon a new line to finish. - Uploading Media: A system file picker will open, allowing you to select one or more images/videos.
You can also provide all the information directly as command-line arguments. This is useful for scripting.
valid-social post --platform Instagram --platform X --caption "Check out this amazing photo! #automation #python" --media "/path/to/your/image.jpg"| Technology | Description |
|---|---|
| Python | The core programming language used for the project. |
| Typer | A modern and intuitive library for building CLIs. |
| Playwright | A powerful library for reliable browser automation. |
Contributions are welcome! If you have an idea for a new feature or have found a bug, please follow these steps:
- Fork the repository on GitHub.
- Create a new branch:
git checkout -b feature/your-feature-name - Make your changes and commit them:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Open a Pull Request and describe your changes.
This project is licensed under the MIT License.
Ibeh Precious (Valid)
- Email:
thevalidcode@gmail.com - X: @thevalidcode
- LinkedIn: thevalidcode