> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: generate

## Article: generate

## Article Link: https://dev.wix.com/docs/wix-cli/cli-for-headless/command-reference/project-commands/generate.md

## Article Content:

# wix generate

Adds an extension to your project. By default, the command prompts you to select an extension type and enter its configuration details. It then generates the extension's files, including its own `.extension.ts` file, and registers the extension in `src/extensions.ts`.

## Usage

```bash
wix generate [flags]
```

## Flags

The following flags are available for the `wix generate` command:

| Flag           | Description                             |
| -------------- | --------------------------------------- |
| `--type <type>` | Generates an extension with the specified type. Can't be combined with `--params`. Accepted values for `<type>`: <br><br> <ul><li>`DASHBOARD_PAGE`</li><li>`DASHBOARD_MODAL`</li><li>`DASHBOARD_PLUGIN`</li><li>`DASHBOARD_MENU_PLUGIN`</li><li>`EVENT`</li><li>`SERVICE_PLUGIN`</li><li>`DATA_COLLECTION`</li><li>`APP_TOOLS`</li><li>`APP_SKILLS`</li></ul> |
| `--params <json>` | Generates an extension non-interactively from a JSON object describing it, instead of the prompts. Can't be combined with `--type`. For the object's keys, see [Extension JSON object](https://dev.wix.com/docs/wix-cli/cli-for-headless/command-reference/project-commands/generate.md#extension-json-object). |

### Extension JSON object

The `<json>` argument of `--params` is a JSON object that describes one extension. It has these keys:

- `extensionType`: The extension type. It takes the values that `--type` accepts.
- The keys of that extension type, which differ between types. For example, a dashboard page requires `title` and `route`.

[`wix schema generate --type <type>`](https://dev.wix.com/docs/wix-cli/cli-for-headless/command-reference/project-commands/schema.md) prints the keys of one extension type and which of them are required.

The command takes this form, with one `"<key>":"<value>"` pair for each of the extension type's keys:

```bash
wix generate --params '{"extensionType":"<type>","<key>":"<value>"}'
```

For example, this command generates a dashboard page titled `Settings` with the route `settings`:

```bash
wix generate --params '{"extensionType":"DASHBOARD_PAGE","title":"Settings","route":"settings"}'
```