Features
- Log Fetching: Parallel RPC requests across multiple endpoints
- Transaction Analysis: Decode transactions with signature lookup
- Account Operations: Balance, transactions, token transfers
- Contract Tools: ABI fetching, source code, bytecode analysis, security patterns
- Type Conversions: Wei/Gwei/Eth, hex/dec, checksums, hashing
- RPC Commands: Direct blockchain calls (call, block, storage, etc.)
- ENS Resolution: Resolve names to addresses and reverse lookup
- Gas Oracle: Real-time gas prices from Etherscan
- Simulation: Transaction simulation via cast, Tenderly, or debug RPC
- Tenderly Integration: Virtual testnets, contracts, alerts, and actions
- Address Book: Save and lookup addresses by label
- Self-Updating: Check for updates and auto-install
- Multi-chain: Ethereum, Polygon, Arbitrum, Optimism, Base, BSC, Avalanche
Aggregation Commands
- Price Aggregation: Multi-source prices from CoinGecko, DefiLlama, Alchemy, Moralis, Chainlink, Pyth, CCXT
- Portfolio Aggregation: Balance data from Alchemy, Dune SIM, Moralis
- NFT Aggregation: Holdings from Alchemy, CoinGecko, Moralis, Dune SIM
- Yield Aggregation: DeFi yields from DefiLlama and Curve
- Quote Aggregation: Swap quotes from OpenOcean, KyberSwap, 0x, 1inch, CowSwap, LI.FI, Velora, Enso
Direct API Access
- Alchemy: NFTs, prices, portfolio, transfers, debug traces
- CoinGecko: Coins, prices, NFTs, exchanges
- DefiLlama: TVL, prices, yields, stablecoins
- Moralis: Wallet, token, NFT, DeFi, transactions
- Dune SIM: Balances, activity, collectibles, DeFi positions
- Dune Analytics: Queries, executions, tables
- Curve Finance: Pools, volumes, lending, tokens, router
- Chainlink: Price feeds (RPC-based, no API key needed)
- CCXT: Exchange data (Binance, Bitget, OKX, Hyperliquid)
- Uniswap: V2/V3/V4 pool queries (on-chain + subgraph)
- Yearn Kong: Vaults, strategies, prices, TVL, reports
Direct DEX Aggregator Access
- 1inch: Quote, swap, tokens, liquidity sources, approvals
- OpenOcean: Quote, swap, reverse quote, tokens, DEX sources
- KyberSwap: Routes, route data, transaction building
- 0x Protocol: Quote, price, liquidity sources
- CowSwap: MEV-protected quotes, orders, trades, auctions
- LI.FI: Cross-chain quotes, routes, bridges, chains, tokens
- Velora/ParaSwap: Price, transaction building, tokens
- Enso Finance: DeFi routes, prices, balances
- Pyth Network: Real-time price feeds, feed search
Security & Analysis
- Bytecode Analysis: Function selector extraction (evmole), opcode disassembly, security pattern detection
- GoPlus Security: Token, address, NFT, and approval security analysis
- Solodit: Smart contract vulnerability database search
- Blacklist: Token blacklist management for spam/scam filtering
Installation
Download Binary
# macOS (Apple Silicon)
|
# macOS (Intel)
|
# Linux (x86_64)
|
Install with Cargo
Or from source:
MCP Server (AI Integration)
For AI assistants and LLMs, use ethcli-mcp - a companion MCP (Model Context Protocol) server that exposes ethcli functionality as tools.
# Install
# Run (communicates via STDIO)
Features:
- 80+ tools covering all ethcli functionality
- JSON Schema validation for all inputs
- Rate limiting and timeout protection
- Works with Claude, GPT, and other MCP-compatible AI assistants
Configuration (Claude Desktop):
See ethcli-mcp for full documentation.
Quick Start
# Fetch Transfer events from USDC
# Analyze a transaction
# Get account balance
# Resolve ENS name
# Get current gas prices
# Get swap quotes from all DEX aggregators
Commands
Logs - Fetch Historical Events
# Fetch specific events
# Fetch all events (auto-fetches ABI from Etherscan), output as CSV
# Output to SQLite
# High concurrency with resume
Transaction - Analyze Transactions
# Analyze a transaction
# Show decoded input data
# Output as JSON
Account - Balance and History
# Get ETH balance
# Get token balance
# List recent transactions
# List token transfers
Contract - ABI, Source Code, and Bytecode Analysis
# Get contract ABI
# Get source code
# Get creation transaction
# Extract function selectors from bytecode (no ABI needed)
# Disassemble bytecode into opcodes
# Get opcode frequency statistics
# Security analysis (detects dangerous patterns)
Cast - Type Conversions and Hashing
# Unit conversions
# Hex/decimal
# Hashing
# Address tools
# ABI encode/decode
RPC - Direct Blockchain Calls
# Call a contract (read-only)
# Get block info (supports decimal or hex block numbers)
# Read storage slot
# Get contract code
# Get nonce
# Get transaction receipt
# Chain info
ENS - Name Resolution
# Resolve name to address
# Reverse lookup (address to name)
# Get resolver
# Compute namehash
Gas - Gas Oracle
# Get current gas prices
# Estimate confirmation time
Token - Token Operations
# Get token info
# Get top holders
Signature - Lookup Function/Event Signatures
# Lookup function by selector
# Lookup event by topic
Address Book
# Save an address with a label
# Lookup by label
# List all saved addresses
# Remove an address
Simulate - Transaction Simulation
# Simulate a contract call
# Simulate with trace output
# Trace an existing transaction
# Use different backends
Tenderly - Virtual TestNets & API
Requires TENDERLY_ACCESS_KEY environment variable.
# List virtual testnets
# Create a vnet
# Get vnet RPC URL
# Set wallet balance on vnet
# Simulate transaction via RPC (tenderly_simulateTransaction)
# Simulate bundle via RPC (tenderly_simulateBundle)
# List contracts
# List alerts
Endpoints - Manage RPC Endpoints
# List configured endpoints
# Add an endpoint (auto-detects capabilities)
# Add with explicit node type (archive nodes preferred for historical queries)
# Test an endpoint
# Remove an endpoint
Node Types:
archive- Full historical state, required for queries at old blocksfull- Only recent state (~128 blocks), cheaper to rununknown- Default, capabilities not yet tested
When querying historical blocks, ethcli automatically prefers archive nodes if configured.
Config - Configuration Management
# Initialize config with template
# Show config file path
# Show current config
# Set Etherscan API key
# Set Tenderly credentials
Update & Doctor
# Check for updates
# Auto-install latest version
# Check configuration and endpoint health
Aggregation Commands
Price - Multi-Source Price Aggregation
Query token prices from multiple sources in parallel and get aggregated results.
# Get aggregated price for a token
# Query specific chain
# Query specific source
# LP token prices (Curve priority)
# Output formats
Sources: CoinGecko, DefiLlama, Alchemy, Moralis, Chainlink, Pyth, CCXT
Portfolio - Multi-Source Balance Aggregation
# Get aggregated portfolio balances
# With options
Sources: Alchemy, Dune SIM, Moralis
NFTs - Multi-Source NFT Aggregation
# Get aggregated NFT holdings
# With options
Sources: Alchemy, CoinGecko, Moralis, Dune SIM
Yields - DeFi Yield Aggregation
# Get DeFi yields
Sources: DefiLlama, Curve Finance
Quote - DEX Aggregator Quotes
Get swap quotes from multiple DEX aggregators in parallel.
# Get the best quote from all aggregators
# Get quote from a specific aggregator
# Compare quotes from all aggregators side-by-side
# Use human-readable amounts with --decimals
# Include transaction data in output
# Set slippage tolerance (basis points, default 50 = 0.5%)
# Provide sender address for more accurate quotes
# JSON output
Available Aggregators:
| Alias | Aggregator | Notes |
|---|---|---|
openocean, oo |
OpenOcean | Multi-chain DEX aggregator |
kyberswap, kyber |
KyberSwap | Dynamic routing |
0x, zerox |
0x Protocol | Professional-grade liquidity |
1inch, oneinch |
1inch | Pathfinder algorithm |
cowswap, cow |
CowSwap | MEV-protected trades |
li.fi, lifi |
LI.FI | Cross-chain aggregator |
velora, paraswap |
Velora/ParaSwap | Multi-protocol routing |
enso, ensofi |
Enso Finance | DeFi shortcuts |
Direct API Commands
Alchemy - Alchemy API
Requires ALCHEMY_API_KEY environment variable.
# NFT queries
# Token data
# Transfers
# Debug traces
Gecko - CoinGecko API
Optional COINGECKO_API_KEY for Pro API (higher rate limits).
# Coin data
# Price queries
# Market data
# NFT data
# Exchanges
Llama - DefiLlama API
Optional DEFILLAMA_API_KEY for Pro endpoints.
# TVL data
# Prices
# Yields
# Stablecoins
Moralis - Moralis API
Requires MORALIS_API_KEY environment variable.
# Wallet data
# NFT data
# Token data
# DeFi positions
Dsim - Dune SIM API
Requires DUNE_SIM_API_KEY environment variable.
# Wallet simulation
Dune - Dune Analytics API
Requires DUNE_API_KEY environment variable.
# Run queries
# Get results
# Executions
# Tables
Curve - Curve Finance API
# Pool data
# Volume and TVL
# Lending
# Token data
# Router - find optimal swap routes
CCXT - Exchange Data
Query cryptocurrency exchanges via CCXT.
# Ticker data
# Order book
# OHLCV candles
# Exchange info
# Multiple exchanges
Supported Exchanges: Binance, Bitget, OKX, Hyperliquid, and many more
Chainlink - Price Feeds
RPC-based price feeds (no API key needed for on-chain queries).
# Get current price
# Historical price (requires archive node)
# Query specific oracle
# Get feed address
# List known oracles
# Data Streams (requires CHAINLINK_API_KEY and CHAINLINK_USER_SECRET)
Uniswap - V2/V3/V4 Pool Queries
# On-chain queries (no API key needed)
# Subgraph queries (requires THEGRAPH_API_KEY)
# LP positions
# Well-known addresses
Alias: ethcli uni
Kong - Yearn Finance Data
Query Yearn Finance vault and strategy data via the Kong GraphQL API. No API key required.
# List vaults
# Get vault details
# Strategies
# Prices
# TVL
# Reports (harvests)
Alias: ethcli yearn
Security & Analysis Commands
Bytecode Analysis - Function Selectors & Security Patterns
Analyze contract bytecode without requiring source code or ABI. Uses evmole for function extraction and evm-disassembler for opcode analysis.
# Extract function selectors, arguments, and state mutability
# Disassemble bytecode into opcodes
# Get opcode frequency statistics
# Full security analysis
Security patterns detected:
- SELFDESTRUCT (Critical) - Contract can be destroyed
- DELEGATECALL (High) - Arbitrary code execution risk
- CALLCODE (High) - Deprecated dangerous call
- ORIGIN (Medium) - tx.origin auth, honeypot indicator
- CREATE/CREATE2 (Medium) - Dynamic contract creation
Output includes:
- Function selectors with arguments and mutability
- Risk level (LOW, MEDIUM, HIGH, CRITICAL)
- Dangerous opcode counts
- Hardcoded address detection
- Opcode frequency statistics
GoPlus - Security API
Query GoPlus Security API for token, address, NFT, and approval security analysis.
# Check token security (honeypot detection, taxes, ownership)
# Check if address is malicious
# Check NFT collection security
# Check ERC20/721/1155 approval security
# List supported chains
# JSON output
Notes:
- Free API - no API key required for basic usage
- Set
GOPLUS_APP_KEYandGOPLUS_APP_SECRETfor batch queries and higher rate limits - Alias:
ethcli gp
Solodit - Vulnerability Database
Search smart contract security vulnerability findings from Solodit (by Cyfrin).
Requires SOLODIT_API_KEY environment variable.
# Search for vulnerability findings
# Filter by various criteria
# Get a specific finding
# Check API rate limit
# List tags and firms
Alias: ethcli sld
Blacklist - Token Blacklist Management
Manage a local token blacklist for filtering spam/scam tokens.
# Scan a token for security issues
# Scan entire portfolio for suspicious tokens
# Only show suspicious tokens
# List blacklisted tokens
# Add/remove tokens
# Check if token is blacklisted
# Clear all
Notes:
- Blacklist stored in
~/.config/ethcli/blacklist.toml - Uses GoPlus API + Etherscan verification for security checks
- Known protocols (Yearn, Curve, Aave, etc.) are auto-whitelisted
- Alias:
ethcli bl
Multi-Chain Support
# Use --chain flag for other networks
# Supported chains:
# ethereum, polygon, arbitrum, optimism, base, bsc, avalanche
Configuration
Config file: ~/.config/ethcli/config.toml
# Set Etherscan API key (optional, increases rate limit)
= "YOUR_KEY"
# Add custom endpoints
[[]]
= "https://my-private-node.example.com"
= 10000000
= 1000000
= 100
Or via CLI:
Environment Variables
| Variable | Required For | Description |
|---|---|---|
ETHERSCAN_API_KEY |
Optional | Increases Etherscan rate limit |
TENDERLY_ACCESS_KEY |
ethcli tenderly |
Tenderly API access |
ALCHEMY_API_KEY |
ethcli alchemy, aggregation |
Alchemy API access |
COINGECKO_API_KEY |
Optional | CoinGecko Pro API (higher rate limits) |
DEFILLAMA_API_KEY |
Optional | DefiLlama Pro endpoints |
MORALIS_API_KEY |
ethcli moralis |
Moralis API access |
DUNE_SIM_API_KEY |
ethcli dsim |
Dune SIM wallet simulation |
DUNE_API_KEY |
ethcli dune |
Dune Analytics queries |
THEGRAPH_API_KEY |
Uniswap subgraph | The Graph API access |
CHAINLINK_API_KEY |
chainlink streams |
Chainlink Data Streams (premium) |
CHAINLINK_USER_SECRET |
chainlink streams |
Chainlink Data Streams (premium) |
GOPLUS_APP_KEY |
Optional | GoPlus batch queries (higher rate limits) |
GOPLUS_APP_SECRET |
Optional | GoPlus batch queries (higher rate limits) |
SOLODIT_API_KEY |
ethcli solodit |
Solodit vulnerability database |
ONEINCH_API_KEY / 1INCH_API_KEY |
ethcli 1inch |
1inch DEX Aggregator (required) |
ZEROX_API_KEY / 0X_API_KEY |
ethcli 0x |
0x Protocol (optional, higher limits) |
LIFI_INTEGRATOR |
ethcli lifi |
LI.FI analytics tracking (optional) |
PARASWAP_API_KEY / VELORA_API_KEY |
ethcli velora |
ParaSwap (optional, higher limits) |
ENSO_API_KEY |
ethcli enso |
Enso Finance (required) |
Direct DEX Aggregator Commands
1inch - DEX Aggregator
Direct access to 1inch API. Requires ONEINCH_API_KEY or 1INCH_API_KEY environment variable.
# Get swap quote (price estimation)
# Get swap transaction data
# Get supported tokens
# Get liquidity sources
# Get approval spender address
# Check token allowance
# Get approval transaction
Alias: ethcli oneinch
OpenOcean - DEX Aggregator
Direct access to OpenOcean API. No API key required.
# Get swap quote
# Get swap transaction data
# Get reverse quote (specify output amount)
# Get supported tokens
# Get DEX sources
Alias: ethcli oo
KyberSwap - DEX Aggregator
Direct access to KyberSwap API. No API key required.
# Get optimal swap routes
# Get route with full data
# Build swap transaction from route
Alias: ethcli kyber
0x Protocol - DEX Aggregator
Direct access to 0x API. Optional ZEROX_API_KEY or 0X_API_KEY for higher rate limits.
# Get swap quote with transaction data
# Get price estimate (lighter, no tx data)
# Get liquidity sources
Alias: ethcli zerox
CowSwap - MEV-Protected Trading
Direct access to CoW Protocol API. No API key required.
# Get MEV-protected swap quote
# Get order by UID
# Get orders for an address
# Get trades for an address
# Get trades for an order
# Get current auction
# Get solver competition
# Get native token price
Alias: ethcli cow
LI.FI - Cross-Chain Aggregator
Direct access to LI.FI API for cross-chain swaps and bridges. Optional LIFI_INTEGRATOR for analytics.
# Get swap/bridge quote
# Get multiple routes
# Get best route
# Get transaction status
# List supported chains
# Get chain details
# List tokens for a chain
# List available tools (bridges/exchanges)
# List bridges
# List exchanges
# Get gas prices
# List connections (available routes)
Alias: ethcli li.fi
Velora - ParaSwap DEX Aggregator
Direct access to ParaSwap API. Optional PARASWAP_API_KEY or VELORA_API_KEY for higher rate limits.
# Get swap price/route
# Build swap transaction
# List supported tokens
Alias: ethcli paraswap
Enso Finance - DeFi Aggregator
Direct access to Enso Finance API. Requires ENSO_API_KEY environment variable.
# Get swap/DeFi route
# Get token price in USD
# Get token balances for an address
Pyth Network - Price Feeds
Direct access to Pyth Network Hermes API. No API key required.
# Get latest price for one or more feeds
# Search for price feeds
# List all available price feed IDs
# Get well-known feed IDs
Notes:
- Supports common symbols: BTC, ETH, SOL, USDC, USDT, DAI, AVAX, ARB, OP, LINK, UNI, AAVE, CRV, CVX, etc.
- Use
ethcli pyth searchto find additional feeds by name
License
MIT