# megamono generate

Create and update workspace files with Megamono generators.


## Run a core generator

`megamono generate <name>` creates or updates workspace files using the Megamono plugin installed in your repository. Choose a task from [the generators guide](/docs/generators), then review its options.

```sh
megamono generate docs-plan --project=api --title="Adopt shared mail" --dry-run
```

Review the preview before removing `--dry-run`. Use a project identifier from your Nx graph rather than assuming that an application directory is its project name.

## Use Nx directly

Every published generator also has a fully qualified Nx identifier. This is the direct path for platform generators that do not have a Megamono CLI shorthand.

```sh
npm exec -- nx generate @megamono/plugin:docs-plan --project=api --title="Adopt shared mail" --dry-run
npm exec -- nx generate @megamono/nx-laravel:application --name=portal --dry-run
```

The required plugin and Nx peers must be installed locally. For npm workspaces, use `npm exec -- nx` in place of `npm exec -- nx`.

## Generators versus actions

Generators propose or write repository files. [Actions](/docs/actions) are executor implementations attached to Nx project targets and invoked with `nx run <project>:<target>`. Inference plugins contribute targets from existing platform configuration; inspect the resolved project before executing a target.

If a generator is not recognized, check its name and your installed plugin version with [package diagnostics](/docs/cli/diagnostics). Platform generators need their corresponding plugin installed in the workspace.
