signaloid-cli auth whoami
Display information about the currently authenticated user.
Synopsis
signaloid-cli auth whoami [options]
Options
| Option | Description |
|---|---|
--format <type> | Output format: table or json (default: json) |
Description
The whoami command retrieves and displays information about the currently authenticated user from the Signaloid API. This is useful for:
- Verifying your authentication is valid
- Checking which account you are logged in with
- Extracting user information for scripts
- Troubleshooting authentication issues
Examples
Basic Usage
signaloid-cli auth whoami
Extract Specific Fields with jq
Get user name:
signaloid-cli auth whoami | jq -r '.Username'
Example output:
john.doe@example.com
Get user ID:
signaloid-cli auth whoami | jq -r '.UserID'
Example output:
usr_12345661ad6641899387b6458cc9a2e2
Verify Authentication in Scripts
#!/bin/bash
if signaloid-cli auth whoami > /dev/null 2>&1; then
echo "✓ Authenticated"
USER_EMAIL=$(signaloid-cli auth whoami | jq -r '.Username')
echo "Logged in as: $USER_EMAIL"
else
echo "✗ Not authenticated"
exit 1
fi
Exit Codes
| Code | Description |
|---|---|
0 | Successfully retrieved user information |
1 | Not logged in (no stored credentials), or the request failed |
3 | The API rejected the stored credentials, for example an expired or deleted API key |
See Also
- signaloid-cli auth - Auth command overview
- signaloid-cli auth login - Authenticate with Signaloid
- signaloid-cli auth logout - Clear authentication
- signaloid-cli users me - Get detailed user profile
Learn More
- Authentication Guide - Complete authentication guide