zkSync CLI


zkSync CLI

The zkSync CLI simplifies the process of developing applications and interacting with zkSync Era.

The code is available in the following repositoryopen in new window.

Installation

Install the zkSync CLI globally with the following command:

npm i -g zksync-cli@latest

You can also run this via NPX with npx zksync-cli@latest [COMMAND]

Commands

  • zksync-cli create [PROJECT_NAME]: creates a new Hardhat project in a new folder with the given project name. If the project name is not provided, it creates the project in the current folder, although this requires the folder to be empty. The template project can be found hereopen in new window.

  • zksync-cli deposit: deposits funds from L1 (Goerli testnet) to zkSync Era Testnet. It will ask you to provide: the recipient wallet, the amount in ETH (eg 0.1) and the private key of the wallet you're sending the funds from.

  • zksync-cli withdraw: withdraws funds from zkSync Era to L1 (Goerli testnet). It will ask you to provide: the recipient wallet, the amount in ETH (eg 0.1) and the private key of the wallet you're sending the funds from.

Both deposit and withdraw might take a couple of minutes to complete.

More commands will be added shortly but if you have any suggestions, feel free to open an issue on GitHubopen in new window.

Troubleshooting

If you find any issues, you can open an issue on GitHubopen in new window or report it to us in our Discordopen in new window.