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

# CLI sign-in

> The device code flow behind reintersect login.

> Reintersect apps are in developer preview. Names and limits can still change before general
> release.

`reintersect login` signs in with a device code, like `gh auth login`. Three endpoints take part.

## Start: `POST /v0/cli/device`

Needs no credential. The body is `{ host }`, a short name for the computer (letters, digits, `.`, `_`
and `-`, up to 63 characters). It responds with:

| Field | Description |
| - | - |
| `deviceCode` | A secret the CLI polls with. |
| `userCode` | `XXXX-XXXX`, shown to the member. |
| `verificationUri`, `verificationUriComplete` | The page where the member confirms the code; the complete URL includes it. |
| `interval` | Seconds between polls. |
| `expiresIn` | Seconds until the codes expire. |

## Poll: `POST /v0/cli/device/token`

Needs no credential. The body is `{ deviceCode }`. Until the member confirms, it fails with
`ReintersectCliAuthorizationPendingError` (400) or `ReintersectCliSlowDownError` (400, with a new
`interval`). After that, it fails with `ReintersectCliDeviceCodeExpiredError` or
`ReintersectCliAccessDeniedError`, or answers with:

| Field | Description |
| - | - |
| `apiKey` | A member API key named after the computer. Store it securely. |
| `expiresAt` | When the key expires, or `null`. |
| `member` | `{ id, name, email }`. |
| `workspace` | `{ id, name }`. |

## Session: `GET /v0/cli/session`

Authenticate with a member API key or a deploy token. The response says who the credential belongs
to:
`{ kind: "member", member, workspace }` or `{ kind: "deploy", appId, repository, ref, previewOnly }`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.