Skip to main content
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.
You only need to run login once. The CLI reuses the saved key for all subsequent commands.
You can skip login entirely by setting the FILEROUTER_API_KEY environment variable. The CLI reads it automatically on every invocation.

parse

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

Arguments and flags

input
string
required
A local file path or a publicly accessible URL. This is the document you want to parse.
--provider
string
default:"llamaparse"
The provider to use. Alias: -p. Accepted values: llamaparse, mistral-ocr, datalab.
--outputs
string
default:"markdown"
Comma-separated list of output types to request. Alias: -o. Example: markdown,images.
--json
boolean
default:"false"
Write the complete parse result as JSON instead of the default text output.
--out
string
Write output to a file at the given path instead of printing to stdout.
--local
boolean
default:"false"
Use your provider API key directly (BYOK mode). Bypasses the hosted FileRouter service. See BYOK Mode for details.

Examples


compare

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

Arguments and flags

input
string
required
A local file path or a publicly accessible URL. FileRouter sends this document to each provider you specify.
--providers
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.
--outputs
string
default:"markdown"
Comma-separated list of output types to request from every provider. Alias: -o.
--json
boolean
default:"false"
Write the complete comparison result as JSON instead of the summary table.
--out
string
Write output to a file at the given path instead of printing to stdout.
--local
boolean
default:"false"
Use your own provider API keys directly (BYOK mode). Bypasses the hosted FileRouter service. See BYOK Mode for details.

Examples

The default text output shows a summary table:

providers

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

Flags

--json
boolean
default:"false"
Write provider metadata as JSON instead of the default text table.

Examples

Text output:
JSON output:
The providers command works without authentication — it reads the built-in provider catalog locally without making any network requests.