signaloid-cli auth whoami
Display information about the currently authenticated user.
Synopsis
signaloid-cli auth whoami
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're 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:
user_abc123
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 '.email')
echo "Logged in as: $USER_EMAIL"
else
echo "✗ Not authenticated"
exit 1
fi
Exit Codes
| Code | Description |
|---|---|
0 | Successfully retrieved user information |
1 | Authentication failed or not authenticated |
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