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

# gavai whoami

> Print the signed-in user and active workspace.

export const ErrorTable = ({errors}) => <div className="gv-error-table" role="table" aria-label="Errors and fixes">
    <div className="gv-error-table__head" role="row">
      <span className="gv-error-table__col-head" role="columnheader">Error</span>
      <span className="gv-error-table__col-head" role="columnheader">Cause</span>
      <span className="gv-error-table__col-head" role="columnheader">Fix</span>
    </div>
    {errors.map((err, i) => <div className="gv-error-table__row" role="row" key={i}>
        <code className="gv-error-table__code" role="cell">{err.code}</code>
        <div className="gv-error-table__cause" role="cell">{err.cause}</div>
        <div className="gv-error-table__fix" role="cell">{err.fix}</div>
      </div>)}
  </div>;

export const ExpectedOutput = ({caption = "Expected output", children}) => <div className="gv-output">
    <div className="gv-output__label">
      <svg className="gv-output__icon" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
        <polyline points="15 10 20 15 15 20" />
        <path d="M4 4v7a4 4 0 0 0 4 4h12" />
      </svg>
      <span>{caption}</span>
    </div>
    <div className="gv-output__body">{children}</div>
  </div>;

export const Eyebrow = ({label, tone = "default"}) => <div className={`gv-eyebrow gv-eyebrow--${tone}`}>
    <span className="gv-eyebrow__bar" aria-hidden="true" />
    <span className="gv-eyebrow__label">{label}</span>
  </div>;

<Eyebrow label="CLI" />

This page covers `gavai whoami`, which prints the identity bound to the stored credentials: the signed-in user's email and the slug of the active workspace. You can use it before running any command that writes — `patch`, `publish`, `invite` — so you don't push a change to the wrong workspace.

## Synopsis

```bash theme={null}
gavai whoami
```

## Arguments

None.

## Flags

<Note>
  Run `gavai whoami --help` for the authoritative flag list.
</Note>

## Behavior

The command calls `GET /v1/me` with the access token from `~/.config/gavai/credentials.json` and prints a single-line summary of the response. The full response shape lives at [Me resource](/api-reference/resources/me).

## Example output

<ExpectedOutput>
  ```text theme={null}
  gavin@acme.io (workspace: acme)
  ```
</ExpectedOutput>

If no credentials are stored, the command exits with code `3`:

<ExpectedOutput caption="No credentials on disk (exit code 3)">
  ```text theme={null}
  Error: not authenticated. Run `gavai login`.
  ```
</ExpectedOutput>

## Examples

Confirm the current identity:

```bash theme={null}
gavai whoami
```

Branch on the active workspace in a script:

```bash theme={null}
if gavai whoami | grep -q "workspace: acme"; then
  gavai publish page_01HXR8K2M4
fi
```

## Exit codes

<ErrorTable
  errors={[
{ code: "0", cause: "Identity printed.", fix: "—" },
{ code: "3", cause: "No credentials stored.", fix: "Run `gavai login`." },
{ code: "7", cause: "Network or API server error.", fix: "Retry with backoff. Check status at status.gavai.app." },
]}
/>

See [CLI overview — exit codes](/cli/overview#exit-codes) for the full table.

<Card title="gavai tenant" href="/cli/commands/tenant">
  List every workspace the signed-in user can access.
</Card>
