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

# entity:create

> Generate a new entity class.

Scaffolds a TypeORM entity class and its test file into the target module, then registers the class in the `entities` array of the module. It writes `modules/<module>/src/entities/<Name>Entity.ts` and `modules/<module>/tests/entities/<Name>Entity.spec.ts`. The table name defaults to the snake\_case pluralized form of the name when `--table-name` is omitted.

## Usage

```bash theme={null}
ooneex entity:create [options]
```

## Examples

```bash theme={null}
ooneex entity:create
```

```bash theme={null}
ooneex entity:create --name=Product
```

```bash theme={null}
ooneex entity:create --name=UserProfile --module=auth --table-name=user_profiles
```

## Options

| Option         | Description                                                    | Default                     |
| -------------- | -------------------------------------------------------------- | --------------------------- |
| `--name`       | Resource name (the `Entity` suffix is appended automatically). | Prompted if omitted         |
| `--module`     | Target module.                                                 | `shared`                    |
| `--table-name` | Database table name.                                           | snake\_case pluralized name |
| `--override`   | Overwrite an existing file without confirmation.               | `false`                     |

## AI Skill

This command ships a matching `entity:create` skill. Your AI agent uses it to generate a new TypeORM entity class and its test file, then complete the columns, relations, and table mapping for a database entity.

<Tabs>
  <Tab title="Claude">
    ```bash theme={null}
    ooneex claude:init
    ```
  </Tab>

  <Tab title="Codex">
    ```bash theme={null}
    ooneex codex:init
    ```
  </Tab>
</Tabs>
