A simple and powerful Ethereum command-line interface built with web3.py.
- Config: Manage RPC URLs and private keys securely via a local
.envfile. - Account: Check ETH balance for any address or your default account.
- Blockchain: Retrieve detailed information for blocks and transactions.
- Transfers: Send ETH to any Ethereum address.
- Rich UI: Beautiful terminal output using the
richlibrary.
pip install python-web3-cliSet your RPC provider (e.g., Infura, Alchemy, or public nodes):
web3-cli config WEB3_RPC_URL https://eth.llamarpc.comSet your private key to enable sending ETH:
web3-cli config WEB3_PRIVATE_KEY your_private_key_hereCheck Balance
# Check your own balance (requires private key in config)
web3-cli balance
# Check balance of a specific address
web3-cli balance 0x...Get Block Info
web3-cli block latest
web3-cli block 17000000Get Transaction Info
web3-cli tx 0x...Send ETH
web3-cli send 0x... 0.01You can call contract functions using their signature or a full JSON ABI.
Read Data (Call)
# Using function signature (defaults to view/uint256)
web3-cli contract call 0x... "balanceOf(address)" 0x...
# Using full ABI file
web3-cli contract call 0x... name --abi ./erc20.jsonWrite Data (Transact)
web3-cli contract transact 0x... "transfer(address,uint256)" 0x... 1000000To call a proxy contract, provide the proxy address and the ABI of the implementation:
web3-cli contract call [PROXY_ADDR] "someMethod()" --abi ./implementation.jsonSign a transaction (without sending)
web3-cli sign 0x... 0.1This outputs a raw hex string that can be shared or saved.
Send a pre-signed transaction
web3-cli send-raw <RAW_HEX>Get contract bytecode
web3-cli contract code 0x...Read raw storage slot
web3-cli contract storage 0x... 0Get transaction receipt (execution status)
web3-cli receipt 0x...Query event logs
web3-cli logs --address 0x... --from-block 17000000Create a new account
web3-cli account createSign a message (EIP-191)
web3-cli account sign-message "Hello Web3"Verify a signature
web3-cli account verify-message "Hello Web3" <signature> <address>MIT