Neutrino Docs
API ReferenceCLI Reference

whoami

Show current authentication status (validated against IAM)

Usage

nno whoami [options]

Options

NameTypeRequiredDescription
offlinebooleanNoShow cached credentials without IAM validation
iam-urlstringNoOverride 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 whoami

Output when credentials are valid:

✔ Authenticated as [email protected]
ℹ Platform: r4xk9m2zt5
ℹ Role: platform-admin
ℹ Session expires: 2026-05-15T10:00:00.000Z

Offline / cached display

nno whoami --offline

Output:

ℹ Authenticated as [email protected] [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.app

Useful 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"
fi

Output States

ConditionOutput
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

VariableDescription
NNO_IAM_URLOverride the IAM base URL for this call. Checked after --iam-url, before the stored iamUrl in credentials.

Exit Codes

CodeMeaning
0Credentials present (online: validated; offline: cached).
1No credentials found, IAM unreachable, or unexpected error.
2Session expired or revoked (online mode only).

Error Scenarios

ScenarioExitRemedy
No credential file1Run nno login
IAM unreachable1Use --offline or check network
Session revoked server-side2Run nno login again

See Also

  • nno login — authenticate and write the credential file.
  • nno logout — clear the credential file.

On this page