> ## 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.

# event:create

> Generate a new event class.

Scaffolds a PubSub event class and its test file into the target module, then registers the class in the `events` array of the module. It writes `modules/<module>/src/events/<Name>Event.ts` and `modules/<module>/tests/events/<Name>Event.spec.ts`, and installs the `@ooneex/event` dependency if it is missing. The channel defaults to the kebab-case form of the name when `--channel` is omitted.

## Usage

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

## Examples

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

```bash theme={null}
ooneex event:create --name=OrderShipped
```

```bash theme={null}
ooneex event:create --name=UserCreated --module=auth --channel=user-created
```

## Options

| Option       | Description                                                   | Default             |
| ------------ | ------------------------------------------------------------- | ------------------- |
| `--name`     | Resource name (the `Event` suffix is appended automatically). | Prompted if omitted |
| `--module`   | Target module.                                                | `shared`            |
| `--channel`  | PubSub channel name.                                          | kebab-case name     |
| `--override` | Overwrite an existing file without confirmation.              | `false`             |

## AI Skill

This command ships a matching `event:create` skill. Your AI agent uses it to generate a new publish/subscribe event class and its test file, then implement the data type, channel, and `handler` for an event that extends `PubSub` from `@ooneex/event`.

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

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