---
title: "alpacon whoami"
description: "Check Alpacon identity, workspace, and permissions before running server commands. Find CLI usage, output flags, and work session information in the result."
---

> Full documentation index: https://docs.alpacax.com/llms.txt

# alpacon whoami

Show your current identity, workspace, and permissions.

## Usage

`alpacon whoami [flags]`

## Key facts

- Check which identity is being used before running commands.
- Check whether a work session is required and which session is active.
- Use `--output json` to read the result in a script.

## Flags

| Flag | Type | Description | Default |
| --- | --- | --- | --- |
| `-h, --help` | `bool` | help for whoami | `false` |
| `--output` | `string` | Output format: table or json | `table` |

## Examples

Show current identity

```bash
alpacon whoami
```

Output as JSON (useful for scripting or AI agents)

```bash
alpacon whoami --output json
```

## Output fields

| Field | Description |
|-------|-------------|
| User | Alpacon username |
| Email | Email address |
| Workspace | Workspace name and URL |
| Auth | Authentication method (browser login or API token) |
| Expires | Token expiry time (API token auth only) |
| UID | System user ID on the server |
| Shell | Default shell |
| Home | Home directory |
| Role | user, staff, or superuser |
| Groups | Group memberships with role |
| WS required | Whether your authentication requires a [work session](/reference/cli/work-session/), and the active session if one is set |

## Work session fields in JSON output

With `--output json`, the work session state is reported in dedicated fields—useful for scripts and AI agents deciding whether to create a session before running gated commands:

| Field | Description |
|-------|-------------|
| `worksession_required_for_access` | `true` when browser login requires an active work session (`work_session_required` is a legacy alias) |
| `active_worksession` | Summary of the active session—`id`, `status`, `scopes`, `servers`, `expires_at`—or `null` if none (`active_work_session` is a legacy alias) |

```json
{
  "worksession_required_for_access": true,
  "active_worksession": {
    "id": "11111111-2222-3333-4444-555555555555",
    "status": "active",
    "scopes": ["command", "websh"],
    "servers": ["web-01"],
    "expires_at": "2027-01-15T12:00:00Z"
  }
}
```

If a work session is required but none is active, create one with [`alpacon work-session create`](/reference/cli/work-session/create/).

Source: https://docs.alpacax.com/reference/cli/whoami/
