# Auth (/sdk/reference/auth)



{/* Generated by docs-site/scripts/generate-sdk-docs.ts — do not edit. */}

### `cliClaim` [#cliclaim]

`POST /api/v0/auth/cli/claim`

Claim a transferred session token (CLI loopback poll)

The CLI polls with the nonce it generated; on a match within the 60s window it receives the raw session token (single-use).

```ts
import { cliClaim } from "@harmont/cloud";
```

```ts
cliClaim(options): RequestResult<CliClaimResponse>
```

**Body** `CliClaimRequest` (optional)

**Returns** `CliClaimResponse`

See [`POST /api/v0/auth/cli/claim`](/api/reference/auth) for the full request and response schema.

### `cliCode` [#clicode]

`POST /api/v0/auth/cli/code`

Mint a human-typeable CLI paste code

Mints a fresh session token for the current user and a short paste code (valid 5 minutes) the user re-types into the CLI to redeem it.

```ts
import { cliCode } from "@harmont/cloud";
```

```ts
cliCode(options): RequestResult<CliCodeResponse>
```

**Returns** `CliCodeResponse`

See [`POST /api/v0/auth/cli/code`](/api/reference/auth) for the full request and response schema.

### `cliRedeem` [#cliredeem]

`POST /api/v0/auth/cli/redeem`

Redeem a CLI paste code for a session token

The CLI submits the paste code the user typed in; on a match within the 5m window it receives the raw session token (single-use).

```ts
import { cliRedeem } from "@harmont/cloud";
```

```ts
cliRedeem(options): RequestResult<CliRedeemResponse>
```

**Body** `CliRedeemRequest` (optional)

**Returns** `CliRedeemResponse`

See [`POST /api/v0/auth/cli/redeem`](/api/reference/auth) for the full request and response schema.

### `cliTransfer` [#clitransfer]

`POST /api/v0/auth/cli/transfer`

Hand a session token to a locally-running CLI (loopback)

Mints a fresh session token for the current user and parks it under the CLI-supplied nonce for 60 seconds. The CLI claims it via the claim endpoint.

```ts
import { cliTransfer } from "@harmont/cloud";
```

```ts
cliTransfer(options): RequestResult<CliTransferResponse>
```

**Body** `CliTransferRequest` (optional)

**Returns** `CliTransferResponse`

See [`POST /api/v0/auth/cli/transfer`](/api/reference/auth) for the full request and response schema.

### `logout` [#logout]

`POST /api/v0/auth/logout`

Log out (revoke the current bearer token)

Revokes the bearer token used for this request. The token can no longer be used to authenticate. Idempotent.

```ts
import { logout } from "@harmont/cloud";
```

```ts
logout(options): RequestResult<LogoutResponse>
```

**Returns** `LogoutResponse`

See [`POST /api/v0/auth/logout`](/api/reference/auth) for the full request and response schema.
