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

# FileRouter CLI Commands: parse, compare, login, providers

> Full reference for FileRouter CLI commands: login to authenticate, parse with one provider, compare providers side by side, and list what's available.

The FileRouter CLI ships four commands: `login` authenticates your session, `parse` sends a document to a single provider, `compare` runs the same document through multiple providers side by side, and `providers` lists what's available. Every command supports `npx @file_router/cli <command>` or the `filerouter` binary if you installed the CLI globally.

***

## login

Authenticate this CLI with FileRouter using your browser. The `login` command opens your browser for authorization and saves an API key to your machine once you approve.

```bash theme={null}
npx @file_router/cli login
```

You only need to run `login` once. The CLI reuses the saved key for all subsequent commands.

<Note>
  You can skip `login` entirely by setting the `FILEROUTER_API_KEY` environment variable. The CLI reads it automatically on every invocation.
</Note>

***

## parse

Parse a single document with one provider and print the result to your terminal.

```bash theme={null}
npx @file_router/cli parse <file-or-url>
```

### Arguments and flags

<ParamField path="input" type="string" required>
  A local file path or a publicly accessible URL. This is the document you want to parse.
</ParamField>

<ParamField query="--provider" type="string" default="llamaparse">
  The provider to use. Alias: `-p`. Accepted values: `llamaparse`, `mistral-ocr`, `datalab`.
</ParamField>

<ParamField query="--outputs" type="string" default="markdown">
  Comma-separated list of output types to request. Alias: `-o`. Example: `markdown,images`.
</ParamField>

<ParamField query="--json" type="boolean" default="false">
  Write the complete parse result as JSON instead of the default text output.
</ParamField>

<ParamField query="--out" type="string">
  Write output to a file at the given path instead of printing to stdout.
</ParamField>

<ParamField query="--local" type="boolean" default="false">
  Use your provider API key directly (BYOK mode). Bypasses the hosted FileRouter service. See [BYOK Mode](/cli/byok-mode) for details.
</ParamField>

### Examples

<CodeGroup>
  ```bash Parse with the default provider theme={null}
  npx @file_router/cli parse report.pdf
  ```

  ```bash Choose a specific provider theme={null}
  npx @file_router/cli parse report.pdf --provider mistral-ocr
  ```

  ```bash Request multiple outputs theme={null}
  npx @file_router/cli parse report.pdf --outputs markdown,images
  ```

  ```bash Save the full result as JSON theme={null}
  npx @file_router/cli parse report.pdf --json --out result.json
  ```

  ```bash Parse a public URL theme={null}
  npx @file_router/cli parse https://example.com/document.pdf
  ```
</CodeGroup>

***

## compare

Run the same document through multiple providers in parallel and view the results side by side.

```bash theme={null}
npx @file_router/cli compare <file-or-url>
```

### Arguments and flags

<ParamField path="input" type="string" required>
  A local file path or a publicly accessible URL. FileRouter sends this document to each provider you specify.
</ParamField>

<ParamField query="--providers" type="string" default="llamaparse,mistral-ocr,datalab">
  Comma-separated list of provider IDs to include in the comparison. Alias: `-p`. Omit this flag to compare all providers at once.
</ParamField>

<ParamField query="--outputs" type="string" default="markdown">
  Comma-separated list of output types to request from every provider. Alias: `-o`.
</ParamField>

<ParamField query="--json" type="boolean" default="false">
  Write the complete comparison result as JSON instead of the summary table.
</ParamField>

<ParamField query="--out" type="string">
  Write output to a file at the given path instead of printing to stdout.
</ParamField>

<ParamField query="--local" type="boolean" default="false">
  Use your own provider API keys directly (BYOK mode). Bypasses the hosted FileRouter service. See [BYOK Mode](/cli/byok-mode) for details.
</ParamField>

### Examples

<CodeGroup>
  ```bash Compare across all providers theme={null}
  npx @file_router/cli compare report.pdf
  ```

  ```bash Compare two specific providers theme={null}
  npx @file_router/cli compare report.pdf --providers llamaparse,mistral-ocr
  ```

  ```bash Save the full comparison as JSON theme={null}
  npx @file_router/cli compare report.pdf --json --out comparison.json
  ```

  ```bash Compare a public URL theme={null}
  npx @file_router/cli compare https://example.com/document.pdf
  ```
</CodeGroup>

The default text output shows a summary table:

```
Compared report.pdf

PROVIDER         STATUS      DETAIL
llamaparse       success     1423ms
mistral-ocr      success     891ms
datalab          success     2104ms
```

***

## providers

List all available document providers and the output types each one supports.

```bash theme={null}
npx @file_router/cli providers
```

### Flags

<ParamField query="--json" type="boolean" default="false">
  Write provider metadata as JSON instead of the default text table.
</ParamField>

### Examples

<CodeGroup>
  ```bash List providers as a text table theme={null}
  npx @file_router/cli providers
  ```

  ```bash List providers as JSON theme={null}
  npx @file_router/cli providers --json
  ```
</CodeGroup>

**Text output:**

```
llamaparse       markdown, text, pages, tables, images, json, metadata
mistral-ocr      images, json, markdown, metadata, pages, tables
datalab          chunks, html, images, json, markdown, metadata
```

**JSON output:**

```json theme={null}
[
  {
    "id": "llamaparse",
    "name": "LlamaParse",
    "capabilities": {
      "execution": "async",
      "features": ["blocks", "page-selection"],
      "outputs": ["markdown", "text", "pages", "tables", "images", "json", "metadata"]
    }
  },
  {
    "id": "mistral-ocr",
    "name": "Mistral OCR",
    "capabilities": {
      "execution": "sync",
      "features": ["blocks", "confidence", "page-selection"],
      "outputs": ["images", "json", "markdown", "metadata", "pages", "tables"]
    }
  },
  {
    "id": "datalab",
    "name": "Datalab",
    "capabilities": {
      "execution": "async",
      "features": ["page-selection"],
      "outputs": ["chunks", "html", "images", "json", "markdown", "metadata"]
    }
  }
]
```

<Tip>
  The `providers` command works without authentication — it reads the built-in provider catalog locally without making any network requests.
</Tip>
