API ReferenceCLI Reference
whoami
Show current authentication status (validated against IAM)
Usage
nno whoami [options]Options
| Name | Type | Required | Description |
|---|---|---|---|
offline | boolean | No | Show cached credentials without IAM validation |
iam-url | string | No | Override IAM base URL |
Behaviour
nno whoami reads ~/.nno/credentials.json and — by default — validates the stored token against IAM before reporting identity. Pass --offline to skip the network call and display cached credentials immediately.
Examples
Online validation (default)
nno whoamiOutput when credentials are valid:
✔ Authenticated as developer@acme.com
ℹ Platform: r4xk9m2zt5
ℹ Role: platform-admin
ℹ Session expires: 2026-05-15T10:00:00.000ZOffline / cached display
nno whoami --offlineOutput:
ℹ Authenticated as developer@acme.com [unverified]
ℹ Platform: r4xk9m2zt5 [unverified]
ℹ Role: platform-admin [unverified]The [unverified] suffix reminds you the displayed values are from the local cache and have not been confirmed with IAM.
Point at a custom IAM endpoint
nno whoami --iam-url https://iam-stg.svc.nno.appUseful when credentials were issued against a non-production IAM and the stored iamUrl in the credential file needs to be overridden for this call.
Script-friendly auth check
if nno whoami --offline > /dev/null 2>&1; then
echo "Credentials present"
else
nno login --token "$NNO_API_TOKEN"
fiOutput States
| Condition | Output |
|---|---|
| Valid session (online) | ✔ Authenticated as <email> + platform, role, expiry |
| Valid credentials (offline) | ℹ Authenticated as <email> [unverified] |
| No credentials | ℹ Not authenticated. Run: nno login |
| Session expired or revoked (online) | Session expired or revoked. Run: nno login again. |
| IAM unreachable (online) | IAM unreachable. Use --offline to display cached credentials. |
Credential File
Read by nno whoami, never written. Source of truth: packages/cli/src/utils/credentials.ts.
{
"token": "string",
"refreshToken": "string | null",
"email": "string",
"platformId": "string | null",
"role": "string",
"expiresAt": "ISO 8601 timestamp",
"iamUrl": "string",
"audience": "nno-cli"
}Environment Variables
| Variable | Description |
|---|---|
NNO_IAM_URL | Override the IAM base URL for this call. Checked after --iam-url, before the stored iamUrl in credentials. |
Exit Codes
| Code | Meaning |
|---|---|
0 | Credentials present (online: validated; offline: cached). |
1 | No credentials found, IAM unreachable, or unexpected error. |
2 | Session expired or revoked (online mode only). |
Error Scenarios
| Scenario | Exit | Remedy |
|---|---|---|
| No credential file | 1 | Run nno login |
| IAM unreachable | 1 | Use --offline or check network |
| Session revoked server-side | 2 | Run nno login again |
See Also
nno login— authenticate and write the credential file.nno logout— clear the credential file.