# workspace-init

Initialize Megamono repository configuration and documentation


## When to use it

Add Megamono conventions to an existing Nx workspace. Start with a survey to see your projects, then choose the modules you want. The pilot is a small starting point that keeps your existing CI and release workflows.

## Usage

```sh
npm exec -- nx generate @megamono/plugin:workspace-init --dry-run
```

Replace angle-bracket placeholders with reviewed values. Nx's `--dry-run` previews generator writes; remove it only after reviewing the plan. Examples use npm; use your workspace's package manager if it differs.

## Options

Use these options with `@megamono/plugin:workspace-init`. Nx uses the camelCase names shown here; the [CLI reference](/docs/cli) describes command-line aliases. Some options are required only for particular choices.

| Option | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| `localPackages` | No | string | "registry" | Resolve inferred Megamono plugins and their required internal closure from the registry or the local Yalc store. Allowed: "registry", "yalc". |
| `survey` | No | boolean | false | Print the deterministic workspace survey and exit without mutation. |
| `dryRun` | No | boolean | false | Print the selected module plan and exit without mutation. |
| `format` | No | string | "markdown" | Output format used by survey and plan reports. Allowed: "markdown", "json". |
| `only` | No | string | — | Comma-separated modules to adopt: docs, agents, ci, release, lint, skills, health, inference. |
| `profile` | No | string | — | Named adoption profile; mutually exclusive with --only. Allowed: "minimal", "pilot", "platform", "full". |
| `interactive` | No | boolean | true | Allow guided module, ambiguity, and confirmation prompts when attached to a terminal. |
| `yes` | No | boolean | false | Apply an explicit, fully resolved non-interactive plan. |
| `report` | No | string | — | Workspace-relative path for the optional completion report. |
| `platforms` | No | string | — | Comma-separated platform vocabulary determined by a calling scaffolder. |
| `ports` | No | string | — | JSON object of application names to assigned development ports. |
| `serviceRunner` | No | string | — | Optional local service runner selected by the workspace scaffolder. Allowed: "none", "springbar". |
| `serviceRequirements` | No | string | — | JSON object of service names to tested version requirements. |
| `packageRegistries` | No | string | — | JSON object mapping package scopes such as @megamono and @playstack to HTTPS registry URLs; authentication remains repository/CI-owned. |
| `renderServiceProjects` | No | string | — | Reviewed JSON object mapping root-level Render service names to existing Nx project names and roots. |
| `packageManager` | No | string | — | Package manager selected by a calling scaffolder; existing workspaces infer it from their lockfile. Allowed: "npm", "pnpm", "yarn", "bun". |
| `ciMode` | No | string | "auto" | Retain equivalent repository CI automatically, or generate a standalone or reusable Megamono workflow. Allowed: "auto", "standalone", "reusable". |
| `docsRoot` | No | string | "docs" | Repository documentation root. |
| `docsLoader` | No | string | — | Workspace-relative Content Collections configuration used for repository docs. |
| `docsModule` | No | string | — | TypeScript import alias for generated repository-doc modules. |
| `docsOutput` | No | string | — | Workspace-relative generated Content Collections output directory. |
| `docsLoaderMode` | No | string | — | Create a Megamono-owned loader or adopt an explicitly selected compatible repository loader. Allowed: "create", "adopt". |
| `docsAdoptionMap` | No | string | — | Workspace-relative reviewed JSON map of existing Markdown paths to complete Megamono lifecycle metadata; paths remain unchanged. |
| `defaultScope` | No | string | "shared" | Scope tag value assigned to projects that have no scope tag. |
| `defaultPlatform` | No | string | — | Platform assigned to untagged existing applications. Allowed: "web", "node", "worker", "mobile", "apple", "android", "rust", "php", "extension". |
| `adoptionMap` | No | string | — | Workspace-relative JSON file resolving per-project type and platform ambiguity. |
| `toolchainPin` | No | string | "none" | Optionally seed repository-owned Node runtime pin files. Allowed: "none", "nvmrc", "node-version", "both". |
| `toolchainNode` | No | string | — | Exact supported Node version written by --toolchainPin. |

## Next steps

Review changed files and run the affected project's checks. For options that accept structured values, run the generator's `--help` or consult the schema in the installed package.

- [All generators](/docs/generators)
- [CLI overview](/docs/cli)
- [Adopt an existing workspace](/docs/workflows/adoption)
