> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/es/clis/cli-batch-queues.md).

# CLI: Batch Queues

Liste Batch Queues, espere a que termine el procesamiento y encuentre los archivos que fallaron desde la terminal con la CLI de Unitlab.

```bash
unitlab batch-queue list "$PROJECT_ID"
unitlab batch-queue status "$PROJECT_ID" "$BATCH_QUEUE_ID"
unitlab batch-queue wait "$PROJECT_ID" "$BATCH_QUEUE_ID" --timeout 3600
unitlab batch-queue data "$PROJECT_ID" "$BATCH_QUEUE_ID" --json
unitlab batch-queue detail "$PROJECT_ID" "$BATCH_QUEUE_ID"
```

`wait` imprime el estado final en JSON:

```json
{
  "status": "partial_failure",
  "total": 120,
  "completed": 118,
  "processing": 0,
  "failed": 2,
  "error": null,
  "frame_count": null
}
```

| Resultado                                                          | Código de salida |
| ------------------------------------------------------------------ | ---------------- |
| No queda nada en procesamiento, con o sin archivos fallidos        | 0                |
| Se agotó el tiempo de espera con archivos todavía en procesamiento | 1                |

`wait` termina con 0 incluso si fallaron archivos, así que compruebe `failed` en sus scripts:

```bash
STATUS=$(unitlab batch-queue wait "$PROJECT_ID" "$BATCH_QUEUE_ID")
if [ "$(echo "$STATUS" | jq .failed)" -gt 0 ]; then
  unitlab batch-queue data "$PROJECT_ID" "$BATCH_QUEUE_ID" --json > failed-files.json
  exit 1
fi
```

## Relacionado <a href="#related" id="related"></a>

[Batch Queues y estado del procesamiento](https://docs.unitlab.ai/api-sdk-cli/es/sdks/batch-queues-and-processing.md) · [Automatización con la CLI y códigos de salida](https://docs.unitlab.ai/api-sdk-cli/es/clis/cli-automation-and-exit-behavior.md)
