Reference · Core CLI

CLI

The corec command covers corpus authoring, lifecycle, ingestion, retrieval evaluation, demonstrations, and licensed Enterprise workflows through one command surface.

Command families

Run corec <command> --help for the installed version's exact options. The Enterprise CLI page owns the licensed command reference.

CommandPurposeDistribution
corec initCreate and validate a starter corec.yaml from local documents, CSV, XLSX, or canonical JSONLCore
corec validateValidate a YAML or JSON corpus configurationCore
corec schemaPrint the public configuration schemaCore
corec db / tenantMigrate the control plane and provision tenant stateCore
corec applyApply an immutable corpus-configuration revisionCore
corec source normalizeNormalize configured documents, tabular data, or canonical JSONLCore
corec ingestRun active chunking and projections for normalized recordsCore
corec query retrieveRun a named retrieval plan with principal access and exact filtersCore
corec validate-batchValidate a prepared ingestion request offlineCore
corec evalEvaluate retrieval rankings and generated answersCore
corec demoRun query-plan, adapter, graph, control-plane, and hosted retrieval demonstrationsCore
Licensed command groupsSource analysis, dataset preparation, experiment control, certification, and query routingEnterprise

Validate and inspect the configuration

  • validate reads configuration and returns a failure exit code for an invalid contract.
  • schema emits the machine-readable v1alpha1 configuration schema.
  • demo query-plan compares capability-aware physical plans without changing corpus state.
shellCoreCortex Core
corec validate ./knowledge-operations/corec.yaml
corec schema --output ./corec.schema.json
corec demo query-plan

Initialize and apply control-plane state

Tenant provisioning yields the UUID used by later operations. Apply returns the corpus UUID. Corpus inspect lists dataset UUIDs. Human-readable slugs and names remain in corec.yaml and cannot replace these runtime IDs. Apply records the actor and an idempotency key so a safe retry cannot create a second configuration revision.

shellCoreCortex Core
corec db migrate --database-url "$DATABASE_URL"
corec tenant provision \
  --database-url "$DATABASE_URL" \
  --slug knowledge-ops \
  --display-name "Knowledge Operations"
export TENANT_ID=<tenant-uuid-from-output>

corec apply \
  --database-url "$DATABASE_URL" \
  --tenant-id "$TENANT_ID" \
  --actor analyst@example.com \
  --idempotency-key knowledge-ops-config-v1 \
  ./knowledge-operations/corec.yaml
export CORPUS_ID=<corpus-uuid-from-output>

corec corpus inspect \
  --database-url "$DATABASE_URL" \
  --tenant-id "$TENANT_ID" \
  --corpus-id "$CORPUS_ID"
export DATASET_ID=<dataset-uuid-from-output>

Normalize and ingest records

Core ingests normalized JSONL through the active configuration. The selected chunker creates fragments before embedding and projection. The receipt records processor and configuration fingerprints.

shellCoreCortex Core
corec source normalize \
  --config ./knowledge-operations/corec.yaml \
  --dataset change-records \
  --output ./knowledge-operations/records.jsonl

corec ingest \
  --database-url "$DATABASE_URL" \
  --tenant-id "$TENANT_ID" \
  --corpus-id "$CORPUS_ID" \
  --dataset-id "$DATASET_ID" \
  --actor analyst@example.com \
  --idempotency-key change-records-2026-08-26 \
  ./knowledge-operations/records.jsonl

Retrieve live evidence and test access

The Core command executes the applied retrieval plan. The principal and filters are enforced before evidence is returned. Repeat with a principal outside the allow list and confirm that hits is empty. corec query route belongs to the licensed advisory workflow and is not needed to execute Core retrieval.

shellCoreCortex Core
corec query retrieve \
  --database-url "$DATABASE_URL" \
  --tenant-id "$TENANT_ID" \
  --corpus-id "$CORPUS_ID" \
  --plan default \
  --principal group:readers \
  --query "How is source identity preserved?" \
  --filter 'category="provenance"' \
  --limit 5

Evaluate retrieval and generation

Both commands write machine-readable reports and miss files. The Evaluation guide defines their inputs, metrics, and pass conditions.

shellCoreCortex Core
corec eval retrieval \
  --fragments ./golden/fragments.jsonl \
  --judgments ./golden/reviewed.jsonl \
  --retrieval-mode hybrid \
  --ranked-results ./runs/hybrid/rankings.jsonl \
  --projection-receipt ./runs/hybrid/applied-receipt.json \
  --limit 50 \
  --hit-at-1-target 0.55 \
  --output ./runs/hybrid/eval

corec eval generation \
  --input ./runs/generation-reviewed.jsonl \
  --retrieval-report ./runs/hybrid/eval/report.json \
  --gate-policy answer-quality \
  --faithfulness-target 0.80 \
  --qualified-answer-target 0.80 \
  --output ./runs/generation

Exit behavior and artifacts

  • A contract, access, integrity, or quality-gate failure returns a non-zero exit status.
  • Derived outputs go to explicit paths; source inputs remain immutable.
  • Reports retain corpus configuration, judgment identity, hashes, retrieval mode, and gate decisions.
  • Generated golden candidates remain unreviewed until a human promotes them.
  • Prepared batches can be checked with corec validate-batch before any network or database write.

Credentials

Continue readingAPI→