Authentication
The CLI talks to your SentraSec workspace over the API. Every scan is saved to that workspace and appears in your dashboard. Authenticate once — interactively for local dev, or with an API key for CI.
1
Interactive login
Best for local development. Stores a token in ~/.sentrasec/credentials.
$sentrasec login2
API key (CI / automation)
Create a key in Settings → API keys, then export it. The CLI picks it up automatically.
$export SENTRASEC_API_KEY=sk_live_...Store it as a secret in your CI provider — never commit it.
3
Verify
$sentrasec whoamiPrints the authenticated user and workspace.
Resolution order
| 1. SENTRASEC_API_KEY | Environment variable (highest priority). |
| 2. credentials file | ~/.sentrasec/credentials (written by sentrasec login). |