mega dev
Thedev command starts development environments for your Mega blockchain project.
Usage
Options
Description
This command detects and starts the appropriate development environments for your Mega project. By default, if both environments are detected, it starts both the Foundry/Anvil local blockchain and the Next.js frontend development server. The command automatically:- Detects Foundry and Next.js projects in the current directory or subdirectories
- Starts Anvil with appropriate configurations for local blockchain development
- Determines and uses the right package manager (npm, yarn, or pnpm) for the frontend
- Provides convenient output with contract addresses and private keys
Examples
Start both environments
Start only the Foundry/Anvil local blockchain
Start only the Next.js frontend
Notes
- Press Ctrl+C to stop the development servers
- For cleaner logs, consider running the environments in separate terminals
- The Anvil blockchain runs on port 8545 by default
- The Next.js server typically runs on port 3000

