The LI.FI CLI wraps the LI.FI REST API to give developers, integrators, and internal teams a scriptable, human-readable interface to cross-chain swap infrastructure.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.
Quickstart
Install globally via npm: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).
Example Workflow
A typical cross-chain swap via the CLI follows this flow: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:auth commands to verify your key:
Get an API Key
Sign up at li.fi to get your API key
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 |
Next Steps
Installation
npm install, npx, and configuration options
Available Commands
Complete reference for all CLI commands
Examples
Output modes, exit codes, and end-to-end workflows
GitHub Repository
Source code and development instructions

