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

# CLI: Project To-dos and Quizzes

> Preview-first opentrain todos commands for creating, assigning, reviewing, and archiving required job actions, and for the full quiz workflow.

`opentrain todos` manages the same Project To-dos list employers and AI trainers see in the product. Every fan-out command previews by default and writes only with explicit confirmation.

The `todos` command tree requires CLI **0.5.4 or later**:

```bash theme={null}
npm install -g @opentrain-ai/cli@latest
opentrain --version
```

The configured account must have the Project To-dos agent surface enabled. A
full-access key supplies `project_todos:read` and `project_todos:write`, but it
does not bypass that account gate; `AGENT_SURFACE_DISABLED` means the account
needs enablement, not another token rotation.

## Read and report

```bash theme={null}
opentrain todos list --job-id <job-id> --json
opentrain todos list --job-id <job-id> --needs-review --json
opentrain todos list --job-id <job-id> --assigned-to <contract-id> --include-archived --json
opentrain todos export-csv --job-id <job-id>
opentrain todos schema            # action schemas for the manage union
opentrain todos help
```

List output includes the flat item catalog, per-person progress, and a pre-pagination summary. Personal emails never appear; people are shown as contract IDs with masked names.

## Create and assign (preview first)

Running without `--confirm-live` is a no-write preview: it prints the exact masked recipients and count, future-hire semantics, projected due/blocking behavior, duplicate candidates, warnings — and, for broad audiences, the preflight receipt token with its expiry.

```bash theme={null}
# Personalized, exact recipients — no receipt needed:
opentrain todos create-item --job-id <job-id> --audience SELECTED \
  --contract-id <contract-id> --version-file ./todo.json          # preview
opentrain todos create-item --job-id <job-id> --audience SELECTED \
  --contract-id <contract-id> --version-file ./todo.json \
  --confirm-live --idempotency-key onboarding-sop-v1              # live

# Broad audience — two explicit steps:
opentrain todos create-item --job-id <job-id> --audience ACTIVE_AND_FUTURE \
  --version-file ./todo.json --json                               # preview prints receipt
opentrain todos create-item --job-id <job-id> --audience ACTIVE_AND_FUTURE \
  --version-file ./todo.json --confirm-live --yes \
  --preflight-receipt <token-from-the-preview> \
  --idempotency-key guidelines-refresh-v2                         # live
```

* `--audience` is always required; there is no default.
* `SELECTED` takes repeatable `--contract-id` flags or `--contract-ids a,b`; duplicate or non-`SELECTED` stray IDs are rejected before any network call.
* Broad live runs require `--yes` **and** `--preflight-receipt` from the preview you reviewed, so a roster or payload change since that preview fails server-side instead of assigning people you never saw.
* `--allow-duplicate` overrides the exact-duplicate refusal.
* `todos assign-item` and `todos archive-item` follow the same preview-then-confirm shape; the archive preview prints exactly how many open assignments will close.

## Review and transitions

```bash theme={null}
opentrain todos review --assignment-id <id> --decision APPROVE --idempotency-key r1
opentrain todos review --assignment-id <id> --decision RETURN --reason "Fix step 2" \
  --expected-submitted-at 2026-08-27T04:10:00.000Z --idempotency-key r2
opentrain todos transition --assignment-id <id> --transition COMPLETE --idempotency-key t1
```

These single-assignment commands execute directly — no `--confirm-live` step. Pass a stable `--idempotency-key` so retries converge (one is generated when omitted). `--expected-submitted-at` is the stale-review guard: a resubmission in the meantime rejects the decision.

## Enable, disable, and the raw escape hatch

```bash theme={null}
opentrain todos enable --job-id <job-id>
opentrain todos disable --job-id <job-id>
opentrain todos manage --body-file ./action.json   # advanced/raw
```

`todos manage` cannot bypass safety: `create_item`, `assign`, and `archive_item` bodies are redirected to the focused commands, and fan-out actions without an explicit `audience` fail before any request is sent.

## Quizzes

```bash theme={null}
opentrain todos quiz list --job-id <job-id> --json
opentrain todos quiz create --job-id <job-id> --title "Safety check" --kind QUIZ --confirm-live
opentrain todos quiz update --form-id <id> --definition-file ./quiz.json --expected-revision 3 --confirm-live
opentrain todos quiz publish --form-id <id> --expected-draft-revision 4 --confirm-live

# Assigning previews by default, like create-item:
opentrain todos quiz assign --job-id <job-id> --form-version-id <id> \
  --audience SELECTED --contract-id <contract-id>                 # preview
opentrain todos quiz assign --job-id <job-id> --form-version-id <id> \
  --audience SELECTED --contract-id <contract-id> \
  --confirm-live --idempotency-key safety-quiz-v1                 # live

opentrain todos quiz attempts --job-id <job-id> --form-id <id> --json
opentrain todos quiz attempt --attempt-id <id> --json
opentrain todos quiz roster --job-id <job-id> --form-id <id> --json
opentrain todos quiz export-results --job-id <job-id> --form-id <id>
opentrain todos quiz grade --attempt-id <id> --grades-json '[{"questionId":"q1","awardedPoints":5}]' --confirm-live
opentrain todos quiz release --attempt-id <id> --confirm-live
opentrain todos quiz bulk-release --job-id <job-id> --form-id <id> --confirm-live
opentrain todos quiz require-retake --assignment-id <id> --reason "Redo part II" \
  --expected-submitted-at <iso> --confirm-live --idempotency-key retake-1
opentrain todos quiz remediate plan --job-id <job-id> --rows-file ./rows.json   # no writes
```

Quiz assignment requires an explicit stable `--idempotency-key` so a retry cannot create duplicate worker-visible obligations; broad quiz audiences require `--yes` plus `--preflight-receipt` from the reviewed preview. `remediate plan` validates a retake batch and emits the exact per-row commands to run individually.

See the [API reference](/docs/developers/api-reference/project-todos/overview) for every field, and the [concept page](/docs/developers/concepts/project-todos) for the safety model.
