# phi auth

Sign in and inspect the active identity.

## phi auth login

Sign in through your browser and save the sign-in as a profile.

```bash
phi auth login [KEY] [options]
```

### Arguments

| Name | Required | Description |
|---|---|---|
| `KEY` | Optional |  |

### Options

| Flag | Value | Description |
|---|---|---|
| `--profile` | PROFILE | Named profile to write. |
| `--api` | API | Base URL to sign in to. Defaults to the profile's, then production. |
| `--key` | switch | Use an API key instead of signing in: KEY if given, else PHI_API_KEY, else a prompt. |
| `--device` | switch | Sign in from a machine with no browser, with a code. |
| `--interactive` | switch | Ask for the base URL instead of taking the default. |

## phi auth logout

Sign out: revoke the stored sign-in and remove the credential from the profile.

```bash
phi auth logout [options]
```

### Options

| Flag | Value | Description |
|---|---|---|
| `--profile` | PROFILE | Named profile to clear. |

## phi auth profiles

List configured profiles and mark the active one.

```bash
phi auth profiles
```

## phi auth whoami

Print the resolved identity for the active profile, with names where the API has them.

```bash
phi auth whoami
```


---
Source: https://dynophi.com/docs/cli/auth. From the installed client, phi 0.4.2, 2026-11-23.
