# Cases and Queues

A Case is a single piece of work delivered into a Queue for an Assignment to pick up. The CLI lets you inspect Case history, delegate Cases in bulk, manage labels, and view the Assignments bound to a Queue.

For an overview of the Case Queue system, see [Case Queue](https://github.com/duvoai/monorepo/blob/gitbook-prod/knowledge-base/assignment-features/case-queue.md).

## Cases (`duvo cases`)

### Inspect a Case's history

```bash
duvo cases runs <case-id>                                    # list all Jobs that have worked on a Case
```

### Bulk-delegate Cases

Delegate 1–100 Cases to a specific Assignment in one call:

```bash
duvo cases bulk-delegate --queue <queue-id> \
  --agent <agent-id> \
  --ids <case-id> [--ids <case-id> ...]

duvo cases bulk-delegate --queue <queue-id> \
  --agent <agent-id> \
  --ids <case-id> --yes                                       # skip the confirmation prompt
```

### Manage Case labels

Attach or remove labels on a Case for filtering and organization.

```bash
duvo cases labels list <case-id> --queue <queue-id>          # list labels on a Case
duvo cases labels assign <case-id> --queue <queue-id> \
  --label "key=value" [--label "key=value" ...]              # assign one or more labels
duvo cases labels unlink <case-id> --queue <queue-id> \
  --label-id <label-id> [--label-id <label-id> ...]          # remove labels from a Case
```

`--label` accepts either `key=value` (for keyed labels like `priority=urgent`) or just `value` on its own (for tag-style labels like `urgent`).

## Queues (`duvo queues`)

```bash
duvo queues agents <queue-id>                                # list producer and consumer Assignments bound to a Queue
```

## Queue labels (`duvo queue-labels`)

Queue labels are reusable label definitions on a Queue. Once defined, a label can be attached to any Case in that Queue.

```bash
duvo queue-labels list --queue <queue-id>                    # list all labels for a Queue
duvo queue-labels create --queue <queue-id> \
  --value "Urgent" [--key "priority"] \
  [--color "#FF0000"]                                        # create a new Queue label
duvo queue-labels delete <label-id> --queue <queue-id> [-y]  # delete a Queue label
```

## Scripting examples

### Bulk-relabel Cases produced today

```bash
TODAY=$(date -u +%Y-%m-%d)

duvo cases runs <case-id> --json \
  | jq -r --arg today "$TODAY" \
      '.runs[] | select(.created_at | startswith($today)) | .case_id' \
  | while read CASE_ID; do
      duvo cases labels assign "$CASE_ID" \
        --queue <queue-id> \
        --label "review=$TODAY"
    done
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.duvo.ai/cli/cases-and-queues.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
