game whoami
Display information about the currently authenticated user and active workspace.
Usage
game whoamiDescription
The whoami command displays your current authentication status, user information, and active workspace details. It's useful for verifying which account you're logged in with and which workspace is currently selected.
Output
When authenticated, the command displays:
Authenticated as: john.doe@example.com
User ID: usr_abc123def456
Username: john.doe
Current Workspace: My Game Studio (ws_xyz789)
API Endpoint: https://api.gameframework.devOutput Fields
| Field | Description |
|---|---|
| Authenticated as | Email or username |
| User ID | Unique user identifier |
| Username | Display name |
| Current Workspace | Active workspace name and ID |
| API Endpoint | Backend API URL being used |
Use Cases
Verify Authentication
Check if you're logged in before running authenticated commands:
game whoami
# If logged in: displays user info
# If not logged in: error messageCheck Active Workspace
Verify which workspace is currently selected:
game whoami
# Shows: Current Workspace: Production (ws_prod123)Multi-Account Verification
When working with multiple accounts, confirm which one is active:
# Before publishing
game whoami
# Verify it's the correct account
game publishDebugging Authentication Issues
Diagnose authentication problems:
game whoami
# Check if:
# - You're authenticated
# - Using the correct account
# - Connected to the right API endpointNot Authenticated
If you're not logged in, the command displays an error:
✗ Not authenticated
Run 'game login' to authenticate with Game Framework CloudEnvironment Variables
The command respects these environment variables:
GAME_API_URL- Custom API endpointGAME_API_KEY- API key for authentication
When using environment variables, the output reflects this:
Authenticated via: API Key (environment variable)
API Endpoint: https://custom-api.example.com (from GAME_API_URL)Use game whoami before publishing or running cloud commands to ensure you're using the correct account and workspace.
Examples
Basic Usage
# Check authentication status
game whoamiBefore Publishing
# Verify identity and workspace before publishing
game whoami
# If correct, proceed with publish
game publishTroubleshooting Authentication
# Check if authenticated
game whoami
# If not authenticated, login
game login
# Verify again
game whoamiSwitching Workspaces
# Check current workspace
game whoami
# Switch workspace
game workspace select
# Verify the change
game whoamiConfiguration Source
The command reads authentication information from:
- CLI Configuration:
~/.game/config.yml - Environment Variables:
GAME_API_KEY,GAME_API_URL - OIDC Tokens: JWT tokens from Device Flow authentication
Priority order (highest to lowest):
- Environment variables
- CLI configuration file
No authentication required to run game whoami - it simply reports your current authentication state.
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Authenticated and valid |
| 1 | Not authenticated or error |
Related Commands
game login- Authenticate with Game Framework Cloudgame logout- Clear authentication credentialsgame workspace- Manage and switch workspaces
Next Steps
- Select a workspace with
game workspace select - Publish your package with
game publish - Manage configuration with
game config