This CLI tool simplifies the process of developing applications and interacting with zkSync.
- Node.js v18 or higher
- Git
- Docker (for
zksync-cli dev
commands) - Yarn (for
zksync-cli create
commands)
You can run commands without installation: npx zksync-cli
. For example: npx zksync-cli dev start
.
npx zksync-cli dev
- Manage local zkSync development environment. It allows to easily start zkSync stack locally, for example: local Ethereum and zkSync nodes, Block Explorer, Wallet and Bridge.
npx zksync-cli dev start
- start local development environment (will ask to configure if starting for the first time)npx zksync-cli dev clean
- clean data for configured modulesnpx zksync-cli dev config
- select modules to run in local development environment
Run npx zksync-cli dev
to see the full list of commands.
npx zksync-cli create
: Create a project using updated templates.- Frontend: Rapid UI development with templates for Vue, React, Next.js, Nuxt, Vite, etc. Options include viem, ethers, web3modal, rainbowkit. More Info
- Contracts: Quick contract deployment and testing with tools like Hardhat on Solidity or Vyper. Contract templates
- Scripting: Automated interactions and advanced zkSync operations using Node.js, with examples of wallet or contract interactions using viem or ethers. Scripting Templates
npx zksync-cli contract read
: run read-only contract methodsnpx zksync-cli contract write
: send transactions to the contract
See full documentation and advanced examples here.
npx zksync-cli wallet transfer
: send ETH on L2 to another accountnpx zksync-cli wallet balance
: displays ETH balance of the specified address
npx zksync-cli bridge deposit
: deposits funds from Ethereum (L1) to zkSync (L2)npx zksync-cli bridge withdraw
: withdraws funds from zkSync (L2) to Ethereum (L1)npx zksync-cli bridge withdraw-finalize
: finalizes withdrawal of funds from zkSync (L2) to Ethereum (L1)
npx zksync-cli config chains
: Add or edit custom chainsnpx zksync-cli help
: Provides information about all supported commandsnpx zksync-cli <command> --help
: Provides detailed information about how to use a specific command. Replace <command> with the name of the command you want help with (e.g.,create
,dev config
,bridge withdraw-finalize
)npx zksync-cli --version
: Returns the current version
By default zkSync CLI bridge commands support zkSync Sepolia Testnet, zkSync Goerli Testnet and zkSync Mainnet. You can also use other networks by using one the options below:
- Adding custom chain using
npx zksync-cli config chains
command. - Overwriting L1 and L2 RPC URLs. For example:
npx zksync-cli deposit --rpc=http://... --l1-rpc=http://...
If you're using local setup (dockerized testing node) with default L1 and L2 RPC URLs, you can select Local Dockerized node
option in the CLI or provide option --chain local-dockerized
.
- Install all dependencies with
npm i
. - To use CLI in development mode run
npm run dev -- [command] [options]
(e.g.npm run dev -- bridge deposit --chain=zksync-sepolia
).
- Install all dependencies with
npm i
. - This project was build with Typescript. Run
npm run build
to compile the code into/bin
. - You can run your local build with
node ./bin
At the moment, we don't have any tests, but we are working on it. In the meantime, you can test the code manually by running the code in development mode.
This project is licensed under MIT.