📖 Lesson 3 of 13

Initializing WP Rig and Dependency Setup

With your system runtimes and local WordPress site online, we can begin setting up WP Rig. In this lesson, you will learn how to download WP Rig, configure its setup variables, and run the initialization compilers.


1. Clones the Repository

First, navigate to your local site’s themes folder (e.g., `wp-content/themes/`) and clone the official repository:

“`bash cd wp-content/themes/ git clone https://github.com/wprig/wprig.git wprig cd wprig “` > **Important:** Keep the theme folder named `wprig` or `wprig-dev` during active development. When you eventually bundle the theme for production, WP Rig’s compiler will automatically package your code into a new, clean production directory matching your custom slug.


2. Setting Your Custom Properties

WP Rig is highly customizable. Before installing packages, you can specify your custom theme name, slug, author details, and local development URL.

The Layered JSON Configuration

{
  "theme": {
    "slug": "excalibur",
    "name": "Excalibur Theme",
    "author": "My Web Studio"
  }
}

If you are running a custom local URL (such as `excalibur.local` or `localhost:8888`), create `config.local.json` which is ignored in Git:

{
  "dev": {
    "browserSync": {
      "proxyURL": "localhost:8885"
    }
  }
}

3. Running `rig-init` & Answering Prompts

With your configurations written, run the initialization command. This task installs all compiler libraries, fetches PHP Composer dependencies, and sets up your environment variables:

Option A: Standard npm Setup

Option B: Blazing-Fast Bun Setup (Recommended)

During initialization, the CLI will present a series of questions: 1. **Confirm Theme Details:** It displays your customized theme slug (`excalibur`), name (`Excalibur Theme`), and author. Confirm that they are correct. 2. **BrowserSync Proxy Setup:** Enter your local URL (e.g. `https://wprig.io/`). The installer uses this URL to proxy and sync live-preview events. 3. **Local SSL Certificates:** If your local site is running under HTTPS, WP Rig will offer to generate self-signed trust certificates locally to avoid browser warnings.

Once completed, the terminal will confirm that all dependencies are installed and the configuration indexes are locked. In our next lesson, we will compile your assets, activate the theme, and run the automated database setup!