> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ollie.shop/llms.txt
> Use this file to discover all available pages before exploring further.

# whoami

> Show the authenticated user and the store/organization linked to the current project

`ollieshop whoami` reports who you are currently logged in as. When the current
directory has an `ollie.json`, it also resolves the **store** and
**organization** that config points at — but only if your account has access to
them.

```bash theme={"system"}
ollieshop whoami
```

## What it shows

<Tabs>
  <Tab title="Inside a project">
    When an `ollie.json` is present and you have access to its store:

    ```json theme={"system"}
    {
      "data": {
        "email": "you@example.com",
        "orgId": "0e8f...",
        "org": "Acme Inc.",
        "storeId": "1a2b...",
        "store": "Acme Storefront"
      }
    }
    ```
  </Tab>

  <Tab title="No project config">
    When there is no `ollie.json` in the current directory, only the user is
    returned, with a hint to link a store:

    ```json theme={"system"}
    {
      "data": {
        "email": "you@example.com",
        "hint": "No ollie.json found. Run `ollieshop init` to link a store."
      }
    }
    ```
  </Tab>

  <Tab title="No access to the store">
    When `ollie.json` references a store you cannot access, the store fields are
    null and a note explains why:

    ```json theme={"system"}
    {
      "data": {
        "email": "you@example.com",
        "storeId": "1a2b...",
        "store": null,
        "note": "Store not found. Run `ollieshop login` or check the storeId in ollie.json."
      }
    }
    ```
  </Tab>
</Tabs>

<Info>
  Store and organization access is enforced server-side. `whoami` never reveals
  a store you are not a member of — it simply reports it as not found.
</Info>

## Options

| Flag                  | Description                                        |
| --------------------- | -------------------------------------------------- |
| `-o, --output json`   | Force JSON output (auto-selected when piped).      |
| `--fields a,b,c`      | Limit the output to specific fields.               |
| `-s, --stage <stage>` | Read `ollie.{stage}.json` instead of `ollie.json`. |

## Examples

```bash theme={"system"}
# Pretty output in a terminal
ollieshop whoami

# JSON for scripting
ollieshop whoami -o json

# Only the email and org
ollieshop whoami --fields email,org

# Resolve against a stage-specific config
ollieshop whoami --stage dev
```

<Info>
  Not logged in or your session expired? `whoami` exits with an error — run
  `ollieshop login` to refresh your credentials.
</Info>
