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

# Login

> Authenticate with DepFixer

# Login Command

The login command authenticates you with DepFixer using a secure device code flow.

## Usage

```bash theme={null}
npx depfixer login
```

## How It Works

### 1. Generate Code

DepFixer generates a unique code for your device:

```
🔐 DEVICE CODE LOGIN
──────────────────────────────────────────────────

    Your verification code:

          ABCD-1234

    Opening browser to complete login...
    Waiting for authorization...
```

### 2. Browser Authorization

Your browser opens to the verification page where you:

1. Enter the code (auto-filled if you clicked the link)
2. Log in or create an account
3. Approve the CLI access

### 3. CLI Confirmation

Once approved, the CLI confirms:

```
✓ Logged in successfully

👤 ACCOUNT DETAILS
────────────────────────────────────────
    Name:     John Doe
    Email:    john@example.com
    Credits:  100 available
```

## Token Storage

Credentials are stored securely at:

```
~/.depfixer/credentials.json
```

File permissions are set to `0600` (owner read/write only).

## Token Refresh

Tokens are automatically refreshed when:

* Access token expires (1 hour lifetime)
* You run any authenticated command

You don't need to log in again unless:

* You explicitly log out
* Refresh token expires (30 days)
* You revoke access from the web dashboard

## Troubleshooting

### Browser Doesn't Open

Manually visit the URL shown in the terminal and enter the code.

### Code Expired

Codes expire after 15 minutes. Run `npx depfixer login` again.

### Already Logged In

If you're already logged in, you'll see your account info. Log out first with `npx depfixer logout` if you need to switch accounts.
