Skip to content

sp app

When agents use this: Resolve appId, check agent connectivity, register a service, or list recent replay plans for an app.

Synopsis

List, create, and inspect SoftProbe applications. An application is a registered service; recording, replay, and policies are scoped by appId. See Concepts — Application.

Use --json on all subcommands. See Output contract.

Subcommands

SubcommandArgsDescription
listApplications visible to the caller, with agent status
create<appName>Register a new application (server assigns appId)
status<appId>Agent connectivity for one application
replays<appId>Recent replay plans (--limit)

list

bash
sp app list --json

REST: GET /api/applications/list

Requires a token when --json is set (CLI exits with an auth error if SP_TOKEN is unset). Results are filtered by user group, ownership, and cross-group grants; see Authentication.

JSON output

data.items is an array of list rows. Each row merges app config with live agent status (heartbeat threshold defaults to 60s → offline).

FieldDescription
appIdStable id for agent config and other sp commands
appName, nameDisplay name
agentStatusonline, offline, or never
lastSeenAtUnix ms, freshest instance heartbeat
agentVersionAgent build string
envPrimary env tag, or production
tagsFlattened tag values
worktreeDirectoryOptional workspace path
json
{
  "ok": true,
  "command": "app list",
  "data": {
    "items": [
      {
        "appId": "a1b2c3d4e5f67890",
        "appName": "order-service",
        "agentStatus": "online",
        "lastSeenAt": 1747564800000
      }
    ]
  }
}

create

bash
sp app create order-service-staging --json

REST: POST /api/applications/create

appName must be unique. The CLI sends { "appName": "<arg>" }; the server may set owners from the JWT when omitted.

Request body (REST)

FieldRequiredDescription
appNameYesUnique name (CLI positional)
ownersNoOwner user names; defaults to current user
visibilityLevelNo0 public, 1 private
groupId, groupNameNoUser group assignment

JSON output

FieldDescription
successWhether creation succeeded
appIdGenerated id — use in agent and sp replay run --app
msgDetail when success is false
json
{
  "ok": true,
  "command": "app create",
  "data": {
    "success": true,
    "appId": "f3e2d1c0b9a87654"
  }
}

status

bash
sp app status f3e2d1c0b9a87654 --json

REST: GET /api/applications/{appId}/agent-status

Aggregates JVM instance heartbeats for the app. status reflects the freshest instance:

ValueMeaning
neverNo instances reported
onlineLatest heartbeat within threshold
offlineInstances exist but heartbeat is stale
FieldDescription
appIdApplication id
statusnever, online, or offline
instanceCountRegistered instances
lastSeenAtUnix ms
agentVersionFrom freshest instance
json
{
  "ok": true,
  "command": "app status",
  "data": {
    "appId": "f3e2d1c0b9a87654",
    "status": "online",
    "instanceCount": 2,
    "lastSeenAt": 1747564800000
  }
}

replays

bash
sp app replays f3e2d1c0b9a87654 --limit 10 --json

REST: GET /api/applications/{appId}/replays/recent?limit=N

FlagDefaultDescription
--limit5Max plans (CLI rejects < 1; values above 100 are clamped to 100; server also clamps 1–100)

data is an array of plan summaries (planId, planName, status, case counts, createTime, triggeredBy, …). Use planId with sp replay and replay case.

REST mapping

SubcommandMethodPath
listGET/api/applications/list
createPOST/api/applications/create
statusGET/api/applications/{appId}/agent-status
replaysGET/api/applications/{appId}/replays/recent

Header: access-token: <JWT>.

Replaces sp_api

sp_api endpointsp command
list_applicationssp app list
agent_statussp app status
recent_replayssp app replays

Zero code changes · Full-context visibility · Cost optimization