Skip to content

sp auth

When developers and agents use this: Establish active authentication profiles, inspect current session details, or renew expired authorization tokens.


Synopsis

The sp auth command tree is the gatekeeper for accessing secure endpoints. In Enterprise/Self-Hosted deployments, authentication may be optional or bypassed. In the SaaS Cloud environment (https://api.softprobe.ai), a valid authentication token and target Tenant ID are strictly required.

Credentials are saved in your shared user configuration profile: ${XDG_CONFIG_HOME:-~/.config}/softprobe/config.jsonc


Subcommands

SubcommandFlagsDescription
login--email, --code, --guest, --no-save, --tenant-idSign in and capture authentication credentials
whoamiDecode and inspect the active session token and tenant settings
refresh--user, --no-saveObtain a fresh JWT using existing session credentials

Command Details & Flags

sp auth login

Authenticates your CLI client and configures your active profile.

bash
sp auth login [flags]

Flags:

  • --email: Your registered email address.
  • --code: The one-time verification code sent to your email.
  • --tenant-id: Directly specify your target Tenant ID (bypasses the interactive prompt when logging in to the Cloud environment).
  • --guest: Log in with a guest developer session (if permitted by server policy).
  • --no-save: Perform the login exchange and output the credentials to standard output, but do not write them to your local configuration profile.

SaaS Interactive Login Flow:

If your active API endpoint points to https://api.softprobe.ai and you do not pass the --tenant-id flag, the CLI will interactively prompt you to specify your target organization:

text
Enter your Tenant ID: tenant-12345

The CLI then writes both the JWT and the specified tenant_id to your active profile in config.jsonc.


Configuration Profile Example

When saved locally, your active profile configuration under ~/.config/softprobe/config.jsonc looks like this:

jsonc
{
  "profiles": {
    "default": {
      "api_url": "https://api.softprobe.ai",
      "token": "eyJhbGciOiJIUzI1NiIsIn...",
      "tenant_id": "tenant-12345"
    }
  },
  "active_profile": "default"
}

Examples

Interactive login to SaaS Cloud:

bash
sp auth login --email developer@example.com --code 738192

Scripted/Non-interactive login (CI/CD):

bash
sp auth login --email ci-runner@example.com --code 112233 --tenant-id tenant-12345 --json

Inspect the current session:

bash
sp auth whoami --json

JSON Output:

json
{
  "ok": true,
  "command": "auth whoami",
  "data": {
    "userName": "developer@example.com",
    "tenantId": "tenant-12345",
    "expiresAt": "2026-05-24T12:00:00Z"
  }
}

REST API Mappings

The CLI routes these commands to the following backend control-plane endpoints:

CLI ActionHTTP MethodREST Endpoint
login (email verification)POST/api/login/verify
login (guest access)POST/api/login/loginAsGuest
refresh (token renewal)GET/api/login/refresh/{userName}