Skip to content

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)

SubcommandDescription
runCreate plan (POST /api/createPlan)
status <planId>Poll progress (GET /progress)
stop <planId>Stop plan
rerun <planId>Re-run plan

Flags (run)

FlagAPI fieldDescription
--appappIdApplication id (required)
--envtargetEnvTarget environment (required)
--fromcaseSourceFromStart time (duration e.g. -24h or RFC3339)
--tocaseSourceToEnd time (default: now)
--limitcaseCountLimitMax cases
--nameplanNameDisplay name
--operationoperationIdsRepeatable; filter operations
--enable-mock / --no-mockenableMockMock during replay
--watchPoll 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 --json

JSON 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

SubcommandMethodPath
runPOST/api/createPlan
run (webhook style)GET/api/createPlan?appId=… (discouraged for CLI; use POST)
statusGET/progress?planId=
stopGET/api/stopPlan?planId=
rerunPOST/api/reRunPlan

Body for run: BuildReplayPlanRequest (schedule module).

Response envelope: CommonResponse (result, desc, data).

Pipeline

  1. sp replay runplanId
  2. sp replay status --watch
  3. On failure → v2 case listdiff get