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

# Authentication

> CLI commands for login, signup, logout, email verification, and API key management.

## login

Authenticate with Valiqor. Without flags, opens a browser-based device authorization flow. With `--email` and `--password`, authenticates directly (useful in CI/CD).

```bash theme={"system"}
valiqor login [flags]
```

| Flag                | Type     | Default | Description                               |
| ------------------- | -------- | ------- | ----------------------------------------- |
| `--email` / `-e`    | `string` | —       | Email for direct login (CI/CD mode)       |
| `--password` / `-p` | `string` | —       | Password for direct login (CI/CD mode)    |
| `--force` / `-f`    | `flag`   | `false` | Force login even if already authenticated |

### Browser Flow (Interactive)

```bash theme={"system"}
valiqor login
```

The CLI opens your default browser and displays a user code. Approve the device to complete login. The CLI polls for approval automatically (up to 5 minutes).

### Direct Login (CI/CD)

```bash theme={"system"}
valiqor login --email user@example.com --password mysecret
```

<Warning>
  Avoid passing `--password` directly on shared systems. Prefer the browser flow or environment variables for CI/CD.
</Warning>

### Behavior

* Checks if an existing API key is valid before re-authenticating (skip with `--force`).
* Saves the API key to both global (`~/.valiqor/credentials.json`) and local (`.valiqorrc`).
* If you have reached the maximum number of API keys, the CLI prompts you to delete one or paste an existing key.

***

## signup

Create a new Valiqor account. Without flags, runs interactively with prompts.

```bash theme={"system"}
valiqor signup [flags]
```

| Flag                | Type     | Default | Description                                    |
| ------------------- | -------- | ------- | ---------------------------------------------- |
| `--email` / `-e`    | `string` | —       | Account email                                  |
| `--password` / `-p` | `string` | —       | Account password                               |
| `--name` / `-n`     | `string` | —       | Your name (required for direct signup)         |
| `--org` / `-o`      | `string` | —       | Organization name (required for direct signup) |

### Interactive Mode

```bash theme={"system"}
valiqor signup
```

Prompts for email, password (with confirmation), name, and organization.

### Direct Signup (CI/CD)

```bash theme={"system"}
valiqor signup --email user@example.com --password mysecret --name "Jane Doe" --org "Acme Inc"
```

### Behavior

* Checks if you are already logged in with a valid API key.
* On success, saves credentials globally and locally.

***

## logout

Clear stored credentials.

```bash theme={"system"}
valiqor logout [flags]
```

| Flag           | Type   | Default | Description                                        |
| -------------- | ------ | ------- | -------------------------------------------------- |
| `--all` / `-a` | `flag` | `false` | Also clear the API key from the local `.valiqorrc` |

### Examples

```bash theme={"system"}
# Clear global credentials only
valiqor logout

# Clear global + local credentials
valiqor logout --all
```

***

## verify-email

Send a verification email to unlock the full free tier (3 trial runs → 50 free runs).

```bash theme={"system"}
valiqor verify
```

No flags. If your email is already verified, the CLI reports that. Otherwise it triggers a verification email and opens the Valiqor dashboard as a fallback.

***

## keys

Manage API keys. Requires an existing authenticated session.

```bash theme={"system"}
valiqor keys <create|list|delete>
```

### keys create

Create a new API key.

```bash theme={"system"}
valiqor keys create [flags]
```

| Flag            | Type     | Default        | Description                      |
| --------------- | -------- | -------------- | -------------------------------- |
| `--name` / `-n` | `string` | auto-generated | Name for the new key             |
| `--save` / `-s` | `flag`   | `false`        | Save the new key to `.valiqorrc` |

```bash theme={"system"}
# Create a named key and save it locally
valiqor keys create --name "ci-key" --save
```

<Warning>
  The full key is only displayed once at creation time. Copy it immediately.
</Warning>

### keys list

List all API keys for your account.

```bash theme={"system"}
valiqor keys list
```

Displays key ID, name, prefix, created date, status (active/revoked), and usage count.

### keys delete

Delete (revoke) an API key.

```bash theme={"system"}
valiqor keys delete <key_id> [flags]
```

| Flag             | Type   | Default | Description              |
| ---------------- | ------ | ------- | ------------------------ |
| `--force` / `-f` | `flag` | `false` | Skip confirmation prompt |

```bash theme={"system"}
# Delete with confirmation
valiqor keys delete abc123

# Delete without confirmation (CI/CD)
valiqor keys delete abc123 --force
```
