---
name: demo-status
description: Check pipeline progress, job status, and schedule state for a demo.
---

# /demo-status

You are helping an SE understand the state of their demo pipeline. You read
job, dataset, and schedule state and present it clearly — you never submit,
modify, or cancel anything.

## Context

- **Workspace**: the current directory is a czbg-workspace created by `czbg init`
- **Pipeline stages**: generate → variance (base only) → upload
- **Job statuses**: queued, running, completed, failed
- **Schedules**: future months are registered with the scheduler after upload;
  they upload automatically when each month becomes current

## Rules

1. **Never submit, modify, or cancel jobs** — read-only.
2. **Summarize, don't dump** — present status in scannable tables, not raw
   CLI output.
3. **Surface actionable next steps** — tell the SE what to do next for each
   provider/category.

## Arguments

`/demo-status [demo-name-or-job-id]`

- If it looks like a demo name (matches a directory in `configs/`), show
  pipeline-level status for that demo.
- If it looks like a job ID (UUID or timestamp format), show detailed status
  for that specific job.
- If omitted, show a summary of recent jobs across all demos.

The argument string is: $ARGUMENTS

## Workflow

### Mode 1: Demo Pipeline Status (`/demo-status acme-corp`)

This is the most useful mode — shows where the entire demo stands.

**Step 1: Scan the demo's config tree**

```bash
find configs/{demo-name} -path "*/generate/*.yaml" -type f
```

Build a list of `{provider}/{category}` pairs the demo expects.

**Step 2: Discover datasets for this demo**

```bash
czbg dataset list
```

Match datasets to this demo by description (descriptions follow the format
`{demo-name}: {category} {provider} ({se-name})`). For each match:

```bash
czbg dataset describe <dataset_id>
```

This gives stages completed, months, providers, and cost totals.

**Step 3: Check job status for matched datasets**

```bash
czbg jobs list --limit 20
```

Filter to jobs whose description matches this demo name. Note which are
running, queued, completed, or failed.

**Step 4: Check schedules**

```bash
czbg schedules list
```

Filter to schedules that reference this demo's datasets. Note the next
upload month and status (active/paused) for each.

**Step 5: Present pipeline summary**

Build a per-provider, per-category pipeline view:

```
Pipeline Status: acme-corp

  Provider  Category   Generate      Variance      Upload        Scheduled
  AWS       base       ✓ completed   ✓ completed   ✓ completed   6 future months (next: 2026-07)
  GCP       base       ✓ completed   ✓ completed   running...    —
  AWS       optimize   ✓ completed   — (skipped)   queued        —
  AWS       anomalies  ✓ completed   — (skipped)   not started   —

Datasets:
  2026-04-10_21-26-40-895  AWS, GCP   base       stages: generate → variance
  2026-04-11_09-15-33-112  AWS        optimize   stages: generate

Active Jobs:
  b8e2d1f6  upload  GCP base  running (12 min)

Next Steps:
  - GCP base upload is running — wait for completion
  - AWS optimize is queued — will start when workers are available
  - AWS anomalies needs upload — use /demo-upload acme-corp
```

Adapt the table to what's actually there. Omit columns or sections that
have no data (e.g., don't show Scheduled column if no schedules exist).

### Mode 2: Single Job Status (`/demo-status a3f7b2c4`)

Get detailed status:

```bash
czbg jobs describe <job_id>
```

Present the key fields: status, stage, duration, dataset name, description,
any errors.

**If the job completed**, give stage-aware next steps:
- Generate job (base config) → "Run variance: `czbg variance run <dataset_id>`, then use `/demo-upload`."
- Generate job (non-base) → "Ready to upload. Use `/demo-upload`."
- Variance job → "Ready to upload. Use `/demo-upload`."
- Upload job → "Upload complete. Verify in CloudZero."

**If the job failed:**
- Show the error message
- Suggest `czbg jobs logs <job_id>` for full logs
- Common fixes:
  - Auth error → `aws sso login --profile cz-test-env-1.AdministratorAccess`
  - Config error → review config with `/demo-plan`
  - Timeout → job may need `--local` for large datasets

**If the job is running:**
- Show elapsed time
- Suggest `czbg jobs logs <job_id> --follow` for live output

### Mode 3: Recent Jobs Summary (`/demo-status`)

List recent jobs across all demos:

```bash
czbg jobs list --limit 10
```

Present a summary table with: job ID (short), stage, status, description,
and how long ago it was created.

Highlight any running or failed jobs. If there are failed jobs, show the
error and suggest remediation.

Group by demo name (extracted from description) if multiple demos have
recent activity.
