Skip to Content
CLIOverview

CLI

Drive contract.dev from your terminal — watch mainnet accounts, push contracts to a Stagenet, generate funded wallets, override balances and state, and pin state to the live chain.

Commands

Account:

Mainnet Analytics:

Stagenets:

Install

Install the contract.dev npm package globally (or use npx):

npm install -g contract.dev

Sign in

contract.dev login

This opens the browser with a one-time code; approving it saves an API key to ~/.contract.dev/credentials.json. In CI, set CONTRACT_DEV_API_KEY instead.

Target a stagenet

Stagenet commands need a stagenet to talk to:

contract.dev stagenets # list the active workspace's stagenets contract.dev stagenet use my-stagenet

Or override per command with --stagenet <name>, or --rpc-url <url> (which needs no login at all).

Run your first commands

# Watch a mainnet contract contract.dev watch 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 --name "USDC" # Push your Hardhat/Foundry project's compiled contracts to your stagenet contract.dev push-contracts # Generate a funded wallet on your stagenet contract.dev generate-wallet # Mint USDC to a recipient on your stagenet contract.dev erc20-balance add 0xRecipient 0xUSDC 100000000

Every command prints usage with help (e.g. contract.dev balance help).

Last updated on