prism (CLI)
Command-line tool for the Prism wallet infrastructure. Create wallets, execute swaps, and inspect balances — all from the terminal.
Works with the same wallet and aggregator stack as the SDK packages.
Install
npm install -g @prism-ing/cli
Or run without installing:
npx @prism-ing/cli swap --from USDC:base --to WETH:base --amount 1000000 --dry-run
Quick Start
# 1. Create a wallet (persists at ~/.ows/)
prism wallet create --name my-agent
# 2. Configure your aggregator
prism config set aggregator-url https://your-aggregator.fly.dev
# 3. Check connectivity
prism doctor
# 4. Get a quote (no execution)
prism swap --from USDC:base --to WETH:base --amount 1000000 --dry-run
# 5. Execute the swap
prism swap --from USDC:base --to WETH:base --amount 1000000
Commands
prism wallet
Manage OWS wallets stored at ~/.ows/.
prism wallet create --name <name> # Create or load a named wallet
prism wallet show --name <name> # Show addresses for a wallet
prism wallet list # List all wallet names
Example:
$ prism wallet create --name trading-agent
✓ Wallet ready
EVM: 0x71C7656EC7ab88b098defB751B7401B5f6d8976F
Solana: DRpbCBMxVnDK7maPM5tGv6MvB3v1sRMC86PZ8okm21hy
Same name = same keys = same addresses on every run. Keys persist encrypted at ~/.ows/.
JSON output:
prism wallet create --name my-agent --json
# {"evmAddress":"0x...","solanaAddress":"...","walletName":"my-agent"}
prism swap
Quote and execute swaps. Supports same-chain EVM, same-chain Solana, and cross-chain.
prism swap --from <asset> --to <asset> --amount <amount> [options]
Arguments:
| Flag | Description | Default |
|---|---|---|
--from |
Source asset. Format: SYMBOL:chain or 0xAddress:chainId |
required |
--to |
Destination asset. Same format as --from |
required |
--amount |
Amount in smallest unit (e.g. 1000000 for 1 USDC) |
required |
--slippage |
Slippage tolerance in basis points | 50 |
--provider |
Pin to a specific solver (see table below) | best price |
--dry-run |
Fetch quote only, do not execute | false |
--json |
Output as JSON | false |
Solvers (use with --provider):
| Value | Route | Notes |
|---|---|---|
swaps-xyz |
Same-chain EVM, Solana, or cross-chain bridge | Default for all routes |
fynd |
Same-chain EVM | Optional, server-side dep |
Examples:
# Same-chain EVM: USDC → WETH on Base
prism swap --from USDC:base --to WETH:base --amount 1000000
# Same-chain Solana: USDC → SOL
prism swap --from USDC:solana --to SOL:solana --amount 1000000
# Cross-chain: USDC on Base → USDC on Arbitrum (bridge)
prism swap --from USDC:base --to USDC:arbitrum --amount 5000000
# Quote only — no execution
prism swap --from USDC:base --to WETH:base --amount 1000000 --dry-run
# Pin to a specific solver
prism swap --from USDC:base --to WETH:base --amount 1000000 --provider fynd
# JSON output (pipe to jq)
prism swap --from USDC:base --to WETH:base --amount 1000000 --dry-run --json | jq '.provider'
JSON output shape:
{
"quoteId": "pq_abc123",
"provider": "swaps-xyz",
"routeType": "same-chain-evm",
"fromAsset": { "symbol": "USDC", "chain": "base" },
"toAsset": { "symbol": "WETH", "chain": "base" },
"amountIn": "1000000",
"amountOut": "413821",
"netAmountOut": "412000",
"priceImpactBps": 4
}
prism balance
Show the aggregated balance across all chains for the current wallet.
prism balance
prism balance --wallet <name>
prism balance --json
prism tokens
List all tokens available on the connected aggregator.
prism tokens
prism tokens --json
prism chains
List all chains available on the connected aggregator.
prism chains
prism chains --json
prism config
Read and write the CLI configuration file (~/.prism/config.json).
prism config set <key> <value>
prism config show
Config keys:
| Key | Description | Default |
|---|---|---|
aggregator-url |
Aggregator base URL (must include /v1) |
— |
wallet-name |
Default wallet name used by all commands | default |
smart-account-address |
ERC-4337 Kernel v3.1 smart account address (enables gasless EVM when set alongside ZERODEV_PROJECT_ID) |
— |
aggregator-url is normalized by the CLI:
- If you set a bare host like
https://your-aggregator.fly.dev, the CLI stores and useshttps://your-aggregator.fly.dev/v1. - If you provide a versioned path like
https://your-aggregator.fly.dev/v1, it is preserved.
Config file location: ~/.prism/config.json
{
"aggregatorUrl": "https://your-aggregator.fly.dev/v1",
"walletName": "trading-agent",
"smartAccountAddress": "0xYourKernelAccountAddress"
}
RPC Configuration
The CLI ships with no bundled RPC keys. You must supply your own endpoints.
Recommended: ZeroDev (one project ID covers all 20 EVM chains)
If you already set ZERODEV_PROJECT_ID for gasless execution (see below), RPC URLs for all EVM chains are derived automatically from it — no additional config needed. Add a Solana RPC and you're done:
# ~/.prism/.env
ZERODEV_PROJECT_ID=your-project-id # also used for gasless EVM + Solana
PRISM_SOL_RPC=https://mainnet.helius-rpc.com/?api-key=YOUR_KEY
Per-chain overrides
Set any of these to use a different provider for a specific chain:
PRISM_RPC_1=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY
PRISM_RPC_8453=https://base-mainnet.g.alchemy.com/v2/YOUR_KEY
Variable reference:
| Variable | Chain | Chain ID |
|---|---|---|
PRISM_RPC_1 |
Ethereum | 1 |
PRISM_RPC_10 |
OP Mainnet | 10 |
PRISM_RPC_56 |
BNB Chain | 56 |
PRISM_RPC_130 |
Unichain | 130 |
PRISM_RPC_137 |
Polygon | 137 |
PRISM_RPC_143 |
Monad | 143 |
PRISM_RPC_146 |
Sonic | 146 |
PRISM_RPC_324 |
ZKsync Era | 324 |
PRISM_RPC_480 |
World Chain | 480 |
PRISM_RPC_999 |
HyperEVM | 999 |
PRISM_RPC_2741 |
Abstract | 2741 |
PRISM_RPC_4217 |
Tempo | 4217 |
PRISM_RPC_4326 |
MegaETH | 4326 |
PRISM_RPC_8453 |
Base | 8453 |
PRISM_RPC_9745 |
Plasma | 9745 |
PRISM_RPC_33139 |
Apechain | 33139 |
PRISM_RPC_42161 |
Arbitrum One | 42161 |
PRISM_RPC_43114 |
Avalanche | 43114 |
PRISM_RPC_59144 |
Linea | 59144 |
PRISM_RPC_60808 |
BOB | 60808 |
PRISM_SOL_RPC |
Solana | — |
Without RPC endpoints configured, swap execution will fail. --dry-run (quote only) works without RPCs because no on-chain calls are made.
Gasless Execution (ZeroDev)
Set ZERODEV_PROJECT_ID to enable gas sponsorship. Get a project ID at dashboard.zerodev.app and configure a gas policy there first.
# ~/.prism/.env
ZERODEV_PROJECT_ID=your-project-id
Gasless Solana activates automatically — users pay zero SOL in transaction fees.
Gasless EVM additionally requires a deployed smart account address in config:
prism config set smart-account-address 0xYourKernelAccountAddress
When both are set, EVM swaps are bundled (token approval + swap in one UserOperation) and gas is fully sponsored — the EOA needs no native token balance.
prism doctor
Check aggregator connectivity and wallet configuration.
prism doctor
prism doctor --json
Reports: aggregator reachability, wallet exists, config file location, any missing env vars.
Asset Formats
| Format | Example | Notes |
|---|---|---|
| Symbol + chain | USDC:base |
Resolved by the aggregator |
| Symbol + chain | SOL:solana |
Native SOL on Solana |
| Address + chainId | 0xA0b8...:8453 |
Specific token by contract address |
Supported chain shorthands: ethereum / eth, op / optimism, bnb / bsc, polygon / matic, unichain, monad, sonic, zksync, worldchain, hyperevm, abstract, tempo, megaeth, base, plasma, apechain, arbitrum / arb, avalanche / avax, linea, bob, solana / sol.
JSON Output and Scripting
Every command supports --json for machine-readable output. Useful for scripting.
# Extract the winning provider
PROVIDER=$(prism swap --from USDC:base --to WETH:base --amount 1000000 --dry-run --json | jq -r '.provider')
echo "Best provider: $PROVIDER"
# Get wallet EVM address
EVM=$(prism wallet create --name my-agent --json | jq -r '.evmAddress')
echo "EVM address: $EVM"
Agent Integration
The CLI is designed for use in agent workflows and CI scripts.
Test all solvers:
# Dry-run every solver to confirm they're live after a deployment
for PROVIDER in swaps-xyz fynd; do
echo "Testing $PROVIDER..."
prism swap --from USDC:base --to WETH:base --amount 1000000 \
--provider $PROVIDER --dry-run --json | jq -r '"\(.provider): \(.netAmountOut)"'
done
Automated cross-chain transfer:
#!/usr/bin/env bash
set -euo pipefail
RESULT=$(prism swap \
--from USDC:base \
--to USDC:arbitrum \
--amount 10000000 \
--json)
TX_HASH=$(echo "$RESULT" | jq -r '.txHash')
echo "Swap confirmed: $TX_HASH"
Wallet Security Model
The CLI stores wallets via the OWS (Open Wallet Standard) encrypted vault:
- Keys are persisted at
~/.ows/<wallet-name>.json - Encrypted with AES-256-GCM, key derived via scrypt
- No seed phrase or private key is ever printed or logged
- Same wallet name resolves to the same keys on every run
--jsonoutput only includes addresses, never key material
To use a passphrase for additional protection, set OWS_PASSPHRASE in your environment before running any prism command.
Documentation
@prism-ing/wallet— Wallet SDK, session keys, social recovery@prism-ing/swap-router— Multi-solver DEX aggregation
License
MIT