intents-cli
v0.1.10
Published
Cross-chain token swaps from the command line. Built for AI agents, scripts, and automation.
Maintainers
Readme
intents-cli
███╗ ██╗███████╗ █████╗ ██████╗
████╗ ██║██╔════╝██╔══██╗██╔══██╗
██╔██╗ ██║█████╗ ███████║██████╔╝
██║╚██╗██║██╔══╝ ██╔══██║██╔══██╗
██║ ╚████║███████╗██║ ██║██║ ██║
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝
I N T E N T SCross-chain token swaps from the command line. Built for AI agents, scripts, and automation.
npx intents-cli@latestFeatures
- Cross-chain swaps - Swap tokens across NEAR, Ethereum, Solana, Base, and more
- Intents balance - Manage your tokens in the NEAR Intents system
- Deposits & withdrawals - Move tokens between chains and your Intents balance
- Interactive UI - Beautiful CLI interface with search, menus, and status updates
- Agent-friendly - Designed for automation and scripting
Quick Start
npx intents-cli@latestOn first run, the CLI will guide you through:
- Setting up your API key (optional, reduces fees)
- Creating or importing a NEAR account
Usage
$ npx intents-cli@latest
> Get Quote & Swap Execute token swaps
View Balances See your Intents balance
Deposit to Intents Add tokens from any chain
Withdraw from Intents Send tokens to any chain
Settings Configure preferencesSwap Example
$ npx intents-cli@latest
Select token to swap FROM:
> wNEAR (Balance: 50.00)
Select token to swap TO:
> USDC
Enter amount: 10
Quote:
FROM 10.00 wNEAR
TO 14.55 USDC
Rate 1 wNEAR = 1.455 USDC
> Execute this swap
✓ Swap complete! Received 14.55 USDCRequirements
- Node.js 18+
- near-cli-rs installed
Install near-cli-rs
# macOS
brew install near-cli-rs
# Or with cargo
cargo install near-cli-rsConfiguration
Config is stored at ~/.intents-cli/config.json
API Key
Get an API key at partners.near-intents.org to reduce swap fees.
Without an API key, swaps incur a 0.1% fee.
How It Works
┌─────────────────────────────────────────────────────────────┐
│ Your tokens on any chain (NEAR, Ethereum, Solana, etc) │
└─────────────────────────────────────────────────────────────┘
│
│ DEPOSIT
▼
┌─────────────────────────────────────────────────────────────┐
│ INTENTS BALANCE │
│ (intents.near contract) │
│ │
│ Your balance: │
│ ├── 1000 USDC │
│ ├── 0.5 ETH │
│ └── 50 wNEAR │
│ │
│ SWAPS happen here (instant, cross-chain) │
└─────────────────────────────────────────────────────────────┘
│
│ WITHDRAW
▼
┌─────────────────────────────────────────────────────────────┐
│ Destination: Any supported chain/address │
└─────────────────────────────────────────────────────────────┘Commands
| Command | Description |
|---------|-------------|
| npx intents-cli@latest | Start interactive CLI |
| npx intents-cli@latest --help | Show help |
| npx intents-cli@latest --version | Show version |
Agent CLI
For automation and AI agents, use the agent subcommand which returns JSON responses:
npx intents-cli@latest agent <command> [options]Available Commands
| Command | Description |
|---------|-------------|
| balance | Get account balances (native NEAR and intents) |
| tokens | List available tokens with optional filters |
| quote | Get a swap quote without executing |
| swap | Execute a token swap |
| deposit | Deposit tokens to intents balance |
| withdraw | Withdraw tokens from intents |
| status | Check swap/deposit status by address |
| account | View, create, import, or switch accounts |
| config | View current configuration |
Quick Examples
# Check balance
npx intents-cli@latest agent balance
# Get a swap quote
npx intents-cli@latest agent quote --from=USDC --to=wNEAR --amount=0.01
# Execute a swap
npx intents-cli@latest agent swap --from=USDC --to=wNEAR --amount=0.01
# Deposit NEAR to intents
npx intents-cli@latest agent deposit --token=NEAR --amount=0.1
# Withdraw to wallet
npx intents-cli@latest agent withdraw --token=USDC --amount=0.01 --to=myaccount.near
# Cross-chain withdraw to Base
npx intents-cli@latest agent withdraw --token=USDC --amount=1 --to=0x... --chain=base
# Check swap status
npx intents-cli@latest agent status --address=<depositAddress>JSON Response Format
All agent commands return JSON with this structure:
{
"ok": true,
"command": "balance",
"data": { ... },
"meta": { "durationMs": 1234 }
}On error:
{
"ok": false,
"command": "balance",
"error": {
"code": "NOT_CONFIGURED",
"message": "No NEAR account configured. Run setup first."
}
}Command Help
Get help for any command:
npx intents-cli@latest agent --help
npx intents-cli@latest agent swap --helpFor detailed API schemas and response types, see docs/AGENT_API.md.
Links
License
MIT
