Appearance
sp replay (control)
Phase: v1 (control); v2 adds case, diff, logs — see commands-v2
When agents use this: Start and monitor replay plans; v2 subcommands for failure analysis.
Synopsis (v1)
Create, monitor, stop, and rerun replay plans.
Subcommands (v1)
| Subcommand | Description |
|---|---|
run | Create plan (POST /api/createPlan) |
status <planId> | Poll progress (GET /progress) |
stop <planId> | Stop plan |
rerun <planId> | Re-run plan |
Flags (run)
| Flag | API field | Description |
|---|---|---|
--app | appId | Application id (required) |
--env | targetEnv | Target environment (required) |
--from | caseSourceFrom | Start time (duration e.g. -24h or RFC3339) |
--to | caseSourceTo | End time (default: now) |
--limit | caseCountLimit | Max cases |
--name | planName | Display name |
--operation | operationIds | Repeatable; filter operations |
--enable-mock / --no-mock | enableMock | Mock during replay |
--watch | — | Poll until terminal state (with status) |
Examples
bash
sp replay run --app my-app --env staging --from -24h --enable-mock --json
sp replay status plan-xyz --watch --json
sp replay stop plan-xyz --json
sp replay rerun plan-xyz --jsonJSON output (run)
json
{
"ok": true,
"command": "replay run",
"data": {
"planId": "plan-xyz",
"result": 1,
"desc": "success"
}
}JSON output (status)
json
{
"ok": true,
"command": "replay status",
"data": {
"planId": "plan-xyz",
"status": "RUNNING",
"percent": 42,
"finished": false
}
}REST mapping
| Subcommand | Method | Path |
|---|---|---|
run | POST | /api/createPlan |
run (webhook style) | GET | /api/createPlan?appId=… (discouraged for CLI; use POST) |
status | GET | /progress?planId= |
stop | GET | /api/stopPlan?planId= |
rerun | POST | /api/reRunPlan |
Body for run: BuildReplayPlanRequest (schedule module).
Response envelope: CommonResponse (result, desc, data).
Pipeline
sp replay run→planIdsp replay status --watch- On failure → v2 case list → diff get