Generate surprise Commander decks with a single click — deterministic when you need repeatability.
---
## Overview
The Random Build tile spins up a fully randomized deck: a random commander is picked, then themes are assigned randomly from the catalog and matched to that commander's color identity and tag profile. All normal build rules (bracket, budget, owned filters, include/exclude) still apply.
Enable:
-`RANDOM_MODES=1` — expose backend random endpoints
-`RANDOM_UI=1` — show the Random Build tile on the homepage
---
## Using Random Build
1. Click the **Random Build** tile on the homepage.
2. Optionally set a theme override in the tile's inputs (primary, secondary, tertiary). Leave blank for fully random.
3. Click **Surprise me**. The builder picks a commander and fills theme slots automatically.
4. Use the **Reroll** button to generate a fresh random combination without leaving the tile.
5. Confirm to proceed through the normal build stages (or use Quick Build for one-click automation).
---
## Theme Auto-Fill
When theme slots are left blank, `RANDOM_AUTO_FILL=1` (default) fills them automatically from themes compatible with the randomly selected commander. Set `RANDOM_AUTO_FILL_SECONDARY` or `RANDOM_AUTO_FILL_TERTIARY` to override auto-fill behavior for individual slots while leaving others random.
If a specific theme combination cannot be satisfied (too few on-theme cards for the selected commander), the builder tries alternative themes up to `RANDOM_MAX_ATTEMPTS` times before surfacing an error.
When you specify multiple themes (Primary + Secondary + Tertiary), the builder attempts to find commanders matching all themes using a **fallback cascade**. This ensures you get a valid commander even when exact combinations don't exist:
3.**Primary + Tertiary** — Drop secondary theme (treat tertiary as secondary)
4.**Primary only** — Use only the primary theme
5.**Synergy fallback** — Find commanders with theme tag overlap/token substring matches with Primary
6.**Full pool fallback** — Any commander (last resort)
**Fallback Notices:**
- **Combo Fallback** (blue/info): One or more themes were dropped (combinations 2-4). The builder found a commander but couldn't match all requested themes.
- **Synergy Fallback** (amber/warning): Exact theme match failed; using commanders with overlapping keywords/tokens from your primary theme.
- **Full Pool Fallback** (strong warning): No theme matches found; falling back to the entire commander pool. Your theme inputs were too restrictive.
Set `RANDOM_SEED` to any integer or string to produce the same commander + theme combination every time:
```
RANDOM_SEED=my_deck_seed_2026
```
Seeds are also shareable — include the seed in the permalink or pass it via the UI seed input to reproduce a specific random outcome.
---
## Reroll Throttle
To prevent accidental rapid-fire rerolls, a minimum interval of `RANDOM_REROLL_THROTTLE_MS` (default: `350` ms) is enforced client-side between reroll requests.
---
## Constraints
Theme and commander constraints can be passed as inline JSON or a JSON file for headless random builds: