> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://mammoth.io/docs/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# mammoth auth

> All 5 mammoth auth commands with examples, arguments and confirmation flags: Sign in, sign out, and inspect credentials.

> Generated from mammoth-cli 2.4.2, released 2026-11-02: `mammoth schema list`, `mammoth capability list` and the CLI's own `--help`. Do not edit by hand; run `npm run docs:capabilities`.

Sign in, sign out, and inspect credentials. 5 commands.

Every command also takes the [global flags](https://mammoth.io/docs/build/cli/global-flags/) (`--output`, `--yes`, `--confirm`, `--dry-run`, `--input`, `--profile`, ...), which are not repeated below. `--input` takes a JSON or YAML document of the input fields; `mammoth schema get COMMAND_ID` prints a command's full input schema.

**Confirmation.** Commands marked `--yes --confirm TARGET` or `--yes` always need those flags, even at a terminal: they never prompt. Commands marked "`--yes` or prompt" ask at an interactive terminal (table output, no `--no-input`) and otherwise need `--yes`. `--dry-run` skips confirmation and sends nothing.

## Summary

| Command | What it does | Effect | Confirmation |
|---|---|---|---|
| [`auth login`](#mammoth-auth-login) | Log in and store one profile's credentials. | Benign mutation | — |
| [`auth logout`](#mammoth-auth-logout) | Remove one profile's (or every profile's) stored credentials. | Benign mutation | — |
| [`auth status`](#mammoth-auth-status) | Report local authentication state for one profile. | Read | — |
| [`auth connected-apps list`](#mammoth-auth-connected-apps-list) | List the apps connected to your account; each id is a grant id. | Read | — |
| [`auth connected-apps revoke`](#mammoth-auth-connected-apps-revoke) | Disconnect one connected app from your account. Grant id is positional. | High impact | `--yes --confirm TARGET` |

## auth commands

### mammoth auth login

Log in and store one profile's credentials.

Input fields (--method token only; --device and --method oauth take none): api_token\* (str), server_prefix (str)

```bash
mammoth auth login
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `--server-prefix` | flag | no | — | `str` | Server prefix (one DNS label). Default 'app'. |
| `--storage` | flag | no | `auto` | `str` | Credential storage backend. |
| `--method` | flag | no | — | `str` | How to sign in: a browser (oauth), a code typed on another device (device) or a pasted API token (token). |
| `--no-browser` | flag | no | — | `flag` | Print the sign-in URL instead of opening a browser. |
| `--device` | flag | no | — | `flag` | Sign in with a device code, for a machine with no browser: the CLI prints a short code and a URL, you approve on any other device, and the CLI polls until you do. Same as --method device. |
| `api_token` | `--input` field | yes | — | `str` |  |
| `server_prefix` | `--input` field | no | — | `str` |  |

- **Effect:** Benign mutation, scope `local` · **Confirmation:** none
- **Id:** `auth.login` · **Result:** `AuthLoginResult`

### mammoth auth logout

Remove one profile's (or every profile's) stored credentials.

```bash
mammoth auth logout
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `--all` | flag | no | — | `flag` | Remove every profile. |

- **Effect:** Benign mutation, scope `local` · **Confirmation:** none
- **Id:** `auth.logout` · **Result:** `AuthLogoutResult`

### mammoth auth status

Report local authentication state for one profile.

```bash
mammoth auth status
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `--check` | flag | no | — | `flag` | Perform a live connection check. |

- **Effect:** Read, scope `local` · **Confirmation:** none
- **Id:** `auth.status` · **Result:** `AuthStatusResult`

## auth connected-apps

### mammoth auth connected-apps list

List the apps connected to your account; each id is a grant id.

```bash
mammoth auth connected-apps list
```

- **Effect:** Read, scope `local` · **Confirmation:** none
- **Preconditions:** Read-only. The apps the signed-in user has authorised; each id is the grant id that auth connected-apps revoke takes.
- **Id:** `auth.connected-apps.list` · **Result:** `AuthConnectedAppsListResult` · **Backed by:** SDK `mammoth.api.user_profile.UserProfileAPI.connected_apps`, API `GET /self/oauth-grants` (ListConnectedApps)

### mammoth auth connected-apps revoke

Disconnect one connected app from your account. Grant id is positional.

```bash
mammoth auth connected-apps revoke 123 --yes --confirm 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `OAUTH_GRANT_ID` | positional | yes | — | `int` | ID of the oauth grant. |

- **Effect:** High impact, scope `local` · **Confirmation:** always `--yes --confirm TARGET`, even at a terminal (TARGET is the exact id or name acted on; the `confirmation_required` error's hint names it)
- **Preconditions:** Exact grant-ID confirmation (--yes --confirm ID). Disconnects the app: its tokens stop working for this user.
- **Id:** `auth.connected-apps.revoke` · **Result:** `AuthConnectedAppsRevokeResult` · **Backed by:** SDK `mammoth.api.user_profile.UserProfileAPI.revoke_connected_app`, API `DELETE /self/oauth-grants/{oauth_grant_id}` (RevokeConnectedApp)

---
Source: https://mammoth.io/docs/build/cli/auth.md · Updated: 2026-11-02
