Ophis CLI
Use the Ophis CLI to check prices, swap tokens and bridge between networks by typing commands in your terminal.
Before you start
| Requirement | Details |
|---|---|
| Computer | Node.js 20 or later; npm comes with Node.js |
| Phone wallet | MetaMask, Rabby, Trust Wallet, Rainbow or Ledger Wallet |
Install the CLI
-
Install the package. Run this command in your terminal:
npm install -g @ophis/cli -
Check the version. A version number confirms the installation:
ophis --version
Run the install command again to update. To run the CLI once without installing:
npx @ophis/cli help
Connect your wallet
-
Start the connection. Run:
ophis connect -
Scan with your wallet. Open its WalletConnect scanner and scan the QR code, or paste the pairing link into the wallet.
-
Approve the connection. Your wallet handles signing requests and keeps your keys.
| Wallet | Where to scan |
|---|---|
| MetaMask | Scan, in the account menu or at the top right |
| Rabby | Settings > WalletConnect |
| Trust Wallet | Scan QR code, at the top right |
| Rainbow | Scan icon on the home screen |
| Ledger Wallet | Open an account, then its WalletConnect icon |
Scan the code inside your wallet app. Keep the wallet open while the CLI waits for a response; in Ledger Wallet, stay on the WalletConnect screen.
Quote and swap
-
Check the price. Request a quote:
ophis quote 5 USDC ETH -
Start the swap. Sell USDC for ETH:
ophis swap 5 USDC ETH -
Review and approve. Confirm the amounts in the terminal, then approve in your wallet. Approve token spending if requested, then sign the order. Each approval covers the amount needed. Selling ETH uses WETH, its token form, and requires wrapping if needed.
Bridge tokens
Move USDC from Base to Arbitrum through Across:
ophis bridge 25 USDC to arbitrum
| CLI bridge setting | Networks |
|---|---|
| Supported sources | Ethereum, Arbitrum, Base |
| Default source | Base |
Confirm the route in the terminal and approve in your wallet. Use ophis status <order id> to follow the transfer.
Choose the chain
The default network is Base. Add a chain name to change the source or destination.
| Words | Meaning | Example |
|---|---|---|
on arbitrum | Trade on Arbitrum | ophis swap 5 USDC ETH on arbitrum |
to arbitrum | Trade on Base and receive on Arbitrum | ophis swap 5 USDC ETH to arbitrum |
from arbitrum to base | Bridge from Arbitrum to Base | ophis bridge 25 USDC from arbitrum to base |
-c <chain> | Same as on | Select the source chain |
--to-chain <chain> | Same as to | Select the destination chain |
For an Arbitrum order, use ophis status <order id> on arbitrum.
| Network list | Chains |
|---|---|
| Mainnets | Arbitrum One, Arc, Avalanche, Base, BNB Chain, Ethereum, Gnosis, Ink, Linea, Optimism, Plasma, Polygon, Robinhood Chain, Unichain |
| Testnet | Sepolia |
| Total | 15 |
Run ophis chains to see the names to type.
Swap fees
| Charge | Amount |
|---|---|
| Ophis base | 0.01%; 0.01 USDC on a 100 USDC swap |
| Price improvement | Share and cap shown on every quote and confirmation |
| Upstream volume fee on partner-hosted networks | 0.02%, or 0.003% on correlated pairs such as stablecoins |
| Combined volume fee on partner-hosted networks | 0.03% standard / 0.013% correlated; improvement and execution costs are additional |
| Partner-hosted networks | 10, including Base |
| Ophis-operated networks | Optimism, Unichain, Robinhood Chain, Arc; no upstream fee |
| Across bridge fee | Included in the displayed amounts |
If the order fills, settlement enforces the amount shown as At least. A quote or signed order does not guarantee a fill. See Fees for improvement capture and upstream fee details.
Signing an order is free. Token approvals, wrapping ETH and ophis recover require network fees. Each approval covers the amount needed for that swap.
Wallet checks
The CLI checks the Ophis token list first, then public lists from swap.ophis.fi. It flags tokens outside the Ophis list and rejects ambiguous names. Before approving, match the wallet's amounts and token addresses to the terminal.
Connection and tokens
The wallet did not answer
Keep the wallet open, then run ophis connect again if needed. Some wallets, including Rabby, drop the connection on restart. Use ophis wallet to check the session.
Connect another network
Add the network in your wallet's settings. Run ophis connect and approve the connection again, then check the chain with ophis wallet.
Use ETH on another chain
| Network | Token to request |
|---|---|
| Arc, Polygon, Gnosis | ETH resolves to WETH automatically |
| Avalanche, Plasma | WETH |
ophis quote 5 USDC WETH on avalanche
ophis quote 5 USDC WETH on plasma
Use the dollar token on Robinhood Chain
Use USDG on Robinhood Chain.
ophis quote 5 USDG ETH on robinhood
Command reference
Replace the angle-bracket placeholders with your values. In a quote or swap, the first token is sold and the second is received.
| Command | Action |
|---|---|
ophis connect | Link your wallet with a QR code or pairing link |
ophis quote <amount> <token> <token> | Check the price |
ophis swap <amount> <token> <token> | Confirm a swap and approve in your wallet |
ophis bridge <amount> <token> to <chain> | Move tokens through Across |
ophis status <order id> | Track an order or bridge |
ophis wallet | Show your wallet and connected chains |
ophis recover [token] | Recover tokens left by a bridge; use ophis recover USDC on base to look for an older transfer |
ophis disconnect | Unlink your wallet |
ophis chains | List networks and their command names |
ophis help | Show commands and options |