Documentation Index
Fetch the complete documentation index at: https://mega-cli.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
mega init
The init command creates a new project with boilerplate code configured for MegaETH.
Usage
mega init [project-name] [options]
Arguments
| Argument | Description |
|---|
project-name | Name of the project directory to create (optional, will prompt if not provided) |
Options
| Option | Description |
|---|
--frontend | Create a frontend-only project (NextJS + WalletConnect) |
--foundry | Create a Foundry-only project configured for Mega testnet |
Description
This command scaffolds a new project with predefined templates and configurations for working with MegaETH. By default, it creates a full-stack project that includes both Foundry for smart contract development and NextJS for frontend development.
The command:
- Creates a new directory with the specified project name
- Clones the appropriate template repository
- Initializes a new git repository
- Installs dependencies
Templates and Contributing
The init command uses the following template repositories. If you have suggestions for improving any of these templates, you can submit pull requests to the respective GitHub repositories:
Your contributions help improve the experience for all MegaETH developers!
Examples
Create a full-stack project
mega init my-mega-project
Create a frontend-only project
mega init my-frontend --frontend
Create a Foundry-only project
mega init my-contracts --foundry
- dev - Start the development environment after creating a project
- compile - Compile contracts in your new project