contextlift

CLI reference

Global options accepted before or after any command:

Core verbs (contextlift --help)

Eight verbs complete one end-to-end measurement:

VerbWhat it does
demoRun an offline 30-second end-to-end measurement on SQLite with canned predictions and zero API keys.
doctorCheck installed extras, credentials, environment guards (CONTEXTLIFT_FORBIDDEN_PROJECTS), and explain refusals (--explain).
gateAudit a gold answer key against 16 defect classes and 4 warnings; save golds_clean.csv.
splitCreate a deterministic hash-based curate.csv / holdout.csv split and ID lists.
lintRefuse written context defects, live enum mismatches (--db, --db-role), and cross-layer semantic conflicts (--dbt, --snowflake-semantic, --ossie, --lookml) at $0.
roundRun a paired control-vs-treatment evaluation with pre-flight power/leak/lint gates, sealed holdout tracking, merge policy enforcement, and HMAC-SHA256 attestation.json.
bundleBuild a self-contained, zero-JavaScript verdict.html report for the pinned comparison.
nextInspect --workspace and print the single next command to run with resolved paths.

All grouped verbs (contextlift --help-all)

After you have a result

VerbPurpose
classesPrice and measure each context class (rules, schema, terms, examples) separately.
attributeRank which context rules or terms explain fixed and broken questions via SQL AST comparison.
historyTrack one question across every round to see when it broke or recovered.
bisectBinary-search a rule set to confirm which exact rule caused a regression.
triageGroup failing questions by error shape (SCHEMA_MISS, FILTER_WRONG, JOIN_ERROR, etc.).
worklistPrioritize which failing context item to edit first.
climbTrack accuracy across rounds against the same baseline, guarded by a noise floor.
suggestPropose lint- and leak-screened rule patches strictly from working-set (curate) failures.

Build a question set

VerbPurpose
initDetect local SQLite/DuckDB/dbt assets, introspect starter spec/schema/*.json, and write contextlift.yaml.
logPull BigQuery INFORMATION_SCHEMA.JOBS_BY_PROJECT demand tables (--demand) or filtered query logs.
mineMine candidate gold questions round-robin across tables from query logs.
reviewPrepare a review sheet, run optional cross-family --draft triage, render offline Steward HTML (--html), import decisions.json, and compile golds.csv.
ingest-failuresConvert production agent failure JSONL into a PII-redacted review.csv.
draft-contextDraft starter per-table Markdown docs from warehouse metadata (no LLM, no row reads).
draft-rulesDraft business rules from one triage failure bucket, citing its curate questions.
rewrite-questionsRedraft natural-language question wording for existing golds without touching the warehouse.
audit-goldsInspect question clarity and answer-key alignment on an existing gold CSV.
curate-examplesBuild a leak- and template-twin-checked worked-example bank (--pool disjoint from --targets).
build-examplesBuild a spec/examples/bank.jsonl worked-example bank strictly from the working half of a gold set.
mine-contextExtract candidate column descriptions and rules from query history.
context-writeInstall a human-reviewed draft into context/rules.md with version history.
estate-shapeReport table concentration, question redundancy, and split shared-ground stats (free).
doc-coverageCount what fraction of candidate or gold queries read documented datasets (free).
resolvable-liftCompute exact McNemar resolvable lift floors and sample-size requirements (free).

Ask and score by hand

VerbPurpose
generateGenerate SQL predictions for one arm (--reps 3, optional --retry --db, --context-per-question).
scoreGrade a predictions CSV against gold SQL and save a reusable JSON report (--save-report).
ablatePaired comparison of two scored arms (--without-report / --with-report), printing lift, Tango CI, McNemar p, and verdict.
armsInspect the compiled Arm 0d and Arm 1 hashes and payload sizes for a spec/.
leakVerify that held-out questions and gold SQL do not appear inside a context file or bundle.
importRegister externally produced predictions as a tracked arm in --workspace.

Write context into a catalog and read it back

VerbPurpose
catalog-pushPush reviewed docs, rules, and examples into Google Cloud Knowledge Catalog with read-back verification (--dry-run first).
catalog-pullPull served table documentation from Knowledge Catalog into local files.
catalog-listList tables in a Knowledge Catalog entry group (dataset.table per line).
catalog-routeRoute questions through Knowledge Catalog search and write per-question context JSON.
catalog-rollbackRestore previous catalog descriptions captured by spec-push --previous-out.
spec-pushPush a structured spec/ directory into Knowledge Catalog (--dry-run plans and checks drift).
semanticConvert LookML, dbt, or Ossie models into starter rules and candidate questions.
compileCompile a spec/ into snowflake-yaml, dbt-yaml, or ossie with honest certification headers.
serve-mcpServe a certified Arm and attestation status over zero-dependency JSON-RPC 2.0 stdio MCP.
eval-roomGenerate DDL for an undocumented BigQuery evaluation view room so Arm 0d is truly bare.

Look at the warehouse

VerbPurpose
schemaExport CREATE TABLE DDL text for prompt runners.
profileBuild a value dictionary of distinct categorical column values.
sentinelPlant a synthetic fact in a catalog and test whether the agent reads it.
spec-schemaGenerate spec/schema/*.yaml files from BigQuery INFORMATION_SCHEMA.

Retrieval

VerbPurpose
routing-gateAudit a routing answer key for concentration, missing catalog tables, or duplicate IDs.
score-routingGrade table-routing predictions against gold tables (with optional --catalog snap).

Keep a record

VerbPurpose
indexRebuild index.json from recorded run folders under --workspace.
pinOverride the default baseline or candidate arm in --workspace (`pin baselinecandidate ID`).
shareExport allowlisted, leak-scanned summary counts and metrics (no customer SQL or text).
scanScan staged diffs, history (--all), commit ranges (--since), or tracked files (--tree) for customer secrets.
pr-summaryRender one Markdown or JSON pull-request comment from saved round/ablate, lint, attribute, cost, and safety outputs.
verify-attestationVerify content hash, optional HMAC-SHA256 signature (--require-signature), and hash chain (--prev) on attestation.json.
export-otelExport an attestation.json or round.json into OpenTelemetry OTLP JSON.