Tevm CLI
The Tevm CLI exposes rc.151 node actions, contract tools, state controls, and Solidity compilation as shell commands. Reach for it when a one-off command or script is more direct than creating a JavaScript client.
Install and create a local session
npm install --global @tevm/cli@1.0.0-rc.151
tevm --version
tevm session docs --local --json1.0.0-rc.151
{
"ok": true,
"command": "session",
"result": {
"version": 1,
"name": "docs"
},
"session": "docs"
}A named session reloads and persists local state between commands. Use --run to skip the interactive editor and --json for the stable { ok, command, result, session } envelope.
Global options
| Flag | Environment | Effect |
|---|---|---|
--json, --no-json | TEVM_JSON | Select stable JSON or human output. |
--session <name> | TEVM_SESSION | Load and persist a named local or forked state file. |
--run, -r | TEVM_RUN | Execute directly instead of opening the parameter editor. |
--rpc <url> | TEVM_RPC | Fork or query the selected JSON-RPC endpoint. |
Command reference
| Command | Purpose |
|---|---|
tevm session | Create or inspect a persistent named local/forked session. |
tevm sol | Compile one Solidity file, deploy it, and call a function. |
tevm call | Execute a raw EVM call against a contract or address. |
tevm compile | Compile Solidity sources to ABI and bytecode artifacts. |
tevm contract | Call a contract function through its ABI, with a decoded trace. |
tevm action create-access-list | Compute the EIP-2930 access list for a call. |
tevm create-block-filter | Create a filter that tracks new blocks. |
tevm create-contract-event-filter | Create an event filter scoped to one contract ABI event. |
tevm create-event-filter | Create a raw topic-based event filter. |
tevm deploy | Deploy bytecode into the session and persist the deployed contract. |
tevm dump-state | Export the full EVM state as JSON. |
tevm estimate-fees-per-gas | Estimate current base and priority fees per gas. |
tevm estimate-gas | Estimate the gas a call would consume. |
tevm get-account | Read an account’s balance, nonce, code, and storage root. |
tevm action get-balance | Read an account balance. |
tevm get-block | Fetch a block by number, hash, or tag. |
tevm get-block-number | Read the current block height. |
tevm get-bytecode | Read the deployed bytecode at an address. |
tevm get-chain-id | Read the chain id. |
tevm get-ens-address | Resolve an ENS name to an address. |
tevm get-ens-name | Reverse-resolve an address to an ENS name. |
tevm get-ens-text | Read an ENS text record. |
tevm get-gas-price | Read the current gas price. |
tevm get-storage-at | Read a raw storage slot. |
tevm get-transaction | Fetch a transaction by hash. |
tevm load-state | Import a previously dumped EVM state. |
tevm mine | Mine one or more blocks. |
tevm multicall | Batch several contract reads into one call. |
tevm read-contract | Read a view/pure contract function through its ABI. |
tevm action send-raw-transaction | Broadcast a signed raw transaction. |
tevm serve | Start a persistent Tevm JSON-RPC server. |
tevm set-account | Set an account’s balance, nonce, or code. |
tevm set-code | Overwrite the deployed bytecode at an address. |
tevm set-nonce | Overwrite an account nonce. |
tevm set-storage-at | Overwrite a raw storage slot. |
tevm action simulate-calls | Simulate a batch of calls without committing state. |
tevm create, tevm generate, and tevm tsc ship in 1.0.0-rc.151 but are not documented here: their non-interactive examples do not currently produce reproducible output, so no verified page exists yet. Run tevm create --help, tevm generate --help, or tevm tsc --help for their current schemas.
Neighbours
Getting started · Sessions and forks · tevm-run · Tevm Node JSON-RPC · Tevm actions

