CLI Reference

The craig command-line interface provides full access to all CRAIG service APIs. It is modeled after the OpenStack CLI: every operation available in the REST API or Web UI is also available from the command line.

The CLI requires a running CRAIG deployment (devstack or production) to connect to. See the project overview for setup instructions.

Building

# Build the CLI binary
cargo build -p craig-cli

# The binary is at target/debug/craig (or target/release/craig with --release)
# Optionally install it to ~/.cargo/bin/
cargo install --path services/craig-cli

An operator needs no checkout: each release publishes the craig-operator image, which carries craig and craig-manage at the services' version (deployment guide § The operator image).

Configuration

The CLI uses profile-based configuration stored in ~/.config/craig/profiles.toml. On first run, a default profile is auto-created with devstack URLs:

[default]
oidc_internal_url = "http://localhost:8180"
keycloak_realm = "craig"
keycloak_client_id = "craig-api"
rules_url = "http://localhost:8001"
cases_url = "http://localhost:8002"
placement_url = "http://localhost:8003"
exchange_url = "http://localhost:8004"
financial_url = "http://localhost:8005"
reporting_url = "http://localhost:8006"
security_url = "http://localhost:8007"
intake_url = "http://localhost:8008"

All URL fields are required; there are no serde defaults. If you add a new field to the profile schema (e.g., when another service is introduced), every profile must include it or the CLI will fail to load.

Multiple Profiles

Add additional profiles for different environments:

[default]
oidc_internal_url = "http://localhost:8180"
keycloak_realm = "craig"
keycloak_client_id = "craig-api"
rules_url = "http://localhost:8001"
cases_url = "http://localhost:8002"
placement_url = "http://localhost:8003"
exchange_url = "http://localhost:8004"
financial_url = "http://localhost:8005"
reporting_url = "http://localhost:8006"
security_url = "http://localhost:8007"
intake_url = "http://localhost:8008"

[staging]
oidc_internal_url = "https://auth.staging.example.com"
keycloak_realm = "craig"
keycloak_client_id = "craig-api"
rules_url = "https://rules.staging.example.com"
cases_url = "https://cases.staging.example.com"
placement_url = "https://placement.staging.example.com"
exchange_url = "https://exchange.staging.example.com"
financial_url = "https://financial.staging.example.com"
reporting_url = "https://reporting.staging.example.com"
security_url = "https://security.staging.example.com"
intake_url = "https://intake.staging.example.com"

Select a profile with --profile or the CRAIG_PROFILE environment variable:

craig --profile staging rules list
# or
export CRAIG_PROFILE=staging
craig rules list

Authentication

All commands except login, token, and completion require authentication. There are three ways to supply it, and the CLI remembers which one a token came from:

How Command When a job outlives the token (a 401 mid-wait)

Password grant (ROPC)

craig login

Signs in again once with CRAIG_PASSWORD or a prompt.

Device-code grant

craig login --device

Prints the address again; approve in the browser, once.

A token minted elsewhere

--bearer-token <t> or CRAIG_BEARER_TOKEN

Cannot be minted again: exits non-zero naming the job and craig job wait ….

craig login --device prints an address to open and waits for approval there; it takes no username or password, and suits an operator on a host with no browser and accounts with no password grant. --bearer-token reads and writes no token cache; prefer the environment variable, since a literal value is visible in ps and shell history.

# Interactive (prompts for username and password, no echo)
craig login

# Non-interactive — pipe the password to stdin (never a literal --password;
# a value on the command line is visible in `ps` and shell history)
printf '%s' "$CRAIG_PASSWORD" | craig login --username admin --password -

# Non-interactive — or read it from the CRAIG_PASSWORD environment variable
CRAIG_PASSWORD=secret craig login --username admin
A literal --password <value> still works but the CLI prints a warning: the value is visible in ps, /proc/<pid>/cmdline, and shell history. Prefer --password - (stdin) or the interactive prompt, which avoid process-visible exposure entirely; CRAIG_PASSWORD is better than argv but is still readable via /proc/<pid>/environ by the same user.

Tokens are cached per profile at ~/.config/craig/tokens/<profile>.json and automatically checked for expiry (with a 30-second buffer) on each command. If a token is expired or missing, the CLI exits with a message to re-run craig login.

Token cache permissions

The cached access token is a live credential (it carries the full role set against every service until expiry), so the CLI keeps the cache owner-only (#770) and never lets it be read half-written (#2761):

  • Unix: tokens/ is created 0700 and made durable (the directory holding each newly created one is synced), and a looser pre-existing directory from an older CLI is tightened in place on the next craig login. Each write stages the token in a fresh sibling, .<profile>.json.<uuid>.tmp, created exclusively at 0600 (no world-readable window, even transiently), syncs it, renames it over the cache and syncs tokens/. A second craig reading the cache meanwhile sees the whole previous token or the whole new one. A looser cache file from an older CLI is replaced by the new 0600 file rather than rewritten in place.

  • Windows / non-POSIX: there are no POSIX mode bits; the config root resolves to the per-user profile area (%APPDATA%-style), which the OS ACL-protects per user. That per-user ACL is the platform posture — no additional CLI-side control is applied. The staged write and the rename run there too, without the directory sync.

A crash between the sync and the rename leaves the previous cache intact and the staged sibling behind. The sibling holds a token under the cache’s own protection (on Unix 0600 in the 0700 directory); no later craig login removes it, so delete a leftover .*.tmp file in tokens/ by hand.

To inspect the cached token:

craig token show

Global Options

Option Description

--profile <name>

Configuration profile to use (default: default). Can also be set via CRAIG_PROFILE env var.

--format <format>

Output format: table (default) or json.

--yes, --force

Assume yes to every destructive-verb confirmation — see Destructive verbs. Env: CRAIG_YES=1 (true/yes/on also read as yes; 0/false/no/off as no; anything else is a parse error, never a silent yes).

--bearer-token <token>

Use this bearer instead of the cached login (see Authentication). Env: CRAIG_BEARER_TOKEN.

--help

Print help for any command or subcommand.

--version

Print the CLI version.

Destructive verbs

Every delete / revoke / void verb asks for confirmation BEFORE it sends the request (#959). The rule is deliberately narrow so scripts and CI never block:

  • A verb prompts only when stdin is an interactive terminal AND none of --yes, --force, or CRAIG_YES=1 is present. The prompt is written to stderr (so --format json output stays parseable) and reads exactly one line: a typed yes proceeds; anything else — including Ctrl-D — aborts with aborted: <action> not confirmed and nothing is sent.

  • A non-interactive caller (a pipe, cron, CI) is never blocked: with no terminal to answer, the verb proceeds as if confirmed. Pass --yes in scripts anyway so the intent is explicit.

  • --yes / --force is a global flag — craig --yes partner delete <id> and craig partner delete <id> --yes are equivalent. CAUTION: CRAIG_YES set process-wide (a CI job’s environment, a shell profile) silently satisfies EVERY gate — including archive run / archive purge — for every craig invocation; set it per command (CRAIG_YES=1 craig …) or pass --yes explicitly.

The prompt reads <action>? Type 'yes' to continue: `, where `<action> is:

Verb Action Gate

adjustment delete <id>

delete adjustment <id>

shared

agreement delete <id>

delete agreement <id>

shared

case delete-contact <id>

delete contact <id>

shared

case delete-court-order <id>

delete court order <id>

shared

changes delete <id>

delete major change <id>

shared

education delete <id>

delete education record <id>

shared

exchange delete-partner <id>

delete exchange partner <id>

shared

financial delete-rate <id>

delete rate <id>

shared

financial void-payment <id> --reason TEXT

void payment <id>

shared

health delete <id>

delete health record <id>

shared

home delete-training <id>

delete training record <id>

shared

kinship delete <id>

delete kinship option <id>

shared

nist delete <control-id>

delete NIST control <control-id>

shared

partner delete <id>

delete partner <id>

shared

partner revoke-key <partner-id> <key-id>

delete API key <key-id>

shared

partner cert revoke <partner-id> <certificate-id>

revoke client certificate <certificate-id>

shared

plan delete-task <task-id>

delete task <task-id>

shared

rules delete <id> --reason TEXT

delete rule set <id>

shared

security delete-review <id>

delete security review <id>

shared

admin-unit delete <id>

delete admin unit <id>

shared

worker-unit revoke <id>

revoke worker admin unit <id>

shared

archive run [--yes] [--client-request-id UUID] [--no-wait]

(its own wording)

strict

archive purge [--limit N] [--yes]

(its own wording)

strict

archive run and archive purge keep their STRICTER gate: they fail CLOSED without a terminal answer, so a script must pass --yes (verb-local or global; CRAIG_YES=1 also counts). Every other verb follows the shared rule above. intake screen-out is a state transition, not a deletion, and does not prompt.

Screening facts (intake record-decision / intake screen-out, #1672)

The screening act derives the actor role from your realm roles through the jurisdiction’s {j}-intake-screening ruleset (there is no --actor-role; an unmapped role — admin included — is a typed 403), requires --rationale (--reason on screen-out), and takes the ruleset’s attestable facts as repeatable --fact KEY=VALUE flags. Before anything is sent the CLI reads GET /v1/cases/screening-surface and validates every flag by the fact’s declared kind: a yes/no fact takes true|false, an enumerated fact one of its option tokens; an unknown key is refused naming the attestable keys, a repeated key is refused. With no --fact the surface is not read and nothing is attested (the ruleset’s terminal row decides).

record-decision also takes --attested-priority <TOKEN> (#1746): the response priority you ATTEST for the intake — PAMMS 3.32’s supervisory review of the recommended response time — checked against the surface’s attestable_response_priorities (the intake-screening output enum minus NONE; an off-vocabulary token is refused naming them, before anything is sent). It rides the decision as attested_response_priority and counts at conversion only where the jurisdiction’s {j}-response-priority roll-up admits your role’s attestation (Georgia: the CICC supervisor, county director or regional review authority; a cicc_intake attestation is recorded but falls to NONE).

craig intake record-decision <report-id> --disposition-kind screened_in \
  --rationale "meets the criteria" \
  --fact maltreatment_alleged=true --fact child_in_state=true \
  --fact child_identified=true --fact alleged_maltreater_is_caregiver=true

# A supervisor assigning the response time where the criteria assigned none
craig intake record-decision <report-id> --disposition-kind screened_in \
  --rationale "CISS review: standard response" --attested-priority STANDARD

# Convert: no priority flag — the roll-up derives the referral's token
craig intake convert-report <report-id>

Output Formats

Table (default)

List commands display columnar tables. Detail commands (get, create) display vertical key-value tables.

$ craig rules list
╭──────────────────────────────────────┬────────────────────────┬─────────────┬────────┬──────────────────────╮
│ id                                   │ name                   │ description │ active │ created_at           │
├──────────────────────────────────────┼────────────────────────┼─────────────┼────────┼──────────────────────┤
│ 01942a3b-1234-7000-8000-000000000001 │ georgia-safety         │ ...         │ true   │ 2025-03-15T14:30:00Z │
╰──────────────────────────────────────┴────────────────────────┴─────────────┴────────┴──────────────────────╯

JSON

Raw API response, pretty-printed. Useful for scripting and piping to jq.

craig --format json rules list
craig --format json case get <id> | jq '.county'

Input Handling

All create and update commands use named --flag arguments, just like the OpenStack CLI. Required fields must be provided; optional fields can be omitted.

craig person create --first-name Jane --last-name Doe --dob 1990-05-15 --sex female
craig case update <id> --status closed --closure-reason "goals met"

Complex JSON fields

Some fields accept structured JSON (e.g., --content, --facts, --findings, --auth-config). These support three input modes:

# Inline JSON
craig rules create --name my-rule --version 1.0.0 --content '{"nodes": [], "edges": []}'

# File input (@ prefix)
craig rules create --name my-rule --version 1.0.0 --content @ruleset.json

# Stdin (-)
cat ruleset.json | craig rules create --name my-rule --version 1.0.0 --content -

Command Reference

login

Authenticate with Keycloak and cache the token.

craig login
printf '%s' "$CRAIG_PASSWORD" | craig login --username admin --password -
CRAIG_PASSWORD=secret craig login --username admin

token

craig token show    # Display cached token info (username, expiry, profile)

rules

Manage rule sets and evaluate rules against the Rules Engine service.

craig rules list [--page N] [--per-page N]
craig rules get <id>
craig rules create --name TEXT --version TEXT --content JSON [--description TEXT]
craig rules update <id> [--name TEXT] [--version TEXT] [--content JSON] [--description TEXT]
craig rules delete <id>
craig rules import <id> --file PATH       # Import JDM content into a rule set
craig rules export <id>                    # Export rule set as JDM JSON
craig rules evaluate <name> --input JSON   # Evaluate input against a named rule set
craig rules bootstrap <file>               # First load of a ruleset file: create it unless it exists
craig rules promote <file> --reason TEXT [--no-wait]                              # Step 1: preview the canary report
craig rules promote <file> --reason TEXT --confirm-preview ID [--acknowledged-thin-corpus]   # Step 2: execute
craig rules drift --rulesets DIR [--strict]   # Classify every ruleset file against the live rule sets

bootstrap, promote and drift are the operator’s path from ruleset files to a deployment (they were cargo xtask verbs until #3125, ADR-088). promote is two invocations on purpose: the first renders the server’s canary report and prints a preview id; a person reads it and runs the second. A thin-corpus promote of an administrative-authority family must quote, in --reason, the authority-evidence:<sha256> digest of the file and the evidence/administrative-authority.toml beside it; the command recomputes it. drift takes the directory holding one directory per config layer (in a CRAIG checkout, target/config/layers) and prints current, behind, ahead, absent or fixture per decision file; --strict exits non-zero when any file needs an act.

Examples:

# List all rule sets
craig rules list

# Create a rule set from a JDM file (here the georgia layer's, through the view `cargo xtask config fetch` builds)
craig rules create --name georgia-safety-assessment --version 1.0.0 --content @target/config/layers/georgia/georgia-safety-assessment.json

# Import a JDM decision graph
craig rules import <id> --file target/config/layers/georgia/georgia-safety-assessment.json

# Evaluate a safety assessment
craig rules evaluate georgia-safety-assessment --input @safety-context.json

# Export a rule set for backup or transfer
craig --format json rules export <id> > backup.json

person

Search and manage person records in the Case Management service.

craig person search [--name TEXT] [--dob YYYY-MM-DD] [--ssn NNNN] [--page N] [--per-page N]
craig person get <id>
craig person create --first-name TEXT --last-name TEXT [--dob DATE] [--sex TEXT] [--ssn NNNN]
craig person update <id> [--first-name TEXT] [--last-name TEXT] [--dob DATE] [--sex TEXT] ...
                         [--middle-name TEXT] [--name-suffix TEXT] [--birth-city TEXT] [--birth-state XX]
                         [--primary-language TOKEN] [--marital-status TOKEN] [--dob-verification TOKEN]
                         [--clear FIELD]...
craig person demographics <person-id> set|correct <row-id>|retract <row-id>|close <row-id>|get [--as-of DATE]
craig person residences <person-id> set --admin-unit NAME|correct <row-id> --admin-unit NAME|retract <row-id>|close <row-id>|get [--as-of DATE]
craig person parentage <person-id> set|correct <row-id>|retract <row-id>|close <row-id>|get [--as-of DATE]
craig person parents <child-id> set --parent UUID|correct <row-id> --parent UUID|retract <row-id>|close <row-id>|get [--as-of DATE]

person update sets the facts a person index asks for at registration (#3192): the middle name, the suffix, the city and state of birth, the primary language, the marital status, and how the date of birth was verified. --clear FIELD (repeatable) clears one of the first six; a verification cannot be cleared, and a changed --dob resets it, so give --dob-verification with a new date.

person create / person update no longer take --icwa-eligible (#1993): ICWA facts are recorded per child per case on the ICWA ledger (data-model-cases.adoc#icwa-ledger) with case child-facts icwa-facts.

person create / person update no longer take --race, --ethnicity or --tribal-affiliation (#1991): the service refuses those keys on the person body with the typed 400 demographics-via-ledger. The facts live on the demographics ledger (data-model-cases.adoc#demographics-ledger), which person demographics drives: set records a complete statement, correct / retract / close act on the named row, get reads the row in force (--as-of, default today). Its flags: --race CATEGORY (repeatable; the eight RaceCategory tokens), --ethnicity (the five Ethnicity tokens), --tribal-member-or-eligible and --tribal-member (yes, no or unknown), --tribal-affiliation TEXT, --effective-from DATE / --effective-until DATE (the window), --note TEXT (retract) and --request-id UUID.

person parentage and person parents (#1994) drive a child’s two parent ledgers (data-model-cases.adoc#parents-ledgers) with the same verbs and shared flags as person demographics. person parentage records the child’s parents_abandoned (required) and sole_legal_parent (omitted = not assessed). person parents records a link from the child to --parent with its role (mother, father, legal_guardian or putative_parent) and legal responsibility (omitted = unanswered); the service refuses a putative parent with legal responsibility (422) and a child named as its own parent (400 bad-request). correct names the row’s parent again with --parent (a row of another parent is the 404 ledger-row-not-found), and get prints every link in force as an array, in the (c) parent order. The fact flags are the ledgers' columns.

Examples:

# Search by name
craig person search --name smith

# Create a person
craig person create --first-name Jane --last-name Doe --dob 1990-05-15 --sex female

# Update a person
craig person update <id> --last-name Smith

# Record a person's demographics (two race categories answered yes)
craig person demographics <id> set --race white --race asian --ethnicity non_hispanic --effective-from 2026-09-01

# Read a child's parent links in force today (an array, mother first)
craig person parents <child-id> get

referral

Read referrals and add allegations. There is no referral create (#1746): a referral is born by converting a screened-in report — intake record-decision then intake convert-report — and its response_priority is the jurisdiction ruleset’s roll-up of that decision, never typed.

craig referral list [--admin-unit TEXT] [--page N] [--per-page N]
craig referral get <id>
craig referral allegation <referral-id> --victim-id ID --abuse-type TEXT [--perpetrator-id ID] [--description TEXT]

--report-source (#648) is the NCANDS Child File #10 RptSrc report source — a captured fact distinct from the reporter’s status: social_services_personnel, medical_personnel, mental_health_personnel, legal_law_enforcement_personnel, education_personnel, child_daycare_provider, substitute_care_provider, alleged_victim, parent, other_relative, friends_neighbors, alleged_perpetrator, anonymous_reporter, other, unknown. (The direct referral create is retired by #895 MR-D; the report → decision → convert path copies the value from the report.)

Examples:

# List referrals for a county
craig referral list --admin-unit Fulton

# Add an allegation
craig referral allegation <referral-id> --victim-id <person-id> --abuse-type neglect --description "Child found unsupervised"

investigation

Manage investigations and submit safety assessments.

craig investigation list [--worker TEXT] [--status TEXT] [--timeliness BAND] [--page N] [--per-page N]
craig investigation get <id>
craig investigation create --referral-id ID --assigned-worker TEXT --assignment-area TEXT
craig investigation update <id> [--status TEXT] [--disposition TEXT] [--first-contact-at TIMESTAMP]
craig investigation safety-assessment <id> --facts JSON [--worker-override SAFE|UNSAFE --worker-override-reason TEXT] [--request-id UUID]
craig investigation override-deadline <id> --due-at TIMESTAMP [--reason TEXT] [--request-id UUID]

--disposition takes one of the seven NCANDS Child File outcome tokens (#648; the same vocabulary the allegation forms use): substantiated, indicated, alternative_response_victim, alternative_response_nonvictim, unsubstantiated, unsubstantiated_false_report, closed_no_finding. The CLI relays the token verbatim; craig-cases answers 422 for anything else (the retired inconclusive included). --status closed needs --disposition unless one is already recorded; otherwise craig-cases answers 400 investigation-disposition-required (#1764).

Examples:

# List open investigations
craig investigation list --status open

# List investigations whose response deadline has passed without a first contact
# (bands: on_track | overdue | met | met_late — #1747)
craig investigation list --timeliness overdue

# Create an investigation — the response deadline is NOT typed: the service
# derives `response_due_at` from the referral's `response_priority` through the
# jurisdiction's `{j}-response-window` ruleset on the jurisdiction clock and
# echoes it with its provenance (`response_due_basis`, `response_rule_set_name`,
# …) and the read-time `response_timeliness` band
craig investigation create --referral-id <id> --assigned-worker jsmith --assignment-area Fulton

# Submit a safety assessment (#3104). --facts is one JSON object: an answer for
# every fact the jurisdiction's safety ruleset declares, true / false for a
# yes/no fact and a whole number for a count. The command reads
# GET /v1/cases/safety-surface for the ruleset identity the answers are given
# against; the same read lists the facts (key, title, guidance, kind).
# Inline:
craig investigation safety-assessment <id> --facts '{"present_danger_identified": false, "child_age": 4}'
# From a file:
craig investigation safety-assessment <id> --facts @facts.json
# From stdin:
jq -c . facts.json | craig investigation safety-assessment <id> --facts -
# An override needs its reason:
craig investigation safety-assessment <id> --facts @facts.json \
  --worker-override SAFE --worker-override-reason "Grandmother moved in; plan signed"
# A fact left out is a 422 naming it; a key the ruleset does not declare is a 400.

# Override the response deadline (#1748) — ruleset-governed and audited. Authz
# admits the OPERATION (supervisor / county_director / regional_director /
# state_office / admin rows in `{j}-authz-investigation`; a caseworker is 403
# before any consult); the jurisdiction's `{j}-response-deadline-override` arm
# is the floor: it decides whether THIS actor may move THIS deadline, whether a
# reason is required, whether only extensions are admitted and by how many
# whole hours (measured from the ORIGINAL derived deadline, rounded up).
# Georgia and Texas ship the arm CLOSED — every request exits non-zero with
# `403 Forbidden — <the arm's basis verbatim>` (`response-deadline-override-refused`);
# opening it is a ruleset promotion. A request outside an open arm's bounds is
# `409 response-deadline-override-bounds`; a missing required reason `422`.
craig investigation override-deadline <id> --due-at 2026-03-10T04:59:59Z --reason "court continuance"

case

Manage cases, household members, contacts, court orders, and the child-fact ledgers.

craig case list [--admin-unit TEXT] [--worker TEXT] [--status TEXT] [--page N] [--per-page N]
craig case get <id>
craig case create --admin-unit TEXT --assigned-worker TEXT [--investigation-id ID] [--supervisor TEXT] [--icwa-flag]
craig case update <id> [--status TEXT] [--stage TEXT] [--assigned-worker TEXT] [--icwa-flag true|false] [--closure-reason TEXT]
craig case household <id>
craig case add-household <id> --person-id ID --role TEXT [--primary-caregiver]
craig case contacts <id> [--page N] [--per-page N]
craig case add-contact <id> --contact-type TYPE --contact-with TEXT --occurred-at TIMESTAMP [--duration-minutes N] [--narrative TEXT] [--visited-child UUID --location childs_residence|other_location]
craig case update-contact <contact-id> [--contact-type TYPE] [--contact-with TEXT] [--occurred-at TIMESTAMP] [--duration-minutes N] [--narrative TEXT] [--visited-child UUID --location TEXT | --clear-visit] [--expect-version N]
craig case court-orders <id> [--page N] [--per-page N]
craig case add-court-order <id> --order-type TYPE --order-date DATE [--court-name TEXT] [--judge TEXT] [--findings JSON] [--hearing-held-on DATE --hearing-child UUID...]
craig case update-court-order <order-id> [--order-type TYPE] [--court-name TEXT] [--judge TEXT] [--order-date DATE] [--next-hearing-date DATE] [--hearing-held-on DATE --hearing-child UUID...] [--expect-version N]
craig case child-facts <segment> <case-id> <child-id> set|correct <row-id>|retract <row-id>|close <row-id>|get [--as-of DATE]
craig case parental-rights-actions <case-id> <child-id> record --parent UUID|correct <row-id> --parent UUID|retract <row-id>|get [--as-of DATE]
craig case permanency-plans <case-id> <child-id> record --plan TEXT --established-on DATE|correct <row-id> --plan TEXT [--established-on DATE]|retract <row-id> --note TEXT|get [--as-of DATE]
craig case review-events <case-id> <child-id> record --kind TEXT --held-on DATE|correct <row-id> --kind TEXT [--held-on DATE]|retract <row-id> --note TEXT|get [--as-of DATE]
craig case ive surface
craig case ive determine <case-id> --child CHILD-UUID[.KEY=VALUE]... [--input KEY=VALUE]... [--request-id UUID]

case ive (#2327) makes an IV-E determination from a terminal. ive surface prints the inputs the active {jurisdiction}-ive-eligibility ruleset declares, as GET /v1/cases/ive-surface serves them: the ruleset’s name and identity, then each input’s key, scope (case or child), kind and title; --format json prints the wire reply. ive determine reads that surface first and checks every answer against it before sending anything: an undeclared key, a key at the wrong scope, a value outside its kind (true/false, a declared enum token, an integer or number inside its bounds, a YYYY-MM-DD date), a key given twice and a malformed flag each fail naming the key. A blank value (--input court_found=) leaves the key out, so it is "not answered" and never false. Every act names at least one child: --child CHILD-UUID names a child with no answer of its own, --child CHILD-UUID.KEY=VALUE also answers one of the child’s inputs, and each named child gets a verdict; with no child the command fails before sending. The act carries the identity of the surface the command read. If the policy was promoted in between, the command prints the IV-E policy moved; re-run to read the new surface and exits non-zero; every other refusal prints its problem detail. Pass --request-id to retry a lost response safely: the same id with the same answers replays the original act.

case child-facts (#1992) drives the five child-fact ledgers (data-model-cases.adoc#child-fact-ledgers) for one child in one case; <segment> is parenting-facts, prior-permanency-facts, assistance-facts, sibling-facts or icwa-facts (#1993, data-model-cases.adoc#icwa-ledger). As with person demographics, set records a complete statement (an omitted fact is unanswered on the new row), correct / retract / close act on the named row, and get reads the row in force (--as-of, default today) — the way to learn a row id. Each segment’s fact flags are its ledger’s columns; the shared flags are --effective-from DATE / --effective-until DATE (the window), --note TEXT (retract) and --request-id UUID. The service refuses a child who was never a child-role household member of the case (400 child-not-in-case), and set / close on a closed case (409 case-closed); correct and retract still work on a closed case.

The icwa-facts flags are the statement’s 24 answers: the answers take the column’s tokens (yes / no, and the per-column extras such as unknown or yes_icwa_applies), the five dates YYYY-MM-DD (on or before today), and --tribes-notified / --determination-tribe free text (1–255 characters). --tribe-notified answers the 2022 question; --tribe-notified-before-first-proceeding and --parent-or-indian-custodian-notified-before-first-proceeding answer the 2028 ones (notice prior to the first child custody proceeding; #2004 removed --parent-or-indian-custodian-notified). A dependent answer needs its gate: the discovery date needs --reason-to-know yes, the notice date --icwa-applies yes, the tribe names and a timely-notice yes --tribe-notified yes, and the determination date, tribe, active efforts and the Tribe’s two orders of preference (--tribe-order-foster-care, --tribe-order-adoptive, yes / no) --court-determination yes_icwa_applies; a gate alone is accepted — except an order’s yes, which needs its date (--tribe-order-foster-care-on / --tribe-order-adoptive-on), given only then.

case parental-rights-actions (#1994) drives the parental-rights EVENT ledger (data-model-cases.adoc#parents-ledgers) for one child in one case. record adds an action for --parent; correct replaces the named action (--parent names the row’s parent again); retract retires it (--note); get lists every live action newest first, or with --as-of the action in force per parent on that date. An event has no window: there is no close and no --effective-from / --effective-until. --effective-on is optional on a voluntary / involuntary action (the service resolves it to the earliest of the petition, termination and death dates) and required on a not_applicable assessment. The fact flags are the ledger’s columns: the kind, the three dates, the deceased indicator, the court order and the six ICWA findings (yes / no; the three involuntary findings only on an involuntary action, the three voluntary ones only on a voluntary action). The service refuses a parent the child is not linked to (400 parent-not-linked), a court order that is not an active termination_of_parental_rights order of the case (400 parental-rights-order-invalid), an ICWA finding without a yes_icwa_applies court determination in force on the action’s termination date (--terminated-on), or on its effective_on when none is given (400 icwa-flags-without-determination), and record on a closed case (409 case-closed); correct and retract still work on a closed case.

case permanency-plans and case review-events (#1995) drive the two permanency EVENT ledgers (data-model-cases.adoc#permanency-ledgers) for one child in one case, on the same record / correct / retract / get acts as case parental-rights-actions. permanency-plans record establishes a plan: --plan takes a PermanencyGoal token and --established-on is required; get lists every live plan newest first by established_on (the first is the CURRENT plan), or with --as-of the plan in force on that date. review-events record records an administrative periodic review or permanency hearing (--kind periodic_review or permanency_hearing, --held-on required); rows a hearing court order wrote show its court_order_id, which no command sets. On both, correct restates --plan / --kind and keeps an omitted date, and the service refuses a child who was never a child-role member of the case (400 child-not-in-case), a date after today (400 ledger-date-after-today), and record on a closed case (409 case-closed).

case add-court-order / update-court-order state a hearing with --hearing-held-on and one --hearing-child per child (clap refuses either half alone). A review_hearing / permanency_hearing order requires it on create, and on update when the type changes into one (400 court-order-hearing-required); any other type refuses it (400 court-order-hearing-not-admitted). Stating it on update rewrites the order’s review events. case add-contact / update-contact record the child a home, office or school visit saw with --visited-child + --location (both or neither); update-contact --clear-visit clears it, and a contact moved to a type that admits no visit must clear it or the service refuses the update (400 bad-request, field visit). --contact-type takes a ContactType token (home_visit, office_visit, phone_call, video_call, school_visit, collateral) and --order-type a CourtOrderType token (removal, shelter_care, adjudication, disposition, review_hearing, permanency_hearing, termination_of_parental_rights); --help lists them and clap refuses any other value before a request is sent. case contacts prints id, contact_type, occurred_at, contact_with and created_at.

Examples:

# List open cases in Fulton county
craig case list --admin-unit Fulton --status open

# Create a case from a substantiated investigation
craig case create --admin-unit Fulton --assigned-worker jsmith --investigation-id <id>

# Add a household member
craig case add-household <case-id> --person-id <id> --role mother --primary-caregiver

# Record a contact
craig case add-contact <case-id> --contact-type home_visit --contact-with "Jane Doe" --occurred-at 2025-03-15T14:00:00Z

# Read a child's sibling count in force today, then record a new count from a date
craig case child-facts sibling-facts <case-id> <child-id> get
craig case child-facts sibling-facts <case-id> <child-id> set --total-siblings 3 --effective-from 2026-09-01

# Record that there is reason to know a child is an Indian child, discovered on the day the window opens
craig case child-facts icwa-facts <case-id> <child-id> set --reason-to-know yes --reason-to-know-discovered-on 2026-09-01 --effective-from 2026-09-01

# Read the IV-E inputs, then determine one child with a case answer and two of the child's own
craig case ive surface
craig case ive determine <case-id> --input group_size=4 --child <child-id>.removal_basis=court_order --child <child-id>.entered_on=2026-09-01

# List a child's parental-rights actions in force per parent at the end of a report period
craig case parental-rights-actions <case-id> <child-id> get --as-of 2026-09-30

# Establish a child's permanency plan, then read the child's plan history
craig case permanency-plans <case-id> <child-id> record --plan reunification --established-on 2026-09-01
craig case permanency-plans <case-id> <child-id> get

# Record a permanency hearing order for two children (one review event each)
craig case add-court-order <case-id> --order-type permanency_hearing --order-date 2026-09-15 --hearing-held-on 2026-09-15 --hearing-child <child-a> --hearing-child <child-b>

# Record a home visit that saw a child at the child's residence
craig case add-contact <case-id> --contact-type home_visit --contact-with "Jane Doe" --occurred-at 2026-09-16T14:00:00Z --visited-child <child-id> --location childs_residence

plan

Manage case plans, approval workflow, and tasks. A case plan carries no permanency goal since #1995; a child’s plan is case permanency-plans.

craig plan list <case-id> [--page N] [--per-page N]
craig plan create <case-id> [--strengths TEXT] [--needs TEXT] [--review-due-at TIMESTAMP]
craig plan update <plan-id> [--status TEXT] [--strengths TEXT] [--needs TEXT]
craig plan approve <plan-id>
craig plan add-task <plan-id> --description TEXT --responsible TEXT [--due-at TIMESTAMP]
craig plan update-task <task-id> [--status TEXT] [--completed-at TIMESTAMP]

Examples:

# Create a case plan
craig plan create <case-id> --strengths "Strong family support"

# Add a task to a plan
craig plan add-task <plan-id> --description "Complete parenting classes" --responsible parent --due-at 2025-06-15T00:00:00Z

# Approve a plan (requires supervisor role)
craig plan approve <plan-id>

home

Manage foster homes and training records in the Placement service.

craig home list [--admin-unit TEXT] [--status TEXT] [--license-type TEXT] [--provider-kind TEXT] [--capacity BOOL] [--page N] [--per-page N]
craig home get <id>
craig home create --name TEXT --address TEXT --admin-unit TEXT --provider-kind family_home|congregate_facility [--license-type TEXT] --max-capacity N [--phone TEXT] [--accepts-sibling-groups] [--icwa-compliant] ...
craig home update <id> [--name TEXT] [--license-status TEXT] [--max-capacity N] [--license-expires DATE|none] [--accepts-sibling-groups true|false] ...
craig home training <id> --training-type TEXT --completed-at DATE --hours N [--expires-at DATE] [--verified-by TEXT]
craig home expiry-sweep [--client-request-id UUID] [--no-wait]

update --license-expires none and update-training <training-id> --expires-at none CLEAR the stored date (#1729): the CLI sends JSON null, the service’s clear arm. A date sets it; omitting the flag keeps it.

create requires --provider-kind (#2055): --license-type is required for family_home and refused for congregate_facility.

list table columns are the foster-home record’s own fields: id, name, admin_unit, license_status, max_capacity, current_occupancy (#1782); --format json prints the full rows, home get <id> the full record.

expiry-sweep runs the license / training expiry notice pass (#1641) as a background job (#1933): it POSTs /v1/placement/expiry-sweep/run ONCE with { client_request_id }, the service answers 202 with the job, and the command then polls the job every 2 s until it succeeds or fails (job). On success it prints the sweep report — the body the route used to answer synchronously; a failed job exits non-zero naming the job’s error token. --client-request-id is the ADR-062 key: the same id replays the SAME job whatever its state; omitted, a fresh id is minted, so a bare rerun is a NEW job and is refused 409 job-already-active while one is still queued or running. --no-wait prints the accepted job and returns; resume with craig job wait placement <id>.

Examples:

# List foster homes with available capacity in Fulton county
craig home list --admin-unit Fulton --capacity true

# Create a foster home
craig home create --name "Smith Family Home" --address "123 Main St" --admin-unit Fulton --provider-kind family_home --license-type regular --max-capacity 4 --accepts-sibling-groups

# Record training completion
craig home training <home-id> --training-type CPR --completed-at 2025-03-10 --hours 4

# Run the expiry sweep and wait for its report
craig home expiry-sweep

# Enqueue only (scripted): print the job, poll it later
craig home expiry-sweep --no-wait --format json

job

The read side of a background job (#1933, plan background-jobs): a long-running engine pass — the expiry sweep (home expiry-sweep), the archive run (archive run, #1934), the rules promote preview (craig rules promote, #1935), the subsidy payment generation (#1937 — enqueued from the API / web; craig job wait financial <id> is its poll), the NCANDS Child File generation (reporting generate-ncands, #1936), the AFCARS generation (reporting generate-afcars, #2144), the conversion-import finalize (craig subsidy import, #1938 — the first CONSENT kind), the partner collection run (exchange collection-run, #3190) and the review-sweep preview / execute (#1939 — enqueued from the API / web; the single-use execute token is issued by POST …/sweep/runs/<run_id>/token, never by a CLI verb; craig job wait financial <id> polls both jobs) — is no longer a 600 s synchronous POST. The enqueuing command POSTs once with a client_request_id, the service answers 202 with a JobView (id, kind, state, attempt, attempts[], progress, result, error, queued_at …) and a Location of /v1/<service>/jobs/<id>, and the job runs in the service’s worker plane. succeeded and failed are the only terminal states; a crash or interrupted attempt of a convergent kind re-queues the SAME job (up to max_attempts), so the id an operator holds stays valid across a rollout.

craig job get  <service> <id>
craig job wait <service> <id>

<service> is one of placement, cases, financial, security, rules, reporting, exchange and resolves to that service’s URL in the active profile; any other name is refused with the list. get reads the job once. wait polls GET /v1/<service>/jobs/<id> every 2 s until a terminal state and prints the terminal JobView; a failed job exits non-zero naming its error token. There is no client-side deadline — Ctrl-C is the operator’s budget, and it leaves the job running: re-run craig job wait to pick it up. A poll never re-POSTs.

Re-authentication mid-poll. The bearer craig login caches is minted once (ROPC, no refresh token) and a long job can outlive it. On a 401 during a poll the CLI re-authenticates ONCE per expiry through the same login path, with the cached username and the password from:

  1. CRAIG_PASSWORD, when set (scripted use — silent);

  2. an interactive no-echo prompt, when stdin is a terminal;

  3. otherwise it stops, exit non-zero, printing the job id and the resume line craig job wait <service> <id> — nothing the process holds can mint a bearer, and it does not guess. craig login then craig job wait resumes the same job.

A second 401 with no successful poll in between is not retried (the same message and resume line). The refreshed token is written to the profile’s cache, so the NEXT command reuses it.

craig rules promote (#1935). The preview waits on GET /v1/rules/jobs/<id> through this same poll, so a 401 is answered as Authentication describes for the way the token was obtained; with --bearer-token it exits non-zero printing the job id and craig job wait rules <id> (finish the wait there, then re-run with --confirm-preview <preview_id> from the job’s result). --no-wait prints the accepted job id and returns. A poll never re-POSTs the preview.

craig subsidy import (#1938). The finalize step POSTs /v1/financial/subsidy-imports/<batch>/finalize ONCE with a minted client_request_id (--finalize-request-id <uuid> pins it for wrapper scripts) and waits on the 202’s job through this same poll, so a 401 is answered as Authentication describes; with --bearer-token it exits non-zero printing the job id and craig job wait financial <id>. succeeded decodes result as the FinalizeReport: finalized is the closeout, staging fails naming the fresh rejections (correct, restage, re-run). failed fails naming error.token + error.detail; for no_progress / crash / lost_proof / interrupted it first GETs the batch detail, prints its counts and the rule — re-run against the same batch: a FRESH id resumes per record exactly once (the SAME id only replays the failure). A poll never re-POSTs the finalize.

craig backpay (#2226). The below-floor backpay operator tool (stage --file <jsonl> [--request-id <uuid> | --batch-id <uuid>] [--out <dir>] [--throttle-rps <n>], show --batch-id <uuid>, finalize --batch-id <uuid> [--finalize-request-id <uuid>] [--expect-checksum <hex>], supersede --record-id <uuid>, abort --batch-id <uuid>; the runbook is in the deployment guide § Below-floor subsidy backpay). It was an xtask verb until #3127. Each act runs under the profile’s login or the global --bearer-token (Authentication) and never prints the bearer; abort posts only with the global --yes. stage checks its file before any request, so a file that fails a check contacts nothing. finalize first reviews: it reads the whole ledger, prints every priced-row field of the live records and the content checksum, and refuses with no POST when the ledger moved between pages. The operator then types the checksum’s first 12 hex characters, or a non-interactive run passes --expect-checksum <hex> (the checksum show printed); the one checksum the tool computed over the rows it printed is the one it posts. It prints finalize client_request_id <uuid> BEFORE the ONE POST (--finalize-request-id pins it), then waits on the 202’s job through this same poll, so a 401 is answered as Authentication describes for the way the token was obtained. With --bearer-token nothing can re-mint the bearer, so a 401 mid-poll stops the wait with exit 4, printing the job id and craig job wait financial <id>. succeeded decodes the BackpayFinalizeReport: finalized prints the counts (exit 0); staging lists each diverged record with its key and blockers and the supersede / stage --file <f> --batch-id <id> remedy (exit 3). failed with no_progress / crash / lost_proof / interrupted reads the batch back, prints its counts and the rule (exit 4): once the old job reads failed, re-run finalize --batch-id <id>, which mints a FRESH id that resumes per record exactly once (the SAME id only replays the failure); refused_at_start, engine_failed and exhausted exit 1 naming their remedy. stage sends no request until the file passes its offline checks, prints create client_request_id <uuid> before the create, and does NOT re-grant on a 401: it stops (exit 3) printing stage --file <f> --batch-id <id>, and that resume skips every key already live in the batch. A poll never re-POSTs the finalize.

cargo xtask rewrite-scheme [--keep-clone] (#1959). Not a craig verb and not a job — the devstack CLONE REHEARSAL of the craig-cases rewrite-scheme process mode (ADR-063 § Amendment — #1399; the production sequence is the deployment guide § Field-scheme rewrite), recorded beside the other three cargo xtask operator verbs this page names. It needs a running devstack, takes the xtask lifecycle lock, and never touches the seeded volume (the devstack keeps wipe + reseed for a scheme change — local-dev § When to use reload vs restart vs refresh). Under the lock it snapshots the seeded crypto_field_lineage + _seed_marker, stops craig-cases (a TEMPLATE copy needs zero client sessions on its source — a psql shell or a running battery refuses the step, BY NAME), creates craig_cases_rehearsal TEMPLATE craig_cases through a raw admin session (CREATE / DROP DATABASE only, application_name craig-xtask-rewrite-rehearsal; a leftover clone of an interrupted run is dropped first), then drives the profile-gated craig-cases-rewrite compose service (compose --profile rewrite run --rm --no-deps, the clone’s OWNER DSN passed with -e) on the cases image the devstack runs — a jurisdiction is configuration, so the rehearsal builds nothing; run cargo xtask dev refresh first after a source change — through both directions: A with CRAIG_CONFIG_SOURCE set to the federal and texas layers (-e) — --dry-run, the run, the migrate gate on the SAME image + env (case 1 must no-op), verify-seed --expect keyed on the clone and count(ssn_hmac) = 0 by raw SQL — then B on the same image under the compose file’s config source (the federal and georgia layers; the same five, the sibling re-derived). A guard armed BEFORE the stop runs on EVERY exit path (a failed step, a panic, Ctrl-C): up -d craig-cases with the reconciled .ports.env, its health at whatever scale the stack runs, then DROP DATABASE … WITH (FORCE) — unless --keep-clone, which keeps the clone for inspection (the next run drops it first). The seeded database is re-read after the restore and asserted byte-identical; the step log (✓ / ✗ per step, with seconds) prints at the end, and the exit is non-zero on any failed step, always AFTER the guard. The tool’s own output streams live and never carries a plaintext or the key. A Ctrl-C mid-run is the manual guard proof: the current step ends, then the guard is watched restoring craig-cases and dropping the clone. A kill -9 mid-run leaves craig-cases stopped (cargo xtask dev start restores it) and the clone in place (the next run drops it). Not a battery leg — it stops a serving container.

cargo xtask config check-bundle <dir>. Not a craig verb: the check a configuration repository runs on its jurisdiction layer before a change merges. <dir> is the layer directory, the one that holds craig-config.toml (the parent of bundle/). The verb reads the directory as a working copy under the jurisdiction its manifest names, parses and validates every bundle/ file with the loader the services boot through (ConfigBundle::check), and prints every error it finds, each with its file and key. It exits 0 with bundle ok: <dir> when there is none and 1 otherwise; a directory with no readable manifest, or one that names no jurisdiction, is refused. It needs no devstack and no network. The bundle/ file map lists the files.

craig-manage caregiver-coverage --jurisdiction <label>. The label printed on the report’s rows; unknown without the flag, since the report cannot ask a database which jurisdiction it runs as and no environment variable supplies it.

Examples:

# Enqueue without waiting, then poll from another shell
craig home expiry-sweep --no-wait
craig job wait placement 0192b3c4-0000-7000-8000-000000000042

# Scripted: let a long poll survive the bearer's expiry
CRAIG_PASSWORD=... craig job wait placement <id> --format json

# Inspect a job's attempt ledger once
craig job get placement <id> --format json

placement

Manage removal episodes, placements, history, and matching.

craig placement episode open --case-id ID --child-id ID --removal-at TIMESTAMP --removal-manner MANNER [REMOVAL-ANSWER FLAGS] [--request-id UUID]
craig placement episode correct <episode-id> --row-id ID --removal-at TIMESTAMP --removal-manner MANNER [REMOVAL-ANSWER FLAGS] [--request-id UUID]
craig placement episode retract <episode-id> --note TEXT [--request-id UUID]
craig placement episode list <child-id>
craig placement episode exit record <episode-id> --exit-at TIMESTAMP --exit-reason REASON [--transfer-agency-type TYPE] [EXIT-ANSWER FLAGS] [--request-id UUID]
craig placement episode exit correct <episode-id> --row-id ID --exit-at TIMESTAMP --exit-reason REASON [--transfer-agency-type TYPE] [EXIT-ANSWER FLAGS] [--request-id UUID]
craig placement episode exit retract <episode-id> --row-id ID --note TEXT [--request-id UUID]
craig placement episode historical --case-id ID --child-id ID --removal-at TIMESTAMP --removal-manner MANNER --exit-at TIMESTAMP --exit-reason REASON [--transfer-agency-type TYPE] [REMOVAL-ANSWER FLAGS] [EXIT-ANSWER FLAGS] [--request-id UUID]
craig placement episode trafficking statement <episode-id> record --stated-on DATE [--prior-victim yes|no] [--prior-reported yes|no] [--prior-reported-on DATE] [--in-care-victim yes|no] [--in-care-reported yes|no] [--request-id UUID]
craig placement episode trafficking statement <episode-id> correct <row-id> --stated-on DATE [--prior-victim yes|no] [--prior-reported yes|no] [--prior-reported-on DATE] [--in-care-victim yes|no] [--in-care-reported yes|no] [--request-id UUID]
craig placement episode trafficking statement <episode-id> retract <row-id> --note TEXT [--request-id UUID]
craig placement episode trafficking statement <episode-id> get [--as-of DATE]
craig placement episode trafficking report <episode-id> record --reported-on DATE [--request-id UUID]
craig placement episode trafficking report <episode-id> correct <row-id> --reported-on DATE [--request-id UUID]
craig placement episode trafficking report <episode-id> retract <row-id> --note TEXT [--request-id UUID]
craig placement episode trafficking report <episode-id> get [--as-of DATE]
craig placement list [--case-id ID] [--child-id ID] [--home-id ID] [--status TEXT] [--page N] [--per-page N]
craig placement get <id>
craig placement create --episode-id ID --placement-type TYPE [--ffh-type CATEGORY]... --started-at TIMESTAMP [--foster-home-id ID] [--status TEXT] [--replaces ID] [--kinship-household ID | --new-kinship-household [--kinship-household-unit UNIT]] [ARRANGEMENT-FACT FLAGS] [--request-id UUID]
craig placement update <id> [--status TEXT] [--started-at TIMESTAMP] [--ended-at TIMESTAMP] [--end-reason TEXT] [--arrangement-facts [ARRANGEMENT-FACT FLAGS]]
craig placement cancel <id> --note TEXT [--request-id UUID]
craig placement retract <id> --note TEXT [--request-id UUID]
craig placement historical --episode-id ID --placement-type TYPE [--ffh-type CATEGORY]... --started-at TIMESTAMP --ended-at TIMESTAMP --end-reason REASON [--foster-home-id ID] [--replaces ID] [--kinship-household ID | --new-kinship-household [--kinship-household-unit UNIT]] [ARRANGEMENT-FACT FLAGS] [--request-id UUID]
craig placement history <child-id>
craig placement match --case-id <id> --child-id <id> --provider-kind <family_home|congregate_facility> [--page N] [--per-page N]

Every placement belongs to a removal episode (#2018): open the episode first, then create the placement with --episode-id; the placement’s case and child are the episode’s. --removal-manner is court_ordered_removal or voluntary_placement_agreement, and --removal-at is an RFC 3339 instant no later than now.

The removal-answer flags (#2081) record the removal’s AFCARS answers on episode open, episode correct and episode historical; each is optional, and an omitted one is sent as unanswered (null):

  • --environment ((d)(3), the child’s environment at the removal): parent_household, relative_household, legal_guardian_household, relative_legal_guardian_household, justice_facility, medical_mental_health_facility, other.

  • --circumstance-<category> ((d)(4), one flag per circumstance, e.g. --circumstance-neglect): applies or does_not_apply.

  • --icwa-transfer-requested i)(1)(i and --icwa-transfer-denied ((i)(1)(ii), only on an --icwa-transfer-requested yes): yes or no.

  • --icwa-denial-parents-objected, --icwa-denial-tribal-court-declined, --icwa-denial-state-court-good-cause ((i)(1)(iii), only on an --icwa-transfer-denied yes): applies or does_not_apply. An ungated (i)(1) answer is refused 400 Bad Request.

  • --icwa-clear-and-convincing-evidence, --icwa-qualified-expert-witness, --icwa-active-efforts i)(4: yes or no.

An unknown token is refused before any request.

  • episode correct restates both removal facts; --row-id is the episode’s live removal response, the removal_row_id column of episode list. A correction restates every answer: an omitted flag clears it.

  • episode retract withdraws an episode entered in error. It is refused (409 Conflict) while a planned, active or ended placement still references the episode.

  • episode list shows the child’s live (unretracted) episodes you may read. Table columns: id, case_id, child_id, removal_at, removal_manner, removal_row_id, exit_at, exit_reason, exit_row_id, recorded_at; the two exit cells are empty on an open episode. --format json prints the body unchanged, with the live removal response nested under removal and the exit response under exit (null exactly when exit_at is).

The exit ends an episode (#2019): the instant the agency’s placement and care responsibility ended, and why. --exit-reason is one of reunify_with_parents_legal_guardians, live_with_other_relatives, adoption, emancipation, guardianship, runaway_or_whereabouts_unknown, death_of_child, transfer_to_another_agency. --transfer-agency-type is given exactly when the reason is transfer_to_another_agency (422 Unprocessable Entity otherwise) and is one of state_title_iv_e_agency, tribal_title_iv_e_agency, indian_tribe_or_tribal_agency_non_iv_e, juvenile_justice_agency, mental_health_agency, other_public_agency, private_agency. An unknown token is refused before any request. --exit-at is an RFC 3339 instant no later than now and after the removal (400 Bad Request otherwise).

The exit-answer flags (#2083) record the adoption / guardianship exit’s AFCARS answers on episode exit record, episode exit correct and episode historical; each is optional, and an omitted one is sent as unanswered (null):

  • --adoptive-marital-status h)(1: married_couple, married_but_individually_adopting_or_obtaining_legal_guardianship, separated, unmarried_couple, single_adult.

  • --relationship-<category> ((h)(2), one flag per relationship: --relationship-relatives, --relationship-kin, --relationship-non-relatives, --relationship-foster-parents): applies or does_not_apply.

  • --first-adoptive-parent-person-id h)(3)–(h)(7 / --second-adoptive-parent-person-id h)(8)–(h)(12: craig-cases person ids; not the child; the second only with the first and never the same person (422 Unprocessable Entity otherwise; 503 Service Unavailable while craig-cases is down).

  • --jurisdiction-kind h)(13: interjurisdictional_adoption_or_guardianship, intercountry_adoption_or_guardianship, intrajurisdictional_adoption_or_guardianship.

  • --siblings-in-home N ((h)(15), 0–999) / --siblings-not-applicable true (never both).

  • The --adoptive-icwa-* flags: --adoptive-icwa-available-extended-family, --adoptive-icwa-available-tribe-members, --adoptive-icwa-available-other-indian-families, --adoptive-icwa-available-tribe-order-of-preference i)(10: yes, no or not_applicable; --adoptive-icwa-preference-met i)(11: a_member_of_the_indian_childs_extended_family, other_members_of_the_indian_childs_tribe, other_indian_families, a_placement_that_complies_with_the_order_of_preference_for_adoptive_placements_established_by_an_indian_childs_tribe, placement_does_not_meet_icwa_placement_preferences; --adoptive-icwa-good-cause ((i)(12), only on an --adoptive-icwa-preference-met placement_does_not_meet_icwa_placement_preferences): yes or no; --adoptive-icwa-good-cause-basis-parents-request, --adoptive-icwa-good-cause-basis-request-of-the-indian-child, --adoptive-icwa-good-cause-basis-no-suitable-placement, --adoptive-icwa-good-cause-basis-extraordinary-needs, --adoptive-icwa-good-cause-basis-sibling-attachment ((i)(13), only on an --adoptive-icwa-good-cause yes): yes or no.

(h) flags only on an adoption or guardianship exit, (i) flags only on an adoption — refused otherwise.

  • episode exit record is refused (409 Conflict) on an episode that already has an exit, and while a planned or active placement is in the episode: end or cancel it first.

  • episode exit correct restates the whole exit statement; --row-id is the episode’s live exit response, the exit_row_id column of episode list. A correction restates every answer: an omitted flag clears it.

  • episode exit retract withdraws an exit entered in error, and the episode is open again. It is refused (409 Conflict) when the child has a later live episode, which the reopened one would overlap.

  • episode historical records an episode that has already ended — the episode, its removal and its exit — in one act, and answers 201 Created (a replay with the same --request-id answers the same).

  • episode retract of an exited episode also retires its live exit response, and every episode retract retires the episode’s every live trafficking statement and report.

  • episode trafficking statement … record records what was known on --stated-on of the child’s trafficking victimization d)(5)–(d)(6)(i; an omitted answer flag records that answer as unanswered. A statement is the complete state known that day: a changed answer is a new record, and correct restates every answer — an omitted flag clears it.

  • The answers are gated one way (400 Bad Request): --prior-reported only with --prior-victim yes, --prior-reported-on only with --prior-reported yes, and --in-care-reported only with --in-care-victim yes. --prior-reported-on may not be after --stated-on (400 Bad Request, ledger-fact-date-after-event), and neither --stated-on nor --reported-on may be after today.

  • episode trafficking report … record records one report of the in-care victimization to law enforcement d)(6)(ii, dated --reported-on; an episode holds as many as were made.

  • get without --as-of lists the history (every live statement or report, newest first); with it, the statement in force on that date, or every report dated on or before it.

  • A retracted episode refuses every trafficking act (409 Conflict).

  • An active create, and an activation (update <id> --status active), must start between the episode’s removal and now (400 Bad Request otherwise). update --started-at is accepted only together with --status active, and restates the start of a planned placement as it activates.

  • cancel ends a planned placement that never became active; an active placement is ended with update, and planned → ended is refused.

  • --placement-type (on create and historical, #2056) is the federal setting: foster_family_home or one of the 14 (e)(4) tokens (group_home_family_operated, group_home_staff_operated, group_home_shelter_care, residential_treatment_center, qualified_residential_treatment_program, child_care_institution, child_care_institution_shelter_care, supervised_independent_living, juvenile_justice_facility, medical_or_rehabilitative_facility, psychiatric_hospital, runaway, whereabouts_unknown, placed_at_home); a retired token such as foster_care or kinship is refused before any request. --ffh-type (repeatable) names a foster-family-home category that applies e)(3: licensed_home, therapeutic_foster_family_home, shelter_care_foster_family_home, relative_foster_family_home, pre_adoptive_home, kin_foster_family_home. On foster_family_home the list is always sent, empty when no flag is given; on any other setting it is sent only when given, and the service refuses it (400 Bad Request, structural-mismatch). A congregate setting names its provider in --foster-home-id, a non-caregiving setting names none, and a named provider of the wrong kind is refused (400 Bad Request, setting-provider-mismatch).

  • retract (#2020) withdraws an active or ended placement entered in error: the row stays, marked retracted. Any other status is refused (400 Bad Request; a planned placement is cancelled instead). A caregiver binding never blocks it (#2058: a binding keys the foster home or the kinship household, not the placement).

  • historical (#2020) records an arrangement that has already ended but was missed at the time (distinct from history, which lists the child’s placements), and answers 201 Created. --placement-type and --end-reason are reference tokens and both instants are RFC 3339, so an unknown token or a date-only instant is refused before any request. The arrangement must lie inside its episode, which may be exited, and end no later than now; a named foster home need only exist (no license or capacity check applies to the past).

  • --replaces (on create and historical) names the retracted placement of the same episode that this one re-records and that no other non-cancelled placement already re-records; anything else is refused (409 Conflict, invalid-replacement).

  • --kinship-household ID, --new-kinship-household and --kinship-household-unit UNIT (on create and historical, #2058) choose the kinship household of a home-less foster_family_home placement: an existing one (sent as {"existing": ID}), or a new one minted in the same act (sent as {"new": {}}, with admin_unit when --kinship-household-unit is given). The first two conflict, and --kinship-household-unit requires --new-kinship-household; the CLI refuses either before any request. With none, the service decides: a re-record reuses the replaced placement’s household, and anything else mints one in the episode’s unit. The unit is only for an episode that has none yet — beside the episode’s unit, or when neither is present, the service refuses (400 Bad Request). The flags are sent whatever the setting, so the service refuses a household on any other placement (400 Bad Request, structural-mismatch); an unknown household is 409 Conflict (invalid-kinship-household).

The arrangement-fact flags (#2080) record the arrangement’s AFCARS facts (data-model-placement.adoc#arrangement-facts) on create, historical and update. On create and historical each is optional, and an omitted one is sent as unanswered (null):

  • --arrangement-location e)(5: in_state_or_in_tribal_service_area, out_of_state_or_out_of_tribal_service_area, out_of_country, runaway_or_whereabouts_unknown.

  • --arrangement-jurisdiction e)(6: the state, tribal service area or country, free text of 1–255 characters once trimmed.

  • --foster-parents-marital-status e)(7: married_couple, unmarried_couple, separated, single_adult.

  • --relationship-to-foster-parents e)(8: relatives, non_relatives, kin.

  • The --icwa-available-* flags i)(5: --icwa-available-a-member-of-the-indian-childs-extended-family, --icwa-available-tribe-licensed-foster-home, --icwa-available-indian-foster-home-non-indian-licensed, --icwa-available-indian-institution, --icwa-available-tribe-order-of-preference: yes, no or not_applicable.

  • --icwa-preference-met i)(6: a_member_of_the_indian_childs_extended_family, a_foster_home_licensed_approved_or_specified_by_the_indian_childs_tribe, an_indian_foster_home_licensed_or_approved_by_an_authorized_non_indian_licensing_authority, an_institution_for_children_approved_by_an_indian_tribe_or_operated_by_an_indian_organization_which_has_a_program_suitable_to_meet_the_indian_childs_needs, a_placement_that_complies_with_the_order_of_preference_for_foster_care_or_pre_adoptive_placements_established_by_an_indian_childs_tribe, placement_does_not_meet_icwa_placement_preferences.

  • --icwa-good-cause i)(7: yes or no.

  • --icwa-good-cause-basis-parents-request, --icwa-good-cause-basis-request-of-the-indian-child, --icwa-good-cause-basis-no-suitable-placement, --icwa-good-cause-basis-extraordinary-needs, --icwa-good-cause-basis-sibling-attachment i)(8: yes or no.

An unknown token is refused before any request. The service refuses a fact that its setting or a sibling fact does not admit (400 Bad Request, structural-mismatch):

  • --arrangement-location runaway_or_whereabouts_unknown exactly on a runaway or whereabouts_unknown setting, and no other token there.

  • --arrangement-jurisdiction only beside an out_of_state_or_out_of_tribal_service_area or out_of_country location.

  • --foster-parents-marital-status and --relationship-to-foster-parents only on foster_family_home.

  • --icwa-good-cause only on an --icwa-preference-met placement_does_not_meet_icwa_placement_preferences.

  • An --icwa-good-cause-basis-* answer only on an --icwa-good-cause yes.

update sends the facts only with --arrangement-facts. The flags are then the COMPLETE state: every fact is sent, and an omitted flag clears that fact. Without the switch the stored facts are unchanged, and a fact flag is refused before any request. The edit applies only to a planned, active or ended placement (400 Bad Request, invalid-state-transition, otherwise).

The --request-id flags are idempotency ids (ADR-062): re-running with the same id and identical arguments replays the original outcome; omitted, a fresh id is minted and a rerun is a new operation.

Examples:

# Open a removal episode, find its id, then place the child in it
craig placement episode open --case-id <case-id> --child-id <child-id> --removal-at 2026-03-01T12:00:00Z --removal-manner court_ordered_removal --environment parent_household --circumstance-neglect applies
craig placement episode list <child-id>
craig placement create --episode-id <episode-id> --placement-type foster_family_home --ffh-type licensed_home --started-at 2026-03-01T12:00:00Z --foster-home-id <home-id> --arrangement-location in_state_or_in_tribal_service_area --foster-parents-marital-status married_couple

# Restate the arrangement's facts in full: every flag not given is cleared
craig placement update <placement-id> --arrangement-facts --arrangement-location out_of_state_or_out_of_tribal_service_area --arrangement-jurisdiction Alabama --foster-parents-marital-status married_couple

# Record the child's exit once the last placement has ended, then find the exit row to correct it
craig placement episode exit record <episode-id> --exit-at 2026-06-30T12:00:00Z --exit-reason reunify_with_parents_legal_guardians
craig placement episode list <child-id>

# State what is known of trafficking, then record the in-care victimization's report to law enforcement
craig placement episode trafficking statement <episode-id> record --stated-on 2026-04-20 --prior-victim no --in-care-victim yes --in-care-reported yes
craig placement episode trafficking report <episode-id> record --reported-on 2026-04-15

# Record an episode that ended before the child's records were in CRAIG
craig placement episode historical --case-id <case-id> --child-id <child-id> --removal-at 2025-01-10T12:00:00Z --removal-manner court_ordered_removal --exit-at 2025-08-01T12:00:00Z --exit-reason adoption --environment relative_household --circumstance-abandonment applies

# Cancel a planned placement that fell through
craig placement cancel <placement-id> --note "the home withdrew"

# Retract a placement entered against the wrong home, then record the arrangement that really happened
craig placement retract <placement-id> --note "entered against the wrong home"
craig placement historical --episode-id <episode-id> --placement-type foster_family_home --ffh-type licensed_home --started-at 2026-03-01T12:00:00Z --ended-at 2026-05-01T12:00:00Z --end-reason disruption --foster-home-id <home-id> --replaces <placement-id>

# Find matching foster homes for a child of a case
craig placement match --case-id <case-id> --child-id <child-id> --provider-kind <family_home|congregate_facility>

# View placement history for a child
craig placement history <child-id>

placement match is identity-based (#972, ADR-073): the child’s criteria — age band, ICWA, sibling group — are derived by the Cases service from the case + person record under YOUR case-read authority (a caseworker must be assigned to the case) and bound by the jurisdiction’s {j}-placement-eligibility ruleset; nothing about the child is passed on the command line. The matching class is: --provider-kind is required (#2055) and restricts the search to family homes or congregate facilities. The child must be an active child-role household member of the case, otherwise the command prints the relayed typed refusal (400 Bad Request — person … is not an active child-role household member of case …). Table columns are the foster-home record’s own fields: id, name, admin_unit, provider_kind, license_type, effective_license_status, max_capacity, current_occupancy, accepts_ages_min, accepts_ages_max, accepts_sibling_groups, icwa_compliant; --format json also shows the excluded_by_policy / truncated counters.

placement list and placement history print the placement record’s own fields (#2034). Table columns: list — id, case_id, child_id, foster_home_id, status, started_at, ended_at; history — id, foster_home_id, status, started_at, ended_at. ended_at is empty until the arrangement ends, and foster_home_id on an arrangement with no home; --format json prints every field.

kinship

Manage kinship evaluations.

craig kinship list --case-id <id>
craig kinship create --case-id ID --child-id ID --relative-name TEXT --relationship TEXT [--evaluated] [--approved true|false]
craig kinship update ID [--evaluated BOOL] [--approved true|false|none] [--rejection-reason TEXT] [--evaluated-at RFC3339]

kinship update --approved none clears the decision: it sends approved: null (#2440). Omitting the flag leaves it unchanged.

Examples:

# List kinship options for a case
craig kinship list --case-id <id>

# Record a kinship evaluation
craig kinship create --case-id <id> --child-id <id> --relative-name "Mary Johnson" --relationship grandmother --evaluated --approved true

exchange

Manage exchange partners and transactions in the Data Exchange service.

craig exchange list-partners [--partner-type TEXT] [--active BOOL] [--page N] [--per-page N]
craig exchange create-partner --partner-name TEXT --partner-type TEXT --direction TEXT [--endpoint-url TEXT] [--auth-type TEXT] [--auth-config JSON] [--exchange-format TOKEN]
craig exchange update-partner <id> [--partner-name TEXT] [--active true|false] [--auth-type TEXT --auth-config JSON] [--exchange-format TOKEN] [--caller-partner-id UUID] ...
craig exchange test-partner <id>
craig exchange send --partner-id ID --exchange-type TOKEN [--payload JSON] [--record-count N]
craig exchange list-transactions [--partner-id ID] [--status TEXT] [--direction TEXT] [--page N] [--per-page N]
craig exchange get-transaction <id>
craig exchange retry-transaction <id>
craig exchange trigger-release --interface TEXT [--held-reason REASON | --record-class CLASS] [--id UUID]...
craig exchange collection-run --interface TEXT --leg TEXT [--client-request-id UUID] [--no-wait]

Examples:

# List active exchange partners
craig exchange list-partners --active true

# Create a partner
craig exchange create-partner --partner-name "GA DFCS" --partner-type cwca --direction bidirectional

# Test connectivity to a partner
craig exchange test-partner <id>

# Send an outbound data exchange
craig exchange send --partner-id <id> --exchange-type case_data --payload @payload.json

# List failed transactions
craig exchange list-transactions --status failed

# Name the craig-security partner whose approved client certificates may call CRAIG as this partner (#3193)
craig exchange update-partner <id> --caller-partner-id <security-partner-id>

# After a credential fix (#2427): re-stage cprs record jobs that failed auth-unsupported
craig exchange trigger-release --interface cprs --record-class auth-unsupported

# Collect the education agency's weekly student file and wait for the run (#3188, #3190; admin, once the
# interface's collection consent is on)
craig exchange collection-run --interface doe_slds --leg weekly_records

# Enqueue only (scripted): print the job, poll it later with `craig job wait exchange <id>`
craig exchange collection-run --interface doe_slds --leg weekly_records --no-wait --format json

collection-run runs a collection as a background job (#3190): it POSTs /v1/exchange/collections/run once with \{ client_request_id, interface, leg }, the service answers 202 with the job, and the command polls the job every 2 s until it succeeds or fails (job). A succeeded job recorded a run, and the command prints that run: its transaction_id, its status (completed, or failed with the failure class) and the counts. A run whose status is failed exits zero, since the job did its work and recorded it: read status, and run the collection again, which posts every report again. A failed job exits non-zero naming the job’s error token; with refused_at_start its detail says what did not hold when the run started (collection-disabled, partner-unresolved:<class>, agreement-does-not-admit), and no partner was called. --client-request-id is the ADR-062 key: the same id replays the same job whatever its state; omitted, a fresh id is minted, so a bare rerun is a new job and is refused 409 job-already-active while one is still queued or running. --no-wait prints the accepted job and returns.

--caller-partner-id binds a partner’s calls to this row (Taking a partner’s calls): a call to the return listener is admitted only for the interface whose active partner row names the caller’s craig-security partner. One caller has one active row per adapter kind; a second is refused 409. An update cannot clear it: deactivate the row, or revoke the certificate, to stop a caller.

--auth-type is none, bearer, basic or api_key; --auth-config takes secret REFERENCE names only, shaped by the type ({}, {"token_ref"}, {"username","password_ref"}, {"header","key_ref"}); an update names both or neither (#2427). TOKEN (--exchange-format, --exchange-type, and craig icpc attach --attachment-type) matches ^[a-z0-9][a-z0-9_.-]*$ (⇐ 64 bytes); REASON (--held-reason) is one of the eight admission hold reasons or 23 settlement class tokens; KEY (craig agreement --object-key) is /-separated non-empty segments (never . or .., no segment-edge whitespace, backslash, control, format, or line/paragraph separator characters, ⇐ 1024 bytes); and UUID_OR_USERNAME (craig agreement update --approved-by) is a UUID or trimmed IdP username free of control, format (Cf), and line/paragraph separator characters (⇐ 100 bytes; #2831).

subsidy

The conversion operator’s tool (craig-financial; state office; deployment guide § SHINES conversion cutover). It was an xtask verb until #3126 (ADR-088).

craig subsidy import --manifest <json> --records <jsonl> [--batch-id ID] [--request-id UUID]
                     [--finalize-request-id UUID] [--out DIR] [--throttle-rps N] [--abort] [--yes]

One batch, start to finish: reconcile the export offline (the record count against the manifest; the manifest checksum verified when given, computed and printed when absent), create the batch or resume --batch-id, stage every record (a replay on a resumed run is progress), and write run-<batch>.json and rejections-<batch>.jsonl into --out. Then, in this order: --abort aborts the batch (a rehearsal; nothing reaches the generator); any rejected record fails the run; without the global --yes it stops and says so; with it, it finalizes as a background job (job), reads the batch back, and prints the closeout checklist. It never triggers payment generation. There is no service-principal mode: sign in as the responsible person (craig login --device), or pass their token with --bearer-token.

agreement

Manage data sharing agreements.

craig agreement list [--partner-id ID] [--status TEXT] [--page N] [--per-page N]
craig agreement create --partner-id ID --agreement-title TEXT --effective-date DATE [--expiration-date DATE] [--data-elements JSON] [--legal-authority TEXT] [--object-key KEY]
craig agreement update <id> [--status TEXT] [--agreement-title TEXT] [--expiration-date DATE] [--object-key KEY] [--approved-by UUID_OR_USERNAME]

Examples:

# List active agreements
craig agreement list --status active

# Create a data sharing agreement
craig agreement create --partner-id <id> --agreement-title "GA-FL Data Exchange" --effective-date 2025-01-01

# Activate an agreement
craig agreement update <id> --status active

icpc

Manage ICPC (Interstate Compact on the Placement of Children) requests, home studies, and attachments.

craig icpc list [--direction TEXT] [--status TEXT] [--overdue BOOL] [--page N] [--per-page N]
craig icpc create --case-id ID --child-id ID --direction TEXT --sending-state XX --receiving-state XX --request-type TEXT
craig icpc get <id>
craig icpc update <id> --status TEXT
craig icpc home-study <id> [--home-safety pass|fail|pending] [--background-checks pass|fail|pending] [--rules-recommendation approve|approved|conditional|deny|denied] [--coordinator-decision approve|approved|conditional|deny|denied] ...
craig icpc get-home-study <id>
craig icpc attach <id> --attachment-type TOKEN --file PATH
craig icpc list-attachments <id>

Examples:

# List outbound ICPC requests
craig icpc list --direction outbound

# List overdue requests: deadline passed and the home study still undecided
# (not approved, denied, conditional, completed or withdrawn; #2287)
craig icpc list --overdue true

# Create an ICPC request
craig icpc create --case-id <id> --child-id <id> --direction outbound --sending-state GA --receiving-state FL --request-type foster_care

# Submit a home study assessment
craig icpc home-study <id> --home-safety pass --background-checks pass --coordinator-decision approve

# Attach a document
craig icpc attach <id> --attachment-type court_order --file ./order.pdf

financial

Manage payments, rate tables, and claims in the Financial service.

craig financial list-payments [--case-id ID] [--status TEXT] [--ive-eligible BOOL] [--page N] [--per-page N]
craig financial get-payment <id>
craig financial calculate-payment --case-id ID --child-id ID --placement-id ID --foster-home-id ID --payment-type TEXT --period-start DATE --period-end DATE
craig financial approve-payment <id>
craig financial issue-payment <id>
craig financial clear-payment <id>
craig financial list-rates [--jurisdiction TEXT] [--payment-type TEXT] [--page N] [--per-page N]
craig financial create-rate --jurisdiction TEXT --payment-type TEXT --age-min N --age-max N --daily-rate TEXT --effective-date DATE [--end-date DATE]

Examples:

# List pending payments
craig financial list-payments --status pending

# Approve a payment (supervisor+ only)
craig financial approve-payment <id>

# Record disbursement, then reconciliation clearance (supervisor+ only)
craig financial issue-payment <id>
craig financial clear-payment <id>

# Create a rate table entry (admin only)
craig financial create-rate --jurisdiction georgia --payment-type foster_care_maintenance --age-min 0 --age-max 5 --daily-rate 18.00 --effective-date 2026-01-01

# Calculate a payment preview
craig financial calculate-payment --case-id <id> --child-id <id> --placement-id <id> --foster-home-id <id> --payment-type foster_care_maintenance --period-start 2026-03-01 --period-end 2026-03-31

adjustment

Manage payment adjustments.

craig adjustment create --payment-id ID --reason TEXT --amount TEXT
craig adjustment approve <id>

Examples:

# Create a payment adjustment
craig adjustment create --payment-id <id> --reason "Clothing allowance" --amount 125.00

# Approve an adjustment (supervisor+ only)
craig adjustment approve <id>

claim

Manage federal fiscal claiming records.

craig claim list [--status TEXT] [--claiming-period TEXT] [--page N] [--per-page N]
craig claim get <id>
craig claim generate --claiming-period TEXT --payment-type TEXT
craig claim submit <id>

Examples:

# List all claiming records
craig claim list

# Generate a claim for a quarter
craig claim generate --claiming-period "2026-Q1" --payment-type foster_care_maintenance

# Submit a claim for federal reimbursement (admin only)
craig claim submit <id>

reporting

Data quality monitoring and federal reporting (AFCARS/NCANDS).

craig reporting quality-dashboard
craig reporting list-issues [--source-service TEXT] [--issue-type TEXT] [--severity TEXT] [--resolved BOOL] [--page N] [--per-page N]
craig reporting resolve-issue <id>
craig reporting generate-afcars --reporting-period <YYYY><A|B> [--client-request-id UUID] [--no-wait]
craig reporting list-afcars [--status TEXT] [--page N] [--per-page N]
craig reporting get-afcars <id>
craig reporting review-afcars <id> [--errors [--element KEY] [--class missing|invalid|tardy] [--cursor UUID] [--limit N]] [--mark-reviewed]
craig reporting approve-afcars <id>
craig reporting ready-afcars <id>
craig reporting generate-ncands --reporting-year N [--client-request-id UUID] [--no-wait]
craig reporting list-ncands [--status TEXT] [--page N] [--per-page N]
craig reporting approve-ncands <id>

generate-ncands builds the NCANDS Child File submission for one federal fiscal year as a background job (#1936, plan background-jobs): it POSTs /v1/reporting/ncands/generate ONCE, prints the accepted job (202), then polls GET /v1/reporting/jobs/<id> every 2 s until the job is terminal and prints the submission (the job’s result — id, reporting_year, record_count, validation_errors, child_fatalities, status). A failed job exits non-zero naming the job’s error token. --client-request-id is the ADR-062 key: the same id replays the SAME job whatever its state; omitted, a fresh id is minted per run, and a bare rerun is a NEW job — refused 409 job-already-active while one for the same fiscal year is still queued or running (one generate per fiscal year at a time). --no-wait prints the accepted job and returns; resume with craig job wait reporting <id>. The poll survives a bearer expiry exactly as craig job wait does (one re-login per expiry from CRAIG_PASSWORD or a terminal prompt; otherwise it stops with the resume line). The submission id equals the job id, so approve-ncands takes the id the generate printed. Approval is the last NCANDS step: transmit-ncands was removed in #2130, because its route only marked a submission transmitted and nothing delivers the Child File to ACF yet.

generate-afcars builds the AFCARS out-of-home-care submission for one report half (<YYYY><A|B>: 2026A is October 2025 – March 2026) as a background job (#2144, plan afcars-records-and-generate): it POSTs /v1/reporting/afcars/generate ONCE, prints the accepted job (202), then polls GET /v1/reporting/jobs/<id> every 2 s until the job is terminal and prints the finalized submission (the job’s result: validated or validated_with_errors, the latter always until P-D5; its id is the job id). A failed job exits non-zero naming the job’s error token. --client-request-id is the ADR-062 key: the same id replays the SAME job whatever its state; omitted, a fresh id is minted per run, and a fresh id is refused 409 job-already-active while a job for the same half is still queued or running. --no-wait prints the accepted job and returns; resume with craig job wait reporting <id>. While the AFCARS surface is not verified the generate records nothing and exits non-zero with 503 Service Unavailable — <reason token>; a half that has not ended, or one the verified crosswalk or dictionary does not cover, is 422.

review-afcars shows one submission’s validation report (#2164, plan afcars-validation D7) from GET /v1/reporting/afcars/<id>/validation: the element results, the validation steps, the record gaps, the count of observation error rows and the review-only findings counted by kind. The report is bounded whatever the submission’s size, and it carries ids, keys, class tokens and counts only, never a cell value. --errors prints the observation errors instead, ONE page per run (--element and --class filter it); when more rows remain, table output ends with next page: --cursor <id> — rerun with that cursor for the next page. --limit is 1..=500 (default 100); anything else is 422. An unknown id is 404. --mark-reviewed prints the summary, then marks the submission reviewed (PUT /v1/reporting/afcars/<id>/review); the server refuses it unless the submission is validated, and the CLI exits non-zero with the server’s 400 Bad Request — invalid AFCARS transition: … line.

ready-afcars marks an approved AFCARS submission ready for transmission (#2179, plan afcars-readiness D4) with PUT /v1/reporting/afcars/<id>/ready-for-transmission: the server re-verifies the current export against the verified AFCARS surface, then freezes it, and prints the readiness (ready_by, ready_at, the export generation and digest). While the surface is not verified it records nothing and exits non-zero with 503 Service Unavailable — <reason token>; a submission with no current export is 409, checked before its state (export it, then retry); one that is not approved, has no records or carries validation errors is 400; a superseded submission or a stale export is 409. It replaces transmit-afcars (removed in #2180; delivery to ACF is #1967).

Examples:

# View the data quality dashboard (supervisor+ only)
craig reporting quality-dashboard

# List unresolved critical issues
craig reporting list-issues --severity critical --resolved false

# Resolve a data quality issue
craig reporting resolve-issue <id>

# Generate an AFCARS submission for a report half (as the jurisdiction's AFCARS policy allows: in Georgia an
# administrator or a supervisor)
craig reporting generate-afcars --reporting-period 2026A

# Approve an AFCARS submission, then mark its current export ready for transmission (the CLI has no export command:
# an administrator exports it first in the web app)
craig reporting approve-afcars <id>
craig reporting ready-afcars <id>

# Review an AFCARS submission's validation report, then page its tardy errors
craig reporting review-afcars <id>
craig reporting review-afcars <id> --errors --class tardy
craig reporting review-afcars <id> --errors --class tardy --cursor <next-page-id>

# Generate NCANDS for a fiscal year (enqueue + poll to terminal), then approve it
craig reporting generate-ncands --reporting-year 2025
craig reporting approve-ncands <id>

# Enqueue without waiting, then poll from another shell
craig reporting generate-ncands --reporting-year 2025 --no-wait --format json
craig job wait reporting <id>

# Scripted retry: the same id replays the same job
craig reporting generate-ncands --reporting-year 2025 --client-request-id 0192b3c4-0000-7000-8000-000000000936

security

Audit log, security reviews, and compliance management in the Security service.

craig security audit [--user-id ID] [--service TEXT] [--action TEXT] [--resource-type TEXT] [--resource-id ID] [--from TIMESTAMP] [--to TIMESTAMP] [--page N] [--per-page N]
craig security audit-by-user <user-id>
craig security audit-by-resource <resource-type> <resource-id>
craig security list-reviews [--review-type TEXT] [--status TEXT] [--page N] [--per-page N]
craig security create-review --review-type TEXT --scheduled-date DATE --reviewer TEXT
craig security update-review <id> --status TEXT [--completed-date DATE]
Subcommand Description

audit

Query the audit log with optional filters (user, service, action, resource, time range).

audit-by-user

Get all audit entries for a specific user.

audit-by-resource

Get audit entries for a specific resource (by type and ID).

list-reviews

List security reviews, optionally filtered by type or status.

create-review

Create a new security review (biennial, incident, or ad_hoc).

update-review

Update a security review’s status and optionally set the completion date.

Examples:

# Query audit log for a specific user
craig security audit --user-id <id>

# Query audit entries for a time range
craig security audit --from 2026-01-01T00:00:00Z --to 2026-03-01T00:00:00Z

# View all audit activity for a case
craig security audit-by-resource case <case-id>

# List overdue security reviews
craig security list-reviews --status overdue

# Schedule a biennial security review
craig security create-review --review-type biennial --scheduled-date 2026-06-01 --reviewer "Jane Doe"

# Mark a review as completed
craig security update-review <id> --status completed --completed-date 2026-06-15

archive

The archive-then-prune surface of craig-security (#1129 / ADR-058). run and purge are DESTRUCTIVE and prompt for confirmation unless --yes — the verb-local flag, or the global --yes/--force/CRAIG_YES (Destructive verbs). Unlike every other destructive verb they fail CLOSED without a terminal answer, so scripts must pass --yes. Both refuse with a typed 403 naming the consent knob when the deployment has not enabled the archiver (CRAIG_SECURITYRETENTION_ARCHIVEENABLED) — for run that refusal is synchronous, at the enqueue, before any job exists.

craig archive list [--source-service TEXT] [--page N] [--per-page N]
craig archive run [--yes] [--client-request-id UUID] [--no-wait]
craig archive purge [--limit N] [--yes]

run is a background job (#1934, job): after the confirmation gate it POSTs /v1/security/archive/run ONCE with { client_request_id }, the service answers 202 with the job, and the command polls GET /v1/security/jobs/<id> every 2 s until it succeeds or fails. The job holds the retention-archive lease for its whole life and runs pass after pass over ONE set of table states until nothing past the hot window remains (more: false) — no more re-running by hand; a pass that moves nothing while rows remain ends the job failed(no_progress). On success it prints the engine’s pass report (per-table counts — the body the route used to answer synchronously); a failed job exits non-zero naming the job’s error token. --client-request-id is the ADR-062 key: the same id replays the SAME job whatever its state; omitted, a fresh id is minted, so a bare rerun is a NEW job and is refused 409 job-already-active while one is still queued or running. --no-wait prints the accepted job and returns; resume with craig job wait security <id>. purge stays a plain synchronous POST.

Subcommand Description

list

List archive-ledger records (one row per archived batch: object keys, sha256, id/time range, retention state).

run

Enqueue the archive job (202 + poll): audit-class rows past the hot window are copied to the object store and then DELETED from the hot tables, pass after pass until more is false. The job’s result is the pass report (per-table counts). Attributed to the calling operator in every ledger row.

purge

PERMANENTLY destroy expired archives (data + manifest objects) whose DFCS-named retention date has passed with no legal hold — until DFCS names a schedule every row has retention_until = NULL and purge refuses it. Bounded per call (--limit, 1..=100); re-run while more is true.

Examples:

# List all archive-ledger records
craig archive list

# List archives from the rules service (fleet bookkeeping rows)
craig archive list --source-service craig-rules

# Run the archive job and wait for its pass report (admin only; deletes
# hot rows after archiving)
craig archive run

# Enqueue only (scripted): print the job, poll it later
craig archive run --yes --no-wait --format json
craig job wait security <id>

# Destroy up to 25 expired archives without prompting (scripted use)
craig archive purge --limit 25 --yes

nist

NIST SP 800-53 security control mapping and compliance tracking in the Security service.

craig nist list [--control-family TEXT] [--implementation-status TEXT] [--page N] [--per-page N]
craig nist update <control-id> --status TEXT [--notes TEXT] [--last-assessed DATE] [--assessed-by TEXT]
Subcommand Description

list

List NIST SP 800-53 controls, optionally filtered by control family or implementation status.

update

Update a NIST control’s implementation status, notes, and assessment metadata.

Examples:

# List all NIST controls
craig nist list

# List controls in the Access Control (AC) family
craig nist list --control-family AC

# List controls that are only partially implemented
craig nist list --implementation-status partial

# Mark a control as fully implemented
craig nist update AC-2 --status implemented --last-assessed 2026-03-01 --assessed-by "Jane Doe"

# Update a control with implementation notes
craig nist update AU-3 --status partial --notes "Audit logging implemented for cases and placements; financial service pending"

intake

Public-intake lifecycle commands (Phase 12). Covers listing screened reports, viewing a report by confirmation code, converting a screened-in report into a formal referral, and managing partner API keys + signer keys (for JWS-signed partner submissions).

# List reports awaiting screening
craig intake list --status pending

# Show one report by confirmation code
craig intake show RPT-20260420-A7E2

# Convert a screened-in report into a referral (the response priority is
# derived by the jurisdiction's roll-up ruleset — there is no --priority)
craig intake convert-report <report-id> [--icwa]

# Partner API key management
craig intake keys list
craig intake keys create --partner-name "Hospital Consortium" --contact-email ops@example.com

# Staff (phone) intake (#1745): enter a report with its ACTUAL receipt time —
# when the call came in, not when it is keyed (RFC 3339; must not be in the
# future). Posts as you (cases records `created_by`); prints the report id.
# `--report-source` (#648) is the REQUIRED NCANDS #10 RptSrc report source — one of
# the fifteen `ReportSource` tokens (`social_services_personnel` … `anonymous_reporter`,
# `other`, `unknown`; see `craig intake submit-report --help`).
craig intake submit-report --reporter-type mandated --report-source education_personnel \
  --reporter-first-name Jane --reporter-relation teacher --admin-unit Fulton \
  --received-at 2026-09-01T09:30:00-04:00 \
  --narrative "Caller described a child left unattended overnight" \
  --child-first-name Ada --child-last-name Smith --child-dob 2018-01-15

Subcommands: list-reports, get-report, list-decisions, record-decision, convert-report, screen-out-report, submit-report, keys list|create|revoke, signer-keys list|approve|revoke. See craig intake --help for the full tree.

partner

Partner administration in craig-security: a partner’s record, its API keys and the client certificates it calls CRAIG with (ADR-091). Administrators only; the API enforces it.

# Register the certificate a partner will call CRAIG with. It admits nobody yet.
craig partner cert register <partner-id> --pem-file desk.pem --label "benefits batch host, 2027"

# Approve it: from now a caller presenting it is the partner
craig partner cert approve <partner-id> <certificate-id>

# List a partner's certificates, in every status
craig partner cert list <partner-id>

# Revoke one: it admits nobody from then on (asks for confirmation)
craig partner cert revoke <partner-id> <certificate-id>

--pem-file names a file holding exactly one certificate. A certificate is public; never pass a key file. A certificate authority’s certificate, one valid at no time or past its validity, and one already registered and not revoked are refused.

Subcommands: list, create, get, delete, create-key, list-keys, revoke-key, cert register|approve|revoke|list. See craig partner --help for the full tree.

alerts / detection / changes (Security)

Phase 8 breach-detection and security-change-monitoring commands.

# List open security alerts
craig alerts list --status open

# Acknowledge an alert
craig alerts ack <alert-id> --notes "False positive — rule tuning underway"

# List and trigger detection rules
craig detection list
craig detection run

# Major-changes monitoring (7 CFR § 272.15 equivalent)
craig changes list
craig changes create --type worker_assignment --description "..." --scope "admin_unit:Fulton"

education / health (Placement child records)

Phase 4 expansion commands for tracking a child’s educational enrollment and health visits (stored under craig-placement).

# Educational enrollment
craig education list --child-id <uuid>
craig education create --child-id <uuid> --school-name "Fulton Elementary" --grade-level "3" --enrollment-date 2026-08-15

# Health visits and overdue-appointment tracking
craig health list --child-id <uuid>
craig health overdue   # children with next_due_date in the past
craig health create --child-id <uuid> --record-type physical_exam --provider-name "Dr. Smith" --visit-date 2026-04-01 --health-assessment
craig health update <id> --health-assessment false
craig health update <id> --next-due-date none --clear medications
craig education update <id> --withdrawal-date none --clear notes --school-district "Fulton County"

# The child's health and education facts window ledgers
craig health facts <child-id> set|correct <row-id>|retract <row-id>|close <row-id>|get [--as-of DATE]
craig education facts <child-id> set|correct <row-id>|retract <row-id>|close <row-id>|get [--as-of DATE]

health create --health-assessment marks the visit as a (b)(9) health assessment. The flag is a presence flag and the key is sent on every create: omitting it sends false, so a visit counts as an assessment only when you say so. health update --health-assessment true|false changes the flag; omitting it leaves the stored value unchanged.

Clearing a field (#2440). education update and health update change only the flags given; an omitted flag leaves its field unchanged. A clearable field is sent as null on its clear form, which the service reads as "clear". Dates and the provider type take the none keyword: education update --withdrawal-date none, health update --next-due-date none, --immunization-date none, --provider-type none. Free text, where none could be a real value, clears through a repeatable --clear <FIELD>: for education school_district, grade_level, withdrawal_reason and notes; for health provider_name, diagnosis, treatment_plan, medications, immunization_name and notes. Naming a field in --clear and setting it in the same command is a usage error, and no request is sent; --clear refuses any other field. education update also takes --school-district and --grade-level. The service still holds its own rules: clearing an immunization record’s immunization_name is its 400 required-field-missing.

health create --record-type and health update --record-type take one of the six health_records record types: physical_exam, dental, vision, mental_health, developmental or immunization. The CLI refuses any other token before it sends a request, and --help lists the six.

health facts and education facts drive the child’s two facts window ledgers under /v1/placement/children/{child_id}/health-facts and …/education-facts. They take the same verbs and shared flags as person demographics: set records a complete statement, correct / retract / close act on the named row, and get reads the row in force (--as-of, default today). Every answer flag is optional. An omitted flag is sent as null, which means unanswered.

  • health facts records the (b)(10) answers. --condition-status takes a ConditionStatus token. The eleven category flags take existing, previous or does_not_apply: --condition-intellectual-disability, --condition-autism-spectrum-disorder, --condition-visual-impairment-and-blindness, --condition-hearing-impairment-and-deafness, --condition-orthopedic-impairment-or-other-physical-condition, --condition-mental-emotional-disorders, --condition-attention-deficit-hyperactivity-disorder, --condition-serious-mental-disorders, --condition-developmental-delay, --condition-developmental-disability and --condition-other-diagnosed-condition. The service accepts a category only when the status is child_has_a_diagnosed_condition.

  • education facts records --school-enrollment ((b)(11), a SchoolEnrollment token), --educational-level ((b)(12), an EducationalLevel token such as 1st_grade) and --special-education ((b)(14), an IEP or an IFSP: yes or no).

admin-unit

Administrative-unit CRUD for jurisdictional reference data (replaces the earlier --county flags across several subcommands with a generalized --admin-unit; CRAIG supports counties, tribal regions, boroughs, parishes, etc.).

craig admin-unit list --state GA
craig admin-unit create --name "Apache County" --state AZ --unit-type county --fips-code "001"

worker-unit

Bind workers to administrative units — the operator surface of the ADR-077 worker→admin-unit registry on craig-security (#1899; the browser surface is the Studio page /studio/worker-units, #1907). Only an ACTIVE county registry row binds; the unit’s name is frozen on the binding at assign, so renaming / retyping / deactivating a bound registry row is refused (409 ADMIN_UNIT_BOUND) until every binding is revoked.

craig worker-unit list   (--sub UUID | --username NAME)
craig worker-unit assign (--sub UUID | --username NAME) <unit> [--jurisdiction KEY] [--request-id UUID]
craig worker-unit revoke (--sub UUID | --username NAME) <binding-id> [--if-match N]
  • Every verb names the worker by --sub (the IdP subject) or --username, resolved through GET /v1/security/workers?search= to EXACTLY one worker whose preferred_username equals the name — a substring hit is never taken (the grant is an authority), and zero or several exact matches are a typed error naming the near-misses / the candidate subs.

  • <unit> is a registry id or a county NAME, resolved through GET /v1/security/admin/units (case-insensitive, active counties only) under the same exactly-one rule; two states sharing a county name (Harris exists in Georgia and Texas) is an ambiguity --jurisdiction resolves.

  • revoke is a destructive verb (see [_destructive_verbs]); it sends the row’s version as If-Match — the current one, read first, unless --if-match pins the value you last saw. A replay against an already-revoked binding answers 200 with the row.

craig worker-unit assign --username rita.regional Harris --jurisdiction texas
craig worker-unit list --username rita.regional
craig worker-unit revoke --username rita.regional <binding-id>

completion

Generate shell completion scripts.

# Bash
craig completion bash > ~/.local/share/bash-completion/completions/craig

# Zsh
craig completion zsh > ~/.zfunc/_craig

# Fish
craig completion fish > ~/.config/fish/completions/craig.fish

# PowerShell
craig completion powershell > _craig.ps1

After generating completions, restart your shell or source the file.

craig-manage

craig speaks to the services' APIs. craig-manage (tools/craig-manage, ADR-088) holds the tools that act directly on a deployment’s databases, broker and object store. It ships in the craig-operator image; from a checkout, build it with cargo install --path tools/craig-manage.

No default target. A verb that reads or writes a database takes --database-url, else the owning service’s own CRAIG_<SERVICE>__DATABASE_URL, and refuses to start when neither is set. Nothing in the binary names a devstack.

Verb What it does

craig-manage seed-admin-units [--only <jurisdiction_key>] [--database-url <url>]

Upserts the compiled-in county dataset into craig-security’s admin_unit_registry and reports rows a live worker binding froze and active rows the dataset no longer names. Idempotent.

craig-manage archive-fetch <service> <table> (--id <uuid> | --from <rfc3339> --to <rfc3339>) [--database-url <url>]

Resolves an archived row or a time range through the owning service’s ledger (craig-rules, craig-exchange, craig-security), verifies the batch’s sha256, and prints the archived NDJSON lines verbatim. The object store is read through CRAIG_STORE__*.

craig-manage gen-client-keys --registry-out <json> --env-out <env>

Generates one ES256 assertion key per confidential client: the issuer’s public registry and the private keys. Touches no database.

craig-manage quarantine-drain <queue> --yes [--out <dir>] [--limit <n>]

Drains a quarantine queue: replays each returnable capture through craig.dlx and files the rest as NDJSON. The broker URL is read from CRAIG_QUARANTINE_DRAIN_AMQP_URL only, never from the command line, and has no default. The procedure is in the deployment guide.

craig-manage backfill-assignments [--limit <n>] [--cases-database-url <url>] [--placement-database-url <url>] [--financial-database-url <url>] [--exchange-database-url <url>] [--yes]

Propagates each case’s assigned worker, supervisor and unit from craig-cases into the placement, financial and exchange databases. Idempotent, and it never rewinds a newer assignment. Each database is its flag, else its service’s CRAIG_<SERVICE>__DATABASE_URL; all four must be named. It prints host/database for the four and, without --yes, stops there having contacted nothing.

craig-manage reconcile [--scope <keys>] [--output <path>] [--<service>-database-url <url> …]

Read-only sweep for orphan references between the service databases, with a markdown report (cross-service reconciliation). Every database the selection touches must be named.

craig-manage caregiver-coverage [--as-of YYYY-MM-DD] [--jurisdiction <label>] [--database-url <url>] [--cases-database-url <url>] [--strict]

Read-only count of active family placements whose unit has no current caregiver binding, per county and unit kind. The placement database must be named; the cases database is optional (without it home-less rows bucket as (county unknown)). --strict exits non-zero on any gap.

craig-manage invariants [--service <name> [--database-url <url>]] [--gate] [--catalog <path>]

Read-only sweep of the platform invariants (each a query that must return no rows) over the nine stateful services' databases, from the catalog compiled into the binary. A whole sweep needs every service’s CRAIG_<SERVICE>__DATABASE_URL; --service needs one. --gate fails only on the blocking subset (testing reference § Invariant tests).

The first three were xtask verbs until #3128, quarantine-drain until #3129, and backfill-assignments (as backfill-cross-service-assignment) until #3130; reconcile and caregiver-coverage until #3131; invariants until #3132.

Scripting Examples

Evaluate all rule sets

# List rule set IDs and evaluate each one
for id in $(craig --format json rules list | jq -r '.data[].id'); do
  echo "=== $id ==="
  craig rules export "$id" | jq '.name'
done

Create a referral and investigate

A referral is born by converting a screened-in report (#1746); its response priority is derived from the recorded screening decision.

# Enter the report (a phone intake, with its actual receipt time)
RPT=$(craig --format json intake submit-report --reporter-type mandated \
  --report-source education_personnel --admin-unit Fulton --received-at 2025-03-17T14:05:00Z \
  --narrative "Teacher reports a child arriving hungry and unwashed for a week" \
  --child-first-name Ada --child-last-name Smith --child-dob 2018-01-15 | jq -r '.id')

# Screen it in, attesting the criteria facts
craig intake record-decision "$RPT" --disposition-kind screened_in \
  --rationale "meets the criteria" \
  --fact maltreatment_alleged=true --fact child_in_state=true \
  --fact child_identified=true --fact alleged_maltreater_is_caregiver=true

# Convert — the referral's response_priority is the roll-up's token
REF=$(craig --format json intake convert-report "$RPT" | jq -r '.id')

# Create an investigation from the referral — the deadline is derived from the
# referral's response priority (#1747), never typed
INV=$(craig --format json investigation create \
  --referral-id "$REF" --assigned-worker jsmith \
  --assignment-area Fulton | jq -r '.id')

# Submit safety assessment
craig investigation safety-assessment "$INV" --facts @facts.json

Export all rule sets as backup

mkdir -p backup/rulesets
for id in $(craig --format json rules list | jq -r '.data[].id'); do
  name=$(craig --format json rules get "$id" | jq -r '.name')
  craig rules export "$id" > "backup/rulesets/${name}.json"
  echo "Exported $name"
done
Edit this page · latest