@sperax/cli
v0.2.1
Published
Sperax API CLI — manage keys, test endpoints, monitor usage
Maintainers
Readme
@sperax/cli
Install
npm install @sperax/cliSperaxOS CLI — DeFi intelligence, AI agents, and Web3 tooling from your terminal. Zero sign-up required for the flagship commands.
npx @sperax/cli analyze vitalik.ethInstall
# One-time global install
npm install -g @sperax/cli
# Or zero-install with npx
npx @sperax/cli analyze 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045Quick start (no sign-up)
# Analyze any wallet — no API key needed
sperax analyze vitalik.eth
sperax analyze 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
# Current top yield opportunities
sperax top-yields
sperax top-yields --stablecoin-only --min-tvl 10m
# Live price dashboard (updates every 5 s, press Ctrl+C to quit)
sperax watch ETH
sperax watch ARB --chain arbitrum
# Large exchange flow alerts
sperax whale-alerts
# Interactive AI chat (free tier available)
sperax chat
sperax chat "What are the risks of holding GLP on Arbitrum?"Command reference
| Command | Description | Auth |
|---|---|---|
| analyze <address> | Full portfolio analysis with AI risk score | Optional |
| watch <token> | Live price + trade feed | No |
| top-yields | Top yield opportunities across DeFi | No |
| whale-alerts | Large exchange inflow/outflow | No |
| chat [query] | Interactive or one-shot AI chat | Optional |
| auth login | Save API key for premium features | — |
| auth logout | Clear stored credentials | — |
| auth whoami | Show current user | Yes |
| config set <k=v> | Set a config value | — |
| config get [key] | Get config value(s) | — |
| intel trending | Top trending tokens | Yes |
| intel yields | Yield opportunities | Yes |
| intel prices | Token prices | Yes |
| intel gas | Gas tracker | Yes |
| intel news | Crypto news | Yes |
| intel whale-alerts | Exchange flows | Yes |
| agent list | List agents | Yes |
| agent run <id> | Run an agent | Yes |
| portfolio | Wallet portfolio (detailed) | Yes |
| tools list/search/run | Manage tools | Yes |
| keys list/create/revoke | API key management | Yes |
| usage | Credit usage | Yes |
| ping | Health check | No |
| docs | Open API docs in browser | — |
analyze
sperax analyze <address> [options]
Options:
--chain <chain> ethereum, arbitrum, base, polygon
--format <fmt> table (default), json, csv
--json Shorthand for --format json
--csv Shorthand for --format csvSample output:
┌────────────────────────────────────────────────────────────┐
│ SperaxOS · Wallet Analysis │
│ vitalik.eth (0xd8dA…6045) │
└────────────────────────────────────────────────────────────┘
📊 Portfolio Overview
Total Value: $4,287,432
24h Change: +$89,234 (+2.1%) ▲
Chains: Ethereum, Arbitrum, Base
💼 Top Holdings
┌──────────┬────────────┬────────┬─────────┐
│ Token │ Value │ Alloc │ 24h │
├──────────┼────────────┼────────┼─────────┤
│ ETH │ $2.10M │ 49.0% │ +1.8% ▲ │
│ USDC │ $890.00K │ 20.8% │ 0.0% │
│ UNI │ $420.00K │ 9.8% │ +4.2% ▲ │
└──────────┴────────────┴────────┴─────────┘
⚡ AI Risk Assessment
Risk Score: 42/100 (Moderate)
✅ Well diversified across 12 assets
⚠️ 24% of ETH is unstaked (~$504K opportunity at 4.2% APY)
🔗 Open full analysis: https://chat.sperax.io/wallet/0xd8dA…
Powered by SperaxOS · chat.sperax.iowatch
sperax watch <token> [options]
Options:
--chain <chain> Chain (default: ethereum)Updates every 5 seconds. Press Ctrl+C to quit.
top-yields
sperax top-yields [options]
Options:
--min-tvl <size> e.g. 10m, 100m, 1b
--min-apy <pct> minimum APY percentage
--stablecoin-only only stablecoin pools
--chain <chain> filter by chain
-l, --limit <n> max results (default: 20)
--format <fmt> table, json, csvconfig
# Set API key
sperax config set apiKey=spa_xxxx
# Change default output format
sperax config set format=json
# View all settings
sperax config get
# Config stored at ~/.sperax/config.jsonScripting & automation
All commands support --format json and --format csv for programmatic use:
# Pipe portfolio total value into jq
sperax analyze 0x... --format json | jq '.totalValueUsd'
# Export yields to CSV
sperax top-yields --format csv > yields.csv
# Analyze multiple wallets from a file
cat wallets.txt | xargs -I{} sperax analyze {} --format json
# Periodic whale alert check
while true; do
sperax whale-alerts --format json
sleep 60
doneAuthentication
Most read-only commands work without authentication. For premium features (AI analysis, portfolio tracking, agent creation) run:
sperax auth login
# Prompts for your API key — get one at chat.sperax.io/settings/api-keysOr set the environment variable:
export SPERAX_API_KEY=spa_xxxxDevelopment
# Run in development mode (no build step)
bun run dev -- analyze vitalik.eth
# Build for production
bun run build
# Run tests
bunx vitest run --silent='passed-only' 'src/__tests__'License
MIT · chat.sperax.io
License
cli is released under the Apache-2.0 license.
