CLI for the Relay cross-chain bridge/swap protocol. Bridge and swap assets across 85+ chains from your terminal.
curl -fsSL https://raw.githubusercontent.com/starc007/relay-cli/main/install.sh | shDetects your OS and architecture, downloads the right binary, installs to /usr/local/bin/relay.
npx skills add starc007/relay-clicargo install --path .Download a binary from releases, extract, and put relay in your $PATH.
relay config set --private-key 0x...
relay config set --api-key your-key # optional, for higher rate limitsConfig is stored at ~/.relay/config.json. Private key is masked in relay config show.
RPC URLs for 11 major EVM chains are bundled by default (Ethereum, Base, Arbitrum, Optimism, Polygon, Avalanche, BSC, zkSync, Scroll, Linea, Zora). No extra setup needed to bridge on these chains.
List all supported chains.
relay chains
relay chains --filter base
relay chains --filter 8453List tokens available on a chain.
relay tokens --chain 8453
relay tokens --chain 1 --filter usdc
relay tokens --chain 8453 --verifiedGet USD price for a token.
relay price ETH --chain 1
relay price USDC --chain 8453
relay price 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 --chain 1Get a quote without executing. --amount is in human-readable units.
relay quote \
--from-chain 1 --from-currency ETH \
--to-chain 8453 --to-currency ETH \
--amount 0.001 \
--user 0xYourAddress
relay quote \
--from-chain 1 --from-currency USDC \
--to-chain 42161 --to-currency USDC \
--amount 100 \
--user 0xYourAddressToken symbols (ETH, USDC, WBTC, etc.) resolve to contract addresses automatically.
Quote and execute a cross-chain bridge/swap.
relay bridge \
--from-chain 1 --from-currency ETH \
--to-chain 8453 --to-currency ETH \
--amount 0.001 \
--user 0xYourAddress
# Different recipient
relay bridge \
--from-chain 1 --from-currency ETH \
--to-chain 8453 --to-currency ETH \
--amount 0.001 \
--user 0xYourAddress \
--recipient 0xOtherAddressRequires a private key set via relay config set --private-key or RELAY_PRIVATE_KEY env var.
Check the status of a bridge request.
# One-shot
relay status 0xrequestId...
# Poll until complete
relay status 0xrequestId... --watchStatus values: pending, success, failure, refund.
View past transactions for a wallet.
relay history --user 0xYourAddress
relay history --user 0xYourAddress --limit 50
relay history --user 0xYourAddress --status successStatus filter options: success, failure, refund, pending, depositing.
relay config show
relay config set --private-key 0x...
relay config set --api-key your-key
relay config set --testnet true
# RPC management
relay config list-rpcs
relay config set-rpc --chain 1 --url https://eth-mainnet.g.alchemy.com/v2/key| Flag | Env | Description |
|---|---|---|
--api-key |
RELAY_API_KEY |
Relay API key (higher rate limit) |
--private-key |
RELAY_PRIVATE_KEY |
Wallet private key |
--testnet |
— | Use testnet API |
Default public RPCs are bundled for these chains:
| Chain ID | Network |
|---|---|
| 1 | Ethereum |
| 10 | Optimism |
| 56 | BSC |
| 137 | Polygon |
| 324 | zkSync |
| 8453 | Base |
| 42161 | Arbitrum |
| 43114 | Avalanche |
| 59144 | Linea |
| 534352 | Scroll |
| 7777777 | Zora |
Override any or add others:
relay config set-rpc --chain 1 --url https://eth-mainnet.g.alchemy.com/v2/key
relay config set-rpc --chain 81457 --url https://rpc.blast.ioEnv var RPC_<chainId> takes priority over config if both are set.
MIT
