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

# CLI Authentication

> Authenticate the Vidoc CLI with your API token

The CLI requires authentication to scan your code and sync results with your Vidoc project.

## Get Your Token

1. Go to [app.vidocsecurity.com](https://app.vidocsecurity.com)
2. Select your project
3. Navigate to **Settings** → **API Keys**
4. Click **"Create API Key"**
5. Copy the token

<Warning>
  Store your token securely. Don't commit it to version control.
</Warning>

## Login

### Interactive Login

```bash theme={null}
vidoc login
```

You'll be prompted to enter your token.

### Direct Login

Provide the token as an argument:

```bash theme={null}
vidoc login <your-token>
```

### Single-Tenant Installations

For self-hosted Vidoc instances, specify the API URL:

```bash theme={null}
vidoc login --url https://your-vidoc-instance.com <your-token>
```

## Profiles

Profiles let you manage multiple Vidoc configurations (e.g., different projects or environments).

### Create a Named Profile

```bash theme={null}
vidoc login --profile work <your-token>
vidoc login --profile personal <other-token>
```

### List Profiles

```bash theme={null}
vidoc config list-profiles
```

### Switch Profile

```bash theme={null}
vidoc config set-profile work
```

### Create Empty Profile

```bash theme={null}
vidoc config create-profile staging
```

### Delete Profile

```bash theme={null}
vidoc config delete-profile old-project
```

## View Current Configuration

See your current authentication status and settings:

```bash theme={null}
vidoc config show
```

## CI/CD Authentication

For CI/CD pipelines, pass the token directly:

```bash theme={null}
vidoc ci --token $VIDOC_TOKEN
```

Or use the `--token` flag with scan:

```bash theme={null}
vidoc scan --token $VIDOC_TOKEN
```

See [CI/CD Integration](/cli/ci-cd) for pipeline examples.

## Troubleshooting

### "Invalid token"

1. Verify the token was copied correctly
2. Check for extra whitespace
3. Ensure the token hasn't been revoked in the dashboard

### "Unauthorized"

The token may be associated with a deleted project. Create a new token in an active project.

## Related Pages

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/cli/installation">
    Install the CLI
  </Card>

  <Card title="Scanning" icon="magnifying-glass" href="/cli/scanning">
    Run scans
  </Card>

  <Card title="API Keys" icon="key" href="/settings/api-keys">
    Manage tokens
  </Card>

  <Card title="CI/CD" icon="gear" href="/cli/ci-cd">
    CI/CD integration
  </Card>
</CardGroup>
