# protect workload

Manage the workloads

```bash
protect workload <COMMAND>
```

Commands:

- [`launch`](https://docs.edera.dev/reference/cli/v0.0.1/workload/#launch) Launch a new workload.
- [`exec`](https://docs.edera.dev/reference/cli/v0.0.1/workload/#exec) Execute a command inside the workload.
- [`attach`](https://docs.edera.dev/reference/cli/v0.0.1/workload/#attach) Attach to a workload console.
- [`start`](https://docs.edera.dev/reference/cli/v0.0.1/workload/#start) Start a workload.
- [`stop`](https://docs.edera.dev/reference/cli/v0.0.1/workload/#stop) Stop a workload.
- [`destroy`](https://docs.edera.dev/reference/cli/v0.0.1/workload/#destroy) Destroy a workload.
- [`list`](https://docs.edera.dev/reference/cli/v0.0.1/workload/#list) List workload information.
- [`watch`](https://docs.edera.dev/reference/cli/v0.0.1/workload/#watch) Watch for workload changes.

## launch [Permalink for this section](https://docs.edera.dev/reference/cli/v0.0.1/workload/#launch)

```bash
protect workload launch [OPTIONS] --zone <ZONE> <OCI> [COMMAND]...
```

Arguments:

- `<OCI>` Container image for zone to use.
- `[COMMAND]...` Command to run the workload.

Options:

- `--image-format <IMAGE_FORMAT>`
  Image format \[default: squashfs\] \[possible values: squashfs, erofs\].
- `--pull-overwrite-cache`
  Overwrite image cache on pull.
- `--pull-update`
  Update image on pull.
- `-n, --name <NAME>`
  Name of the workload.
- `-W, --wait`
  Wait for the workload to be started.
- `-t, --tty`
  Allocate tty for the workload.
- `-a, --attach`
  Attach to workload console.
- `-e, --env <ENV>`
  Environment variables set in the workload.
- `-m, --mounts <MOUNTS>`
  Mount host directories into the workload.
- `-w, --working-directory <WORKING_DIRECTORY>`
  Working directory.
- `--user <USER>`
  User name or id.
- `--group <GROUP>`
  Group name or id.
- `-z, --zone <ZONE>`
  Zone to launch on, can be a name or id.

## exec [Permalink for this section](https://docs.edera.dev/reference/cli/v0.0.1/workload/#exec)

```bash
protect workload exec [OPTIONS] <WORKLOAD> [COMMAND]...
```

Arguments:

- `<WORKLOAD>` Workload to exec inside, either the name or the uuid.
- `[COMMAND]...` Command to run inside the zone.

Options:

- `-e, --env <ENV>` Environment variables.
- `-w, --working-directory <WORKING_DIRECTORY>` Working directory.
- `-t, --tty` Allocate tty.
- `--user <USER>` User name or id.
- `--group <GROUP>` Group name or id.

## attach [Permalink for this section](https://docs.edera.dev/reference/cli/v0.0.1/workload/#attach)

```bash
protect workload attach <WORKLOAD>
```

Arguments:

- `<WORKLOAD>` Workload to attach to, either the name or the uuid.

## start [Permalink for this section](https://docs.edera.dev/reference/cli/v0.0.1/workload/#start)

```bash
protect workload start <WORKLOAD>
```

Arguments:

- `<WORKLOAD>` Workload to attach to, either the name or the uuid.

## stop [Permalink for this section](https://docs.edera.dev/reference/cli/v0.0.1/workload/#stop)

```bash
protect workload stop <WORKLOAD>
```

Arguments:

- `<WORKLOAD>` Workload to attach to, either the name or the uuid.

## destroy [Permalink for this section](https://docs.edera.dev/reference/cli/v0.0.1/workload/#destroy)

```bash
protect workload destroy [OPTIONS] <WORKLOAD>
```

Arguments:

- `<WORKLOAD>` Workload to destroy, either the name or the uuid.

Options:

- `-W, --wait` Wait for the destruction of the workload to complete.
- `-a, --all` Destroy all workloads matching the input.
- `-l, --selector <SELECTOR>` A selector for filtering the result set. Currently only supports ‘=’ and the ‘status.state’ field. Supported states include ‘creating’, ‘created’, ‘running’, ‘completed’, ‘destroying’, ‘destroyed’ and ‘failed’, with or without the ‘workload _state_’ prefix. (for example `--selector status.state=failed`or`--selector status.state=WORKLOAD_STATE_FAILED`).

## list [Permalink for this section](https://docs.edera.dev/reference/cli/v0.0.1/workload/#list)

```bash
protect workload list [OPTIONS] [WORKLOAD]
```

Arguments:

- `[WORKLOAD]` Limit to a single workload, either the name or the uuid.

Options:

- `-o, --output <OUTPUT>` Output format \[default: table\] \[possible values: table, json, json-pretty, jsonl, yaml, key-value, simple\].
- `-l, --selector <SELECTOR>` A selector for filtering the result set. Currently only supports ‘=’ and the ‘status.state’ field. Supported states include ‘creating’, ‘created’, ‘running’, ‘completed’, ‘destroying’, ‘destroyed’ and ‘failed’, with or without the ‘workload _state_’ prefix. (for example `--selector status.state=failed` or `--selector status.state=WORKLOAD_STATE_FAILED`).

## watch [Permalink for this section](https://docs.edera.dev/reference/cli/v0.0.1/workload/#watch)

````bash
protect workload watch [OPTIONS]
````

Options:

- `-o, --output <OUTPUT>` Output format [default: simple] [possible values: simple, json, key-value].
