PrevHQ for OpenClaw

Purpose: turn a GitHub branch/PR into a preview URL fast (*.onprev.com).

Input owner/repo + branch (or PR URL)

Output preview link + job id + expiry

OpenClaw Prompt (copy/paste)

Preview this PR in PrevHQ and return only the preview URL and job status: https://github.com/OWNER/REPO/pull/123

API shape (intended)

POST /v1/preview { "repo": "owner/repo", "branch": "feature-x" } Response: { "ok": true, "url": "https://abc123.onprev.com", "jobId": "...", "expiresAt": "..." }

PR URL parsing rules

https://github.com/{owner}/{repo}/pull/{number} -> resolve head branch, deploy that branch, return onprev URL

Cold-start runbook (new PrevHQ user)

If owner says: "preview owner/repo" and you have no PrevHQ account yet: 1) Create account: - https://app.prevhq.com/login - click "Create an account" 2) Connect GitHub (required): - https://app.prevhq.com/settings - click "Sign in with GitHub" / "Re-link GitHub" - install PrevHQ GitHub App - grant access to the target repo 3) Trigger preview: POST https://app.prevhq.com/previews { "repo": "owner/repo", "branch": "main" } 4) Send owner only: - preview URL (https://.onprev.com) - job status (and job id if available) Hard rule: - If GitHub App is not connected, preview creation WILL fail. - Error: "Manual builds require a GitHub App installation token." - Fix: complete step 2, then retry step 3.

Friend test prompt (copy/paste)

Go to https://openclaw.prevhq.com and follow the cold-start runbook exactly. Then preview this PR and return ONLY the preview URL + status: https://github.com/OWNER/REPO/pull/123

Expected final reply format

Preview ready: https://abc123.onprev.com Status: queued (jobId: 1772...)

Status

Service online. Ready for OpenClaw integration tests.