Game Framework
CLI ReferenceCommands

game whoami

Display information about the currently authenticated user and active workspace.

Usage

game whoami

Description

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.dev

Output Fields

FieldDescription
Authenticated asEmail or username
User IDUnique user identifier
UsernameDisplay name
Current WorkspaceActive workspace name and ID
API EndpointBackend 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 message

Check 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 publish

Debugging Authentication Issues

Diagnose authentication problems:

game whoami

# Check if:
# - You're authenticated
# - Using the correct account
# - Connected to the right API endpoint

Not Authenticated

If you're not logged in, the command displays an error:

✗ Not authenticated
  Run 'game login' to authenticate with Game Framework Cloud

Environment Variables

The command respects these environment variables:

  • GAME_API_URL - Custom API endpoint
  • GAME_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 whoami

Before Publishing

# Verify identity and workspace before publishing
game whoami

# If correct, proceed with publish
game publish

Troubleshooting Authentication

# Check if authenticated
game whoami

# If not authenticated, login
game login

# Verify again
game whoami

Switching Workspaces

# Check current workspace
game whoami

# Switch workspace
game workspace select

# Verify the change
game whoami

Configuration Source

The command reads authentication information from:

  1. CLI Configuration: ~/.game/config.yml
  2. Environment Variables: GAME_API_KEY, GAME_API_URL
  3. OIDC Tokens: JWT tokens from Device Flow authentication

Priority order (highest to lowest):

  1. Environment variables
  2. CLI configuration file

No authentication required to run game whoami - it simply reports your current authentication state.

Exit Codes

CodeMeaning
0Authenticated and valid
1Not authenticated or error

Next Steps