Skip to content

sp auth ​

When agents use this: When SP_TOKEN is unset or expired.

Synopsis ​

Authenticate and inspect identity.

Subcommands ​

SubcommandFlagsDescription
login--email, --code, --guest, --no-saveObtain JWT
whoami—Current user from token
refresh--user, --no-saveRefresh token

Examples ​

bash
sp auth login --email ops@corp.com --code 848291 --json
sp auth login --email ops@corp.com --code 848291 --no-save --json
sp auth whoami --json
export SP_TOKEN="$(sp auth login ... --no-save --json | jq -r '.data.token')"

By default, login and refresh save the token to the shared configuration file in ${XDG_CONFIG_HOME:-~/.config}/softprobe/config.jsonc. With --no-save, the token

is returned in JSON only and no config, cache, data, or state file is modified.

JSON output (login) ​

json
{
  "ok": true,
  "command": "auth login",
  "data": {
    "token": "eyJhbGciOi...",
    "userName": "ops@corp.com"
  }
}

JSON output (whoami) ​

json
{
  "ok": true,
  "command": "auth whoami",
  "data": {
    "userName": "ops@corp.com"
  }
}

JSON output (refresh) ​

json
{
  "ok": true,
  "command": "auth refresh",
  "data": {
    "token": "eyJhbGciOi...",
    "userName": "ops@corp.com"
  }
}

REST mapping ​

SubcommandMethodPath
login (email)POST/api/login/verify
login (guest)POST/api/login/loginAsGuest
refreshGET/api/login/refresh/{userName}
whoami—JWT decode locally, or future profile API

Request body for verify: VerifyRequestType (userName, verifyCode, …).

Replaces ​

None (new). CI uses SP_TOKEN directly.

Capture Sessions · Review Steps · Improve what matters