# Auth CLI Commands

Source: https://wraps.dev/docs/cli-reference/auth

CLI Reference / Auth

# Auth Commands

Authenticate with the Wraps Platform for dashboard access, templates, and workflows.

## wraps auth login

Authenticate with the Wraps Platform using the device authorization flow. Opens your browser to authorize the CLI.

Usage

terminal.sh

```
npx @wraps.dev/cli auth login [options]
```

Options

`--token <token>`

Use an API token instead of the device authorization flow. Useful for CI/CD environments.

`--json`

Output result as JSON for scripting and automation

What It Does

-   Opens your browser to `wraps.dev/device` for authorization
-   Displays a one-time code in the terminal for you to confirm in the browser
-   Polls for authorization until you approve or the code expires
-   Stores the access token in `~/.wraps/auth.json`
-   Displays your account email and organization on success

Examples

Interactive login (recommended):

terminal.sh

```
npx @wraps.dev/cli auth login
```

Login with an API token (for CI/CD):

terminal.sh

```
npx @wraps.dev/cli auth login --token wraps_sk_...
```

## wraps auth status

Show your current authentication status, including account details and organization membership.

Usage

terminal.sh

```
npx @wraps.dev/cli auth status [options]
```

Options

`--json`

Output result as JSON for scripting and automation

What It Does

-   Reads the stored token from `~/.wraps/auth.json`
-   Validates the token with the Wraps Platform API
-   Displays account email, organization name, and current plan
-   Shows an error if not authenticated or if the token has expired

## wraps auth logout

Clear stored authentication credentials and log out of the Wraps Platform.

Usage

terminal.sh

```
npx @wraps.dev/cli auth logout
```

What It Does

-   Removes the access token from `~/.wraps/auth.json`
-   Confirms successful logout with a message in the terminal
-   Does not revoke the token server-side (use the dashboard for that)

## Authentication Flow

The device authorization flow lets you authenticate securely without entering credentials in the terminal.

Device Authorization Sequence

flow.txt

```
CLI                          Browser                      API |                              |                           | |-- Request device code ------>|                           | |                              |<-- Open authorize URL --->| |-- Poll for token ----------->|                           | |                              |   User approves           | |<-- Receive access token -----|                           | |-- Store in ~/.wraps/ --------|                           |
```

## Next Steps

[

Platform Commands

Connect your AWS infrastructure to the Wraps Platform for dashboards, templates, and workflows.

Learn more

](https://wraps.dev/docs/cli-reference/platform)

[

Quickstart

Get started with Wraps in under 5 minutes. Deploy email infrastructure and send your first email.

Learn more

](https://wraps.dev/docs/quickstart)

[Back to CLI Reference](https://wraps.dev/docs/cli-reference)[Platform Commands](https://wraps.dev/docs/cli-reference/platform)
