For Agents
Cross-chain token swaps from the command line. Install the skill to give any AI agent autonomous trading across 29 chains.
$ npx skills add https://github.com/SurgeCode/intents-cli --skill intents-cli
Requires Node.js 18+ and near-cli-rs.
On first run, the CLI guides you through configuration:
Config stored at ~/.intents-cli/config.json. Credentials at ~/.near-credentials/.
Run with no arguments for the full interactive UI:
Select tokens from your balance, review quotes with rates and slippage, and confirm to execute. Colored output, spinners, and formatted tables.
Non-interactive mode with structured JSON output. Designed for AI agents, scripts, and automation pipelines.
| Command | Description |
|---|---|
| balance | Intents + native NEAR balances with USD values |
| tokens | List supported tokens (--chain, --search filters) |
| price | Read-only price check (no deposit address allocated) |
| quote | Get swap quote with deposit address |
| swap | Execute swap (--dry-run, --slippage, --min-out, --use-quote) |
| deposit | Deposit from NEAR wallet to intents balance |
| withdraw | Withdraw to any chain (--to, --chain) |
| status | Check swap/deposit status (--poll to wait) |
| batch-quote | Get quotes for multiple trades from JSON file |
| batch-swap | Execute multiple swaps from JSON file |
| account | View, create, import, list, switch accounts |
| config | View current configuration |
| ready | Check if CLI is ready for autonomous operation |
Three ways to specify tokens in agent commands:
| Format | Example | Description |
|---|---|---|
| Symbol | USDC | Auto-resolves (prefers NEAR chain) |
| Symbol:chain | USDC:eth | Specific chain (eth, sol, base, arb...) |
| Full assetId | nep141:wrap.near | Exact asset identifier |
Swap tokens within your intents balance. Supports dry runs, slippage control, minimum output protection, and two-step quote-then-execute.
Returns rate, market rate, price impact, and USD values without committing to a swap.
Move tokens from your NEAR wallet into your intents balance.
NEAR deposits are fully automated (wrap + transfer). For other chains, the CLI returns a deposit address where you send tokens manually.
Send tokens from your intents balance to any destination chain.
Returns status, swap details (amounts in/out, tx hashes, slippage), and full status history when polling.
Execute multiple trades from a JSON file.
All errors include machine-readable codes, retry hints, and recovery suggestions.
| Code | Meaning |
|---|---|
| TOKEN_NOT_FOUND | Symbol not recognized |
| TOKEN_AMBIGUOUS | Symbol matches multiple tokens — use chain qualifier |
| INSUFFICIENT_BALANCE | Not enough balance for operation |
| QUOTE_FAILED | Failed to get quote (low liquidity, amount too small) |
| QUOTE_EXPIRED | Quote expired before execution |
| RATE_LIMITED | Too many requests (includes retryAfterSeconds) |
| NOT_CONFIGURED | No NEAR account configured |
| SWAP_FAILED | Swap execution failed |
| TRANSFER_FAILED | Token transfer failed |