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

# Install the FileRouter CLI and Authenticate Your Account

> Install @file_router/cli and authenticate with FileRouter in minutes. Parse and compare documents from the terminal using a hosted API key or BYOK mode.

The FileRouter CLI lets you parse and compare documents across providers directly from your terminal. You can run it instantly with `npx`, install it globally, or authenticate once and start sending files to the hosted service — no configuration files required.

## Requirements

The CLI requires **Node.js 22.14.0 or later**. Check your version with:

```bash theme={null}
node --version
```

## Run or Install the CLI

You have two options: run the CLI on demand with `npx`, or install it globally so the `filerouter` binary is always available.

<CodeGroup>
  ```bash npx (no install required) theme={null}
  npx @file_router/cli --help
  ```

  ```bash npm (global install) theme={null}
  npm install -g @file_router/cli
  ```

  ```bash yarn (global install) theme={null}
  yarn global add @file_router/cli
  ```

  ```bash pnpm (global install) theme={null}
  pnpm add -g @file_router/cli
  ```
</CodeGroup>

After a global install, you can run the CLI using the `filerouter` binary:

```bash theme={null}
filerouter --help
```

All examples in these docs use `npx @file_router/cli` — substitute `filerouter` if you installed globally.

## Authenticate

Before you can use the hosted FileRouter service, you need to authenticate. Run:

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

The CLI prints a verification URL and a short code in your terminal, then opens your browser. Approve the request in the browser, and the CLI saves an API key to your machine automatically. You only need to do this once.

<Steps>
  <Step title="Run the login command">
    ```bash theme={null}
    npx @file_router/cli login
    ```

    Your terminal prints a verification URL and a short code, then opens your browser.
  </Step>

  <Step title="Approve in the browser">
    Confirm the code shown in your terminal matches the one on screen, then approve the request.
  </Step>

  <Step title="Return to the terminal">
    Once approved, the CLI prints `Authenticated.` and saves your API key locally. You're ready to parse documents.
  </Step>
</Steps>

## Verify the Setup

Run the following command to confirm the CLI is working and list the available providers:

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

You should see output similar to:

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

<Note>
  You can skip the `login` step by setting the `FILEROUTER_API_KEY` environment variable instead. The CLI reads it automatically:

  ```bash theme={null}
  FILEROUTER_API_KEY=your_key npx @file_router/cli parse report.pdf
  ```
</Note>
