> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talosjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# admin:create

> Generate a new admin module.

Scaffold an admin frontend module from the upstream skeleton. The command writes `modules/<name>/`, renames `modules/<name>/admin.yml` to `modules/<name>/<name>.yml`, rewrites `modules/<name>/package.json`, rewrites imports under `modules/<name>/src/`, updates `modules/<name>/vite.config.ts`, creates `modules/<name>/src/shared/.gitkeep`, and adds a root `tsconfig.json` path alias when that file exists.

## Usage

```bash theme={null}
talos admin:create [options]
```

## Examples

Run with no flags to be prompted for the admin name, design module, and target module when choices exist:

```bash theme={null}
talos admin:create
```

Create an admin non-interactively:

```bash theme={null}
talos admin:create --name=backoffice --design=ui --target=api
```

Create an admin without a target module:

```bash theme={null}
talos admin:create --name=backoffice --design=ui
```

## Options

| Option       | Description                                                                                                               | Default                                        |
| ------------ | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| `--name`     | Admin name. Normalized to kebab-case with any trailing `Module` stripped.                                                 | Prompted if omitted                            |
| `--design`   | Design module the admin uses. Existing design modules can be selected interactively, or a new design name can be entered. | Prompted if omitted                            |
| `--target`   | Target API or microservice module. Interactive mode offers existing `api` and `microservice` modules plus no target.      | Prompted if targets exist; otherwise no target |
| `--cwd`      | Project directory the admin is created in.                                                                                | Current directory                              |
| `--silent`   | Suppress prompts, spinners, and output.                                                                                   | `false`                                        |
| `--no-cache` | Bypass the skeleton cache and re-download templates.                                                                      | `false`                                        |

## Generated module

The copied module is marked `type: "admin"` in `modules/<name>/<name>.yml`. When a design is chosen, the yml receives `design: "<design>"`; when a target is chosen, it receives `target: "<target>"`.

## Rewrites

The package is renamed to `@module/<name>`, its Vite scripts are written with a free port starting at `3030`, imports from `@module/admin` are rewritten to `@module/<name>`, and the Vite config is updated with the selected design alias.
