The CLI lets you test Preel locally against real GitHub PRs without running the webhook server.
npx tsx src/cli.ts <owner/repo> <pr-number> [--preset=<name>]# Build the image first
npm run docker:build
# Review a PR
docker compose run --rm review owner/repo 42
docker compose run --rm review owner/repo 42 --preset=security
docker compose run --rm review owner/repo 42 --preset=quicknpx tsx src/cli.ts octocat/hello-world 42
npx tsx src/cli.ts octocat/hello-world 42 --preset=thorough| Variable | Description |
|---|---|
GITHUB_TOKEN |
Personal access token with repo scope |
OPENAI_API_KEY |
OpenAI API key for analysis and TTS |
| Variable | Default | Description |
|---|---|---|
SKIP_TTS |
— | Set to 1 to skip TTS (produces silent video, faster) |
LLM_PROVIDER |
openai |
openai or anthropic |
PREEL_PRESET |
— | Force a preset via env var |
OUTPUT_DIR |
./out |
Where to save the video |
- Fetches the PR metadata and diff from GitHub
- Resolves configuration (env vars +
PREEL_PRESET+--presetflag) - Analyzes the diff with the configured LLM
- Generates a narration script
- Generates TTS audio (unless
SKIP_TTS=1) - Syntax-highlights the diff hunks
- Renders the video
- Saves to
{OUTPUT_DIR}/cli-{owner}-{repo}-{prNumber}.mp4 - Prints a review summary
- Post a comment on the PR
- Upload the video to R2
- Fetch
.preel.ymlfrom the repo (uses local config only) - Auto-detect presets from labels/branch/files
Available presets: default, quick, thorough, security, architecture, onboarding
The --preset flag takes priority over the PREEL_PRESET env var.
Fetching PR #42 from acme/webapp...
Fetching diff...
12 files (after filtering)
Using preset: security
Analyzing...
Script: 5 scenes, ~42s
Generating TTS...
TTS: title → 4.2s (48320 bytes)
TTS: diff-0 → 8.3s (94208 bytes)
TTS: diff-1 → 7.1s (80896 bytes)
TTS: risk → 5.8s (65536 bytes)
TTS: summary → 4.9s (55296 bytes)
Highlighting diffs...
Rendering video...
Render: 10%
Render: 20%
...
Render: 100%
Video saved: ./out/cli-acme-webapp-42.mp4
--- Review Summary ---
Preset: security
Sentiment: cautious
Files: 8
Risks: 3
Summary: This PR introduces authentication middleware with a few security considerations...
For public repos: public_repo scope is sufficient.
For private repos: repo scope (full control of private repositories).
Generate a token at: Settings → Developer settings → Personal access tokens → Tokens (classic)