Skip to Content
CLIOverview

CLI Overview

The Spectrum CLI is a command-line interface for the Spectrum API: blocks, gas, balances, tokens, DeFi yields, NFTs, ENS, smart-contract reads, and raw JSON-RPC across 20+ chains. It wraps the TypeScript SDK and outputs raw JSON by default, so it pipes cleanly into tools like jq.

npm install -g @spectrumnodes/cli
# Configure once (the URL embeds your tenant token) spectrum config set api https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/spectrumapi/v1/ spectrum config set default-chain ethereum spectrum prices price ETH spectrum tokens balance 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 spectrum yields best --token USDC --limit 5 spectrum ens resolve vitalik.eth

Features

  • Raw JSON on stdout by default for clean piping; add --human for aligned key-value pairs and tables
  • Up-front validation of arguments, chains, and JSON payloads before any request
  • Built-in retries with exponential backoff and response caching
  • A machine-readable command catalog (spectrum commands) for agents and scripts
  • Config precedence across flags, environment, and a permission-hardened config file

Namespaces

Every command follows the shape spectrum <namespace> <command>.

NamespaceDescriptionExample
coreBlocks, gas, transactions, gas estimationspectrum core block-height --chain ethereum
tokensNative and token balances, metadata, allowancesspectrum tokens balance 0xd8dA...
yieldsLending, vaults, staking, best-yield discoveryspectrum yields best --token USDC
pricesToken prices, history, top markets, searchspectrum prices price ETH
defiSwaps, positions, approvals, perps, funding ratesspectrum defi uniswap-v3-quote ...
nftsNFT collections, balances, ownership, metadataspectrum nfts collection 0xBC4C...
ensENS resolution and reverse lookupspectrum ens resolve vitalik.eth
registryProtocol registry, contract addresses, chainsspectrum registry protocols
rpcDirect JSON-RPC proxy to chain nodesspectrum rpc request eth_blockNumber
contractsSmart contract reads, multicall, simulationspectrum contracts read-contract ...
solanaSolana-specific convenience methodsspectrum solana slot
cosmosCosmos SDK accounts, delegations, validators, supplyspectrum cosmos validators --chain cosmoshub
dataLogs, transfers, receipts, portfolio, health, tracesspectrum data portfolio 0xd8dA...
utilsAPI health checkspectrum utils health

Requirements

  • Node.js 20 or later