You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User-facing manual entry point for re-opening or stopping the local preview
server post-H2 (e.g. after a reboot or explicit /pf:preview stop). Wraps
scripts/start-preview-server.sh; defaults to most-recent run when run_id
omitted.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
description: Launch the local preview server for a frozen run (post-H2 or manual re-open)
3
+
---
4
+
5
+
# /pf:preview — Launch the local preview server for a frozen run
6
+
7
+
**Layer-0 정책**: Pro/Max 기본 포함. 별도 API 키 불필요.
8
+
9
+
## Usage
10
+
11
+
```
12
+
/pf:preview [run_id]
13
+
/pf:preview stop [run_id]
14
+
/pf:preview status [run_id]
15
+
```
16
+
17
+
## 인자
18
+
19
+
-`run_id` (optional): 특정 run. 생략 시 가장 최근 run (`ls -t runs/r-* | head -1`).
20
+
21
+
## 동작
22
+
23
+
`bash scripts/start-preview-server.sh runs/<id>/` 호출. `runs/<id>/` 의 내용으로 profile 자동 감지:
24
+
25
+
1.`docker-compose.yml` 존재 (pro/max) → `docker compose up -d` + 첫 published port → 브라우저 자동 오픈.
26
+
2.`apps/api/package.json` + `apps/web/package.json` 존재 (standard) → 의존성 설치 → 18080부터 free port 자동 탐색 → `pnpm dev` 백그라운드 spawn → web TCP accept 대기 (≤60s) → 브라우저 자동 오픈.
27
+
3. 둘 다 없음 → exit 2 (TestDD freeze 미완료).
28
+
29
+
본 명령은 H2 승인 직후 M3가 자동으로 한 번 호출하므로 수동 실행은 보통 **재오픈** 또는 **재기동** 용도다 (서버를 stop 했거나 머신을 재부팅한 경우).
30
+
31
+
## Idempotency
32
+
33
+
이미 살아있는 PID 가 `<run_dir>/.preview-server.pid` 에 있으면 재기동 없이 URL 만 다시 연다. 두 번 spawn 되지 않는다.
0 commit comments