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

# cron:create

> Generate a new cron class.

Scaffolds a cron job class and its test file into the target module, then registers the class in the `cronJobs` array of the module. It writes `modules/<module>/src/crons/<Name>Cron.ts` and `modules/<module>/tests/crons/<Name>Cron.spec.ts`, and installs the `@ooneex/cron` dependency if it is missing.

## Usage

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

## Examples

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

```bash theme={null}
ooneex cron:create --name=CleanExpiredTokens
```

```bash theme={null}
ooneex cron:create --name=SendDailyReport --module=reporting --override
```

## Options

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

## AI Skill

This command ships a matching `cron:create` skill. Your AI agent uses it to generate a new scheduled task class and its test file, then set the schedule, timezone, and `handler` for a job that extends the `Cron` base class from `@ooneex/cron`.

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

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