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

# Overview

> A scriptable, human-readable command-line interface to LI.FI cross-chain swap infrastructure

The LI.FI CLI wraps the [LI.FI REST API](https://li.quest) to give developers, integrators, and internal teams a scriptable, human-readable interface to cross-chain swap infrastructure.

<Warning>
  This CLI provides **read-only** tools — it does not sign or broadcast transactions. Quote responses include unsigned `transactionRequest` objects that must be signed and submitted externally using your own wallet.
</Warning>

## Quickstart

Install globally via npm:

```bash theme={"system"}
npm install -g @lifi/cli
lifi chains
```

Or run without installing:

```bash theme={"system"}
npx @lifi/cli chains
```

No API key required — works immediately with public rate limits. Add a key for higher throughput.

## How It Works

The CLI wraps the LI.FI REST API into structured commands that output human-readable tables (TTY) or machine-readable JSON (pipes / `--json` flag).

```text theme={"system"}
CLI Command (lifi quote, lifi chains, etc.)
    │
    ▼
LI.FI API (https://li.quest)
    │
    ▼
27+ Bridges & 31+ DEXes across 58 chains
```

## Example Workflow

A typical cross-chain swap via the CLI follows this flow:

```bash theme={"system"}
# 1. Find chain IDs
lifi chains --type EVM

# 2. Look up token addresses
lifi token 1 USDC

# 3. Get best quote
lifi quote \
  --from 1 --to 8453 \
  --from-token USDC --to-token USDC \
  --amount 1000000000 \
  --from-address 0xYOUR_ADDRESS

# 4. (External) Approve tokens and sign transactionRequest with your wallet

# 5. Track progress
lifi status 0xTX_HASH --watch
```

## API Key Configuration

Without an API key, the CLI uses the public rate limit (**200 requests / 2 hours**). With an API key, you get higher rate limits (**200 requests / minute**).

Set your API key via environment variable:

```bash theme={"system"}
export LIFI_API_KEY=your_key_here
```

Use the `auth` commands to verify your key:

```bash theme={"system"}
lifi auth show    # Display masked key
lifi auth test    # Validate key against the API
```

<Card title="Get an API Key" icon="key" href="https://li.fi/">
  Sign up at li.fi to get your API key
</Card>

## Common Chain IDs

| Chain     | ID    | Native Token |
| --------- | ----- | ------------ |
| Ethereum  | 1     | ETH          |
| Polygon   | 137   | MATIC        |
| Arbitrum  | 42161 | ETH          |
| Optimism  | 10    | ETH          |
| BSC       | 56    | BNB          |
| Avalanche | 43114 | AVAX         |
| Base      | 8453  | ETH          |

<Tip>
  Use `lifi chains` to dynamically look up chain IDs instead of hardcoding them.
</Tip>

## Next Steps

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/cli/installation">
    npm install, npx, and configuration options
  </Card>

  <Card title="Available Commands" icon="terminal" href="/cli/commands">
    Complete reference for all CLI commands
  </Card>

  <Card title="Examples" icon="code" href="/cli/examples">
    Output modes, exit codes, and end-to-end workflows
  </Card>

  <Card title="GitHub Repository" icon="github" href="https://github.com/lifinance/lifi-cli">
    Source code and development instructions
  </Card>
</CardGroup>
