Skip to main content
The composio whoami command displays your current authentication status and account information.

Usage

composio whoami

Description

Displays your global user context including:
  • User API key (redacted)
  • Default organization ID
  • Default project ID
  • Test user ID (if configured)

Examples

Check Authentication Status

composio whoami
Output (when logged in):
┌───────────────────────────────────────────────────────┐
│ Global User Context                                   │
├───────────────────────────────────────────────────────┤
│ Global User API Key: ak_***aBc123                     │
│ Default Org ID: k2OiqRLMdHyM                          │
│ Default Project ID: pr_xlSR6oN5jIlk                   │
│ Test User ID: not set                                 │
└───────────────────────────────────────────────────────┘
Output (when not logged in):
⚠  You are not logged in yet. Please run `composio login`.

Capture API Key in Scripts

# Extract API key from JSON output (piped mode)
API_KEY=$(composio whoami 2>/dev/null | jq -r '.global_user_api_key')
echo "API Key: $API_KEY"
Piped output (stdout only):
{
  "global_user_api_key": "uak_b813ydmoEYdB_xBxGHeW",
  "default_org_id": "k2OiqRLMdHyM",
  "default_project_id": "pr_xlSR6oN5jIlk",
  "test_user_id": null
}
When piped or redirected, composio whoami outputs only structured JSON to stdout. All decoration (boxes, formatting) is suppressed.

Use in CI/CD

# Verify authentication before running other commands
if composio whoami > /dev/null 2>&1; then
  echo "Authenticated"
  composio generate
else
  echo "Not authenticated. Run: composio login"
  exit 1
fi

Output Fields

global_user_api_key
string
Your user API key. In interactive mode, this is redacted (e.g., ak_***aBc123). In piped mode, the full key is output.
default_org_id
string | null
Your default organization ID. Set during composio login.
default_project_id
string | null
Your default project nano ID (starts with pr_). Set during composio login.
test_user_id
string | null
Test user ID for development/testing. Set during composio login if available.

Configuration File

The whoami command reads from ~/.composio/user-config.json:
{
  "api_key": "uak_b813ydmoEYdB_xBxGHeW",
  "base_url": "https://backend.composio.dev",
  "web_url": "https://platform.composio.dev",
  "org_id": "k2OiqRLMdHyM",
  "project_id": "pr_xlSR6oN5jIlk",
  "test_user_id": "pg-test-12345"
}
You can also override these values with environment variables (see Environment Variables).

Interactive vs. Piped Output

The CLI follows Unix conventions for composable output:

Interactive Mode (TTY)

  • stdout: Silent (no data output)
  • stderr: Decorated output with boxes and formatting
  • Human-readable display

Piped Mode (Not TTY)

  • stdout: Structured JSON only
  • stderr: Silent (all decoration suppressed)
  • Machine-readable for scripts
Example:
# Interactive: shows decorated box on screen
composio whoami

# Piped: captures clean JSON
composio whoami | jq

# File redirect: writes clean JSON
composio whoami > account.json

# Command substitution: captures clean JSON
ORG_ID=$(composio whoami | jq -r '.default_org_id')

Next Steps

login

Authenticate with Composio

Environment Variables

Configure the CLI

Build docs developers (and LLMs) love