> ## Documentation Index
> Fetch the complete documentation index at: https://mega-cli.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# init

> Create a new Mega project with boilerplate code

# mega init

The `init` command creates a new project with boilerplate code configured for MegaETH.

## Usage

```bash theme={null}
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:

| Project Type         | Template Repository                                                                                |
| -------------------- | -------------------------------------------------------------------------------------------------- |
| Full-stack (default) | [github.com/awesamarth/mega-starter-full](https://github.com/awesamarth/mega-starter-full)         |
| Frontend-only        | [github.com/awesamarth/mega-starter-frontend](https://github.com/awesamarth/mega-starter-frontend) |
| Foundry-only         | [github.com/awesamarth/mega-starter-foundry](https://github.com/awesamarth/mega-starter-foundry)   |

Your contributions help improve the experience for all MegaETH developers!

## Examples

### Create a full-stack project

```bash theme={null}
mega init my-mega-project
```

### Create a frontend-only project

```bash theme={null}
mega init my-frontend --frontend
```

### Create a Foundry-only project

```bash theme={null}
mega init my-contracts --foundry
```

## Related

* [dev](/commands/dev) - Start the development environment after creating a project
* [compile](/commands/compile) - Compile contracts in your new project
