Skip to content

Commands

Reference for public sp subcommands. Use --json on API-backed commands. See Output contract.

Job-oriented commands that follow record-and-replay order:

CommandSynopsis
setupdoctor — config, health, auth, agent jar
agentdownload, command — install jar and JVM flags
recordcase list — recorded entry cases before replay
diagnosereplay, trace — bundled investigation workflows

Platform

Connect, authenticate, manage apps and policies, run replay plans.

CommandSynopsis
configProfiles, URL, init
authLogin, whoami, refresh
appList, create, agent status, recent replays
policyRecording, mock, compare YAML policies
replayRun, status, stop, rerun plans
healthCluster health
versionCLI version string

Investigation

Recorded data, traces, and replay failures.

CommandSynopsis
recordQuery recordings, completeness, record logs
traceFind traces by business attributes
replay caseList cases, metadata, mock tree
replay diffDiff artifacts, replay logs
extraction-ruleBusiness attribute extraction rules

Investigation commands support --out-dir, --page, and --limit unless noted.

Administration

Groups, system config, diagnostics, legacy APIs.

CommandSynopsis
groupUser groups and app grants
grantApp grant listing (grant list)
systemSystem config keys
opsStorage and schedule diagnostics
config legacyLegacy /api/config/* (deprecated)

Global flags

text
--json          Machine-readable stdout (required for agents)
--profile       Config profile name
--api-url       Override backend URL
--token         Override JWT (else SP_TOKEN / config)
--config        Extra config file (JSONC overlay)
--quiet         Suppress non-error stderr
--out-dir       Directory for artifact files
--page          Page number (investigation list commands)
--limit         Page size / max items

Cheat sheet

bash
sp config init && sp auth login --email u@c.com --code 123456 --json
sp setup doctor --json
sp app create my-svc --json
sp agent download --json
sp agent command --app <appId> --json   # copy startCommand into your run script
sp record case list --app <appId> --since -1h --json
sp replay run --app <appId> --env http://your-service:8080 --from -24h --json
sp replay status <planId> --watch --json
sp diagnose replay <planId> --failed-only --out-dir .sp-work --json

零代码改动 · 全上下文可见性 · 成本优化