> ## Documentation Index
> Fetch the complete documentation index at: https://acm-aa28ebf6.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# superbox auth

> Authenticate with SuperBox using Firebase authentication

## Overview

Authenticate with SuperBox using Firebase authentication. Supports email/password, Google OAuth, and GitHub OAuth.

<Info>Authentication tokens are stored in `~/.superbox/auth.json`</Info>

## Commands

### `superbox auth register`

Create a new SuperBox account.

```bash theme={null}
superbox auth register
```

**Process:**

* Prompts for email and password
* Creates Firebase account
* Automatically logs you in
* Stores tokens locally

**Example:**

```bash theme={null}
$ superbox auth register
Email: user@example.com
Password: ********
Successfully registered and logged in
```

### `superbox auth login`

Log in to your SuperBox account.

```bash theme={null}
superbox auth login [--provider PROVIDER] [--email EMAIL] [--password PASSWORD]
```

#### Options

<ParamField path="--provider" type="string" default="email">
  Authentication provider: `email`, `google`, or `github`
</ParamField>

<ParamField path="--email" type="string">
  Email address (for email provider only)
</ParamField>

<ParamField path="--password" type="string">
  Password (for email provider only)
</ParamField>

#### Email/Password Login

```bash theme={null}
$ superbox auth login --provider email
Email: user@example.com
Password: ********
Successfully logged in
```

#### OAuth Device Flow (Google/GitHub)

<Steps>
  <Step title="Initiate OAuth Flow">
    ```bash theme={null}
    superbox auth login --provider google
    # or
    superbox auth login --provider github
    ```
  </Step>

  <Step title="Browser Opens">
    Browser opens to device verification page

    ```text theme={null}
    Visit: http://localhost:8000/api/v1/auth/device?code=XXXX-XXXX
    Or enter code: XXXX-XXXX
    ```
  </Step>

  <Step title="Complete Authorization">
    Authorize in browser, CLI detects completion automatically
  </Step>

  <Step title="Token Stored">
    Authentication tokens saved to `~/.superbox/auth.json`
  </Step>
</Steps>

**Example:**

```bash theme={null}
$ superbox auth login --provider google
Opening browser for Google authentication...
Visit this URL: http://localhost:8000/api/v1/auth/device?code=XXXX-XXXX
Waiting for authentication...
Successfully authenticated with Google
```

### `superbox auth status`

Check current authentication status.

```bash theme={null}
superbox auth status
```

**Example:**

```bash theme={null}
$ superbox auth status
Logged in as: user@example.com
Provider: google
```

### `superbox auth refresh`

Manually refresh authentication token.

```bash theme={null}
superbox auth refresh
```

**Example:**

```bash theme={null}
$ superbox auth refresh
Token refreshed successfully
```

### `superbox auth logout`

Log out from current session.

```bash theme={null}
superbox auth logout
```

**Example:**

```bash theme={null}
$ superbox auth logout
Logged out successfully
```

## Troubleshooting

<Accordion title="Browser doesn't open">
  Manually visit the URL and enter the code:

  ```text theme={null}
  https://superbox.1mindlabs.org/device?code=ABCD-1234
  ```
</Accordion>

## Next Steps

<CardGroup cols={2}>
  <Card title="Initialize Project" icon="plus" href="/cli/init">
    Create MCP server
  </Card>

  <Card title="Push Server" icon="upload" href="/cli/push">
    Publish to marketplace
  </Card>
</CardGroup>
