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

# jobs

> Create and manage background jobs

# jobs Command

The `jobs` command helps you create and manage background jobs in your `zopio` application.

## Usage

```bash theme={"system"}
zopio jobs [options]
```

## Options

* `-l, --list` - List all registered jobs
* `-c, --create <name>` - Create a new job
* `-t, --trigger <jobId>` - Manually trigger a job
* `-s, --schedule <cron>` - Set job schedule (cron expression)

## Examples

<CodeGroup>
  ```bash create job theme={"system"}
  zopio jobs --create user-notifications
  ```

  ```bash list jobs theme={"system"}
  zopio zopio jobs --list
  ```

  ```bash schedule job theme={"system"}
  zopio jobs --create email-digest --schedule "0 9 * * 1"
  ```
</CodeGroup>

## Job Types

The Zopio CLI supports three types of background jobs:

### Cron Jobs

Scheduled jobs that run on a regular basis using cron expressions.

```bash theme={"system"}
zopio jobs --create <name> --schedule "<cron-expression>"
```

Example: (run every day at midnight)

```bash theme={"system"}
zopio jobs --create daily-cleanup --schedule "0 0 * * *"
```

### Queue Jobs

Jobs that process items from a queue.

```bash theme={"system"}
zopio jobs --create <name> --type queue
```

Example:

```bash theme={"system"}
zopio jobs --create email-processor --type queue
```

### Worker Jobs

Long-running worker processes.

```bash theme={"system"}
zopio jobs --create <name> --type worker
```

Example:

```bash theme={"system"}
zopio jobs --create data-syncer --type worker
```

## Internationalization Support

All jobs created with the `jobs` command have built-in internationalization support. Job names, descriptions, and log messages can be translated into all configured languages.

Example job structure with i18n support:

```
jobs/
├─ user-notifications/
│  ├─ index.ts
│  ├─ handler.ts
│  └─ i18n/
│     ├─ en.json
│     └─ tr.json
└─ config.ts
```

<Alert type="warning">
  Make sure your job handlers properly handle errors and include appropriate logging to make debugging easier.
</Alert>
