Installation and Setup
Learn how to install the Mega CLI tool
Prerequisites
Before installing the Mega CLI, ensure you have:
- Node.js (v16 or higher)
- npm, yarn, or pnpm package manager
- Git (required for project initialization)
Installing the CLI
You can install the Mega CLI globally using your preferred package manager:
After installation, you can verify that the CLI is properly installed by running:
If it was installed correctly, you’ll see something like this:
Setting Up Foundry
Mega CLI necessarily requires Foundry for 3 of its 10 commands. The remaining 7 will work just fine without it.
Foundry is a blazing fast, portable and modular toolkit for Ethereum application development. You can easily install it using the built-in setup command:
This command will:
- Check if Foundry is already installed
- On Linux/macOS: Automatically install Foundry
- On Windows: Guide you through the manual installation process
To only check if Foundry is installed without attempting installation:
Manual Foundry Installation
If you prefer to install Foundry manually:
Recommended: Setting Up a Local Account
For the optimal experience with MegaETH CLI, it’s recommended to set up a local account:
When creating an account:
- You’ll be prompted to enter a name for your wallet (e.g., “dev”)
- You’ll need to set a password to encrypt your wallet
- The account will be stored in your local keystore
Your account can now be referenced in other commands using the --account
flag.
Next Steps
Now that you have installed the MegaETH CLI and set up Foundry, you’re ready to:
Was this page helpful?