> ## 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 Scanning

> Scan your codebase for security vulnerabilities using the CLI

Use the Vidoc CLI to scan your code for security vulnerabilities from your terminal.

## Basic Scan

Navigate to your project directory and run:

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

Or simply:

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

The CLI indexes your code, scans for vulnerabilities, and syncs results with your Vidoc project.

## Scan Options

### Force Reindex

Force a complete reindex of the codebase (useful if files changed outside of git):

```bash theme={null}
vidoc scan --force-reindex
# or
vidoc scan -f
```

### Index Only

Index the codebase without running a full scan:

```bash theme={null}
vidoc scan --only-indexing
```

### Use a Specific Profile

Scan using a named profile:

```bash theme={null}
vidoc scan --profile work
# or
vidoc scan -p work
```

### Override Token

Use a specific token for this scan:

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

### Custom API URL

For single-tenant installations:

```bash theme={null}
vidoc scan --api-url https://your-vidoc-instance.com
```

### Custom Config File

Use a specific configuration file:

```bash theme={null}
vidoc scan --config /path/to/config
# or
vidoc scan -c /path/to/config
```

## How Scanning Works

```mermaid theme={null}
flowchart LR
    A[vidoc scan] --> B[Index Files]
    B --> C[Upload to Vidoc]
    C --> D[AI Analysis]
    D --> E[Results in Dashboard]
```

1. **Index** - CLI analyzes your local files
2. **Upload** - Code is sent to Vidoc for analysis
3. **Analyze** - AI scans for security vulnerabilities
4. **Results** - View findings in the Vidoc dashboard

## Viewing Results

After scanning, view results in the Vidoc dashboard:

1. Go to [app.vidocsecurity.com](https://app.vidocsecurity.com)
2. Select your project
3. Navigate to **Issues** to see findings

## CI Mode

For CI/CD pipelines, use the dedicated `ci` command:

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

This runs in non-interactive mode optimized for automated environments. See [CI/CD Integration](/cli/ci-cd) for details.

## Global Options

These options work with any command:

| Option             | Short | Description                   |
| ------------------ | ----- | ----------------------------- |
| `--force-reindex`  | `-f`  | Force complete reindex        |
| `--only-indexing`  |       | Index only, skip full scan    |
| `--profile <name>` | `-p`  | Use named profile             |
| `--api-url <url>`  |       | Override API URL              |
| `--token <token>`  |       | Override authentication token |
| `--config <path>`  | `-c`  | Custom config file path       |

## Troubleshooting

### "Not authenticated"

Run `vidoc login` to authenticate, or pass `--token` with your scan.

### "No files found"

1. Check you're in the correct directory
2. Ensure the directory contains supported file types
3. Verify the project is properly initialized

### Scan Taking Too Long

1. Use `--only-indexing` first to see indexing progress
2. Large codebases take longer on first scan
3. Subsequent scans are faster (incremental indexing)

## Related Pages

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

  <Card title="Authentication" icon="key" href="/cli/authentication">
    Configure tokens
  </Card>

  <Card title="CI/CD Integration" icon="gear" href="/cli/ci-cd">
    Automate in pipelines
  </Card>

  <Card title="Issues" icon="bug" href="/dashboard/issues">
    Review scan results
  </Card>
</CardGroup>
