npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lifi/cli

v0.1.1-alpha.1

Published

CLI for the LI.FI cross-chain bridge & DEX aggregation API

Readme

LI.FI CLI

Note: 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.

A TypeScript CLI that wraps the LI.FI REST API to give developers, integrators, and internal teams a scriptable, human-readable interface to cross-chain swap infrastructure.

Quickstart

git clone https://github.com/lifinance/lifi-cli.git
cd lifi-cli
npm install && npm run build
node dist/lifi.cjs chains

Once published to npm:

npm install -g @lifi/cli
lifi chains

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

Commands

Token Information

lifi tokens --chain 1                    # List tokens on Ethereum
lifi tokens --chain 1 --min-price 100    # Filter by min USD price
lifi token 1 USDC                        # Get specific token detail
lifi token 1 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48   # By address

Chain Information

lifi chains                    # List all supported chains
lifi chains --type EVM         # Filter by chain type
lifi chain 42161               # Get chain detail by ID
lifi chain arbitrum            # Get chain detail by name (case-insensitive)

Quote & Swap

# With flags
lifi quote \
  --from ethereum --to arbitrum \
  --from-token USDC --to-token USDC \
  --amount 1000000000 \
  --from-address 0xd8dA...

# Interactive mode (prompts for missing flags)
lifi quote

Routes

lifi routes \
  --from 1 --to 42161 \
  --from-token USDC --to-token USDC \
  --amount 1000000000 \
  --order CHEAPEST

Transaction Status

lifi status 0xabc123...                  # One-shot status check
lifi status 0xabc123... --watch          # Poll until complete/failed
lifi status 0xabc123... --bridge hop     # Speed up lookup with bridge hint

Connections

lifi connections                               # All connections
lifi connections --from-chain 1 --to-chain 42161  # Specific pair

Tools (Bridges & DEXes)

lifi tools                     # List all bridges and DEXes
lifi tools --chain 1           # Filter by chain

Gas

lifi gas                       # Gas prices for all chains
lifi gas 1                     # Detailed gas suggestion for Ethereum

API Key Management

lifi auth show                 # Display masked key
lifi auth test                 # Validate key against the API

Health Check

lifi health                    # Check API connectivity and latency

Output Modes

| Mode | Trigger | Behaviour | |------|---------|-----------| | Human | Default (TTY detected) | Coloured tables, formatted amounts | | Machine | --json flag or non-TTY pipe | Raw JSON, stable schema, no colour |

# Pipe-friendly — auto-detects non-TTY
lifi chains | jq '.chains[].name'

# Force JSON in terminal
lifi chains --json

# Disable colour
lifi chains --no-color

# Verbose errors with stack traces
lifi quote --from 1 --to 42161 --verbose

Configuration

All configuration is via environment variables. No config files needed.

# LI.FI API key (higher rate limits)
export LIFI_API_KEY=your_key_here

Without LIFI_API_KEY, the CLI uses public rate limits (200 req/2hr). With a key, you get 200 req/min.

Exit Codes

| Code | Meaning | |------|---------| | 0 | Success | | 1 | General error | | 2 | Invalid arguments / usage | | 3 | Authentication error | | 4 | API error (rate limit, server error) | | 5 | Network error (unreachable) |

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 |

Example Workflow: Cross-Chain Swap

# 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

Installation

npm (primary)

npm install -g @lifi/cli

npx (no install)

npx @lifi/cli chains

Development

git clone https://github.com/lifinance/lifi-cli.git
cd lifi-cli
npm install
npm run build
node dist/lifi.cjs --help

Scripts

| Script | Description | |--------|-------------| | npm run build | Build with tsup | | npm run dev | Watch mode | | npm test | Run tests (vitest) | | npm run typecheck | Type check (tsc --noEmit) |

License

MIT