How to Run RedditVideoMakerBot from Command Line: Complete Setup Guide

To run RedditVideoMakerBot from the command line, clone the repository, install dependencies with pip and Playwright, configure your Reddit API credentials in config.toml, and execute python main.py from your virtual environment.

The elebumm/RedditVideoMakerBot automates the creation of short-form videos from Reddit threads, handling everything from screenshot capture to voiceover generation and final video assembly. Running this tool from your terminal involves three distinct phases: environment setup, TOML configuration management, and script execution. The following guide walks through each step using the actual source code structure and entry points defined in the repository.

Install Dependencies and Prepare the Environment

Before you can execute RedditVideoMakerBot, you must prepare your Python environment and install browser automation libraries.

Clone the Repository and Create a Virtual Environment

Start by cloning the repository to your local machine:

git clone https://github.com/elebumm/RedditVideoMakerBot.git
cd RedditVideoMakerBot

Create and activate a virtual environment to isolate dependencies:

Windows:

python -m venv ./venv
.\venv\Scripts\activate

macOS/Linux:

python3 -m venv ./venv
source ./venv/bin/activate

Install Python Packages and Playwright

Install the required packages from requirements.txt, then install Playwright browsers and system dependencies:

pip install -r requirements.txt
python -m playwright install
python -m playwright install-deps

These steps correspond to the installation instructions in the README (lines 40-66).

Configure the Bot with config.toml

The bot relies on a TOML configuration file located in the repository root. On first run, the utility in utils/settings.py handles creation and validation of this file.

First-Run Configuration Generation

When you execute the bot without a valid configuration, utils/settings.py invokes check_toml() to:

  • Load the template from utils/.config.template.toml (lines 14-15)
  • Prompt for missing values interactively via handle_input() (lines 70-93)
  • Write the completed configuration to config.toml (lines 63-64)

Required fields include Reddit API credentials (client_id, client_secret, username, password) to access the Reddit API, and if you use the TikTok TTS engine, a TikTok sessionid. The README points to Reddit's app creation page for obtaining script credentials (lines 84-86).

Execute RedditVideoMakerBot from the Terminal

Once config.toml exists, you can launch the bot using several methods depending on your operating system.

Direct Python Execution (Cross-Platform)

The primary entry point is main.py. With your virtual environment activated, run:

python main.py

To process a specific Reddit thread instead of random selection or the configured list, pass the post ID as an argument:

python main.py <POST_ID>

For example:

python main.py t3_abcdef

When you provide a post ID, the get_subreddit_threads() function (line 51 in main.py) fetches that specific thread. The main() function (lines 49-65) orchestrates the entire pipeline.

Windows Batch Wrapper

For Windows users, the repository includes run.bat (lines 4-11) which activates the virtual environment automatically:

run.bat

Unix/Linux Docker Execution

The run.sh script (lines 1-3) launches a Docker container that mounts the output folder and optional environment files:

chmod +x run.sh
./run.sh

If you prefer not to use Docker on Unix systems, use the direct python main.py command shown above.

What Happens When You Start the Bot

When you run RedditVideoMakerBot from the command line, main.py executes a specific initialization sequence:

  1. Version validation: checkversion(__VERSION__) ensures you are on the latest release (line 43)
  2. FFmpeg installation: ffmpeg_install() downloads or verifies the FFmpeg binary (line 91)
  3. Configuration check: settings.check_toml() loads and validates config.toml (lines 93-96)
  4. Credential verification: The bot aborts early if TikTok TTS is selected without a valid sessionid (lines 98-106)
  5. Thread processing: The bot either iterates over post IDs, runs run_many() for multiple iterations, or processes a single thread via get_subreddit_threads()
  6. Video generation: Functions in video_creation/ download screenshots, synthesize voices, fetch background media, and assemble the final video using FFmpeg

If any exception occurs during execution, the bot sanitizes sensitive configuration fields before re-raising the error (lines 27-35).

Practical Command Examples

Run with default configuration

source ./venv/bin/activate
python main.py

Process a specific thread

python main.py t3_example123

Run multiple iterations

Set times_to_run in config.toml under [settings], then execute:

python main.py

Summary

  • Clone and install: Set up a Python virtual environment and install dependencies including Playwright via pip install -r requirements.txt and python -m playwright install
  • Configure: Allow utils/settings.py to generate config.toml from utils/.config.template.toml on first run, providing Reddit API credentials when prompted
  • Execute: Run python main.py for standard operation, or python main.py <POST_ID> to process a specific Reddit thread
  • Platform options: Use run.bat on Windows for automatic virtual environment activation, or run.sh for Docker-based execution on Unix systems

Frequently Asked Questions

Do I need Docker to run RedditVideoMakerBot?

No. While run.sh provides a Docker wrapper for Unix systems, the standard method uses Python directly. Activate your virtual environment and run python main.py to execute the bot without containerization.

Why does the bot ask for input on the first run?

The first time you execute python main.py, utils/settings.py invokes check_toml() to create config.toml from the template. It interactively prompts for required Reddit API credentials and other missing values necessary for the bot to access Reddit and generate videos.

Can I process multiple Reddit threads in one command?

Yes. Configure the times_to_run parameter in config.toml under the [settings] section, then run python main.py. The bot will process that many threads sequentially. Alternatively, you can script multiple executions with different post IDs.

What happens if I specify a post ID as a command-line argument?

Passing a post ID (e.g., python main.py t3_abcdef) triggers get_subreddit_threads() to fetch that specific thread only, bypassing the random selection logic or the list configured in config.toml. This allows you to generate videos for specific Reddit discussions on demand.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →