# How to Run RedditVideoMakerBot from Command Line: Complete Setup Guide

> Learn to run RedditVideoMakerBot from the command line. Follow our guide to clone the repo, install dependencies, configure API keys, and start creating videos with ease.

- Repository: [Lewis Menelaws/RedditVideoMakerBot](https://github.com/elebumm/RedditVideoMakerBot)
- Tags: how-to-guide
- Published: 2026-04-08

---

**To run RedditVideoMakerBot from the command line, clone the repository, install dependencies with pip and Playwright, configure your Reddit API credentials in [`config.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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:

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

```

Create and activate a virtual environment to isolate dependencies:

**Windows:**

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

```

**macOS/Linux:**

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

```

### Install Python Packages and Playwright

Install the required packages from [`requirements.txt`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/requirements.txt), then install Playwright browsers and system dependencies:

```bash
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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/settings.py) invokes `check_toml()` to:

- Load the template from [`utils/.config.template.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py). With your virtual environment activated, run:

```bash
python main.py

```

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

```bash
python main.py <POST_ID>

```

For example:

```bash
python main.py t3_abcdef

```

When you provide a post ID, the `get_subreddit_threads()` function (line 51 in [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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:

```bat
run.bat

```

### Unix/Linux Docker Execution

The [`run.sh`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/run.sh) script (lines 1-3) launches a Docker container that mounts the output folder and optional environment files:

```bash
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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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

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

```

### Process a specific thread

```bash
python main.py t3_example123

```

### Run multiple iterations

Set `times_to_run` in [`config.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml) under `[settings]`, then execute:

```bash
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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/settings.py) to generate [`config.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml) from [`utils/.config.template.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/run.sh) for Docker-based execution on Unix systems

## Frequently Asked Questions

### Do I need Docker to run RedditVideoMakerBot?

No. While [`run.sh`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/settings.py) invokes `check_toml()` to create [`config.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml). This allows you to generate videos for specific Reddit discussions on demand.