CLI reference
Global options accepted before or after any command:
--workspace DIR: record argv, input hashes, output copies, and stdout underDIR/runs/and updateDIR/index.json(also read fromCONTEXTLIFT_WORKSPACE).--json: emit machine-readable JSON on stdout (supported across analysis, lint, gate, and tooling commands).-V,--version: print the installed version.--help/--help-all: list the 8 core verbs or all 61 verbs grouped by task.
Core verbs (contextlift --help)
Eight verbs complete one end-to-end measurement:
| Verb | What it does |
|---|---|
demo | Run an offline 30-second end-to-end measurement on SQLite with canned predictions and zero API keys. |
doctor | Check installed extras, credentials, environment guards (CONTEXTLIFT_FORBIDDEN_PROJECTS), and explain refusals (--explain). |
gate | Audit a gold answer key against 16 defect classes and 4 warnings; save golds_clean.csv. |
split | Create a deterministic hash-based curate.csv / holdout.csv split and ID lists. |
lint | Refuse written context defects, live enum mismatches (--db, --db-role), and cross-layer semantic conflicts (--dbt, --snowflake-semantic, --ossie, --lookml) at $0. |
round | Run a paired control-vs-treatment evaluation with pre-flight power/leak/lint gates, sealed holdout tracking, merge policy enforcement, and HMAC-SHA256 attestation.json. |
bundle | Build a self-contained, zero-JavaScript verdict.html report for the pinned comparison. |
next | Inspect --workspace and print the single next command to run with resolved paths. |
All grouped verbs (contextlift --help-all)
After you have a result
| Verb | Purpose |
|---|---|
classes | Price and measure each context class (rules, schema, terms, examples) separately. |
attribute | Rank which context rules or terms explain fixed and broken questions via SQL AST comparison. |
history | Track one question across every round to see when it broke or recovered. |
bisect | Binary-search a rule set to confirm which exact rule caused a regression. |
triage | Group failing questions by error shape (SCHEMA_MISS, FILTER_WRONG, JOIN_ERROR, etc.). |
worklist | Prioritize which failing context item to edit first. |
climb | Track accuracy across rounds against the same baseline, guarded by a noise floor. |
suggest | Propose lint- and leak-screened rule patches strictly from working-set (curate) failures. |
Build a question set
| Verb | Purpose |
|---|---|
init | Detect local SQLite/DuckDB/dbt assets, introspect starter spec/schema/*.json, and write contextlift.yaml. |
log | Pull BigQuery INFORMATION_SCHEMA.JOBS_BY_PROJECT demand tables (--demand) or filtered query logs. |
mine | Mine candidate gold questions round-robin across tables from query logs. |
review | Prepare a review sheet, run optional cross-family --draft triage, render offline Steward HTML (--html), import decisions.json, and compile golds.csv. |
ingest-failures | Convert production agent failure JSONL into a PII-redacted review.csv. |
draft-context | Draft starter per-table Markdown docs from warehouse metadata (no LLM, no row reads). |
draft-rules | Draft business rules from one triage failure bucket, citing its curate questions. |
rewrite-questions | Redraft natural-language question wording for existing golds without touching the warehouse. |
audit-golds | Inspect question clarity and answer-key alignment on an existing gold CSV. |
curate-examples | Build a leak- and template-twin-checked worked-example bank (--pool disjoint from --targets). |
build-examples | Build a spec/examples/bank.jsonl worked-example bank strictly from the working half of a gold set. |
mine-context | Extract candidate column descriptions and rules from query history. |
context-write | Install a human-reviewed draft into context/rules.md with version history. |
estate-shape | Report table concentration, question redundancy, and split shared-ground stats (free). |
doc-coverage | Count what fraction of candidate or gold queries read documented datasets (free). |
resolvable-lift | Compute exact McNemar resolvable lift floors and sample-size requirements (free). |
Ask and score by hand
| Verb | Purpose |
|---|---|
generate | Generate SQL predictions for one arm (--reps 3, optional --retry --db, --context-per-question). |
score | Grade a predictions CSV against gold SQL and save a reusable JSON report (--save-report). |
ablate | Paired comparison of two scored arms (--without-report / --with-report), printing lift, Tango CI, McNemar p, and verdict. |
arms | Inspect the compiled Arm 0d and Arm 1 hashes and payload sizes for a spec/. |
leak | Verify that held-out questions and gold SQL do not appear inside a context file or bundle. |
import | Register externally produced predictions as a tracked arm in --workspace. |
Write context into a catalog and read it back
| Verb | Purpose |
|---|---|
catalog-push | Push reviewed docs, rules, and examples into Google Cloud Knowledge Catalog with read-back verification (--dry-run first). |
catalog-pull | Pull served table documentation from Knowledge Catalog into local files. |
catalog-list | List tables in a Knowledge Catalog entry group (dataset.table per line). |
catalog-route | Route questions through Knowledge Catalog search and write per-question context JSON. |
catalog-rollback | Restore previous catalog descriptions captured by spec-push --previous-out. |
spec-push | Push a structured spec/ directory into Knowledge Catalog (--dry-run plans and checks drift). |
semantic | Convert LookML, dbt, or Ossie models into starter rules and candidate questions. |
compile | Compile a spec/ into snowflake-yaml, dbt-yaml, or ossie with honest certification headers. |
serve-mcp | Serve a certified Arm and attestation status over zero-dependency JSON-RPC 2.0 stdio MCP. |
eval-room | Generate DDL for an undocumented BigQuery evaluation view room so Arm 0d is truly bare. |
Look at the warehouse
| Verb | Purpose |
|---|---|
schema | Export CREATE TABLE DDL text for prompt runners. |
profile | Build a value dictionary of distinct categorical column values. |
sentinel | Plant a synthetic fact in a catalog and test whether the agent reads it. |
spec-schema | Generate spec/schema/*.yaml files from BigQuery INFORMATION_SCHEMA. |
Retrieval
| Verb | Purpose |
|---|---|
routing-gate | Audit a routing answer key for concentration, missing catalog tables, or duplicate IDs. |
score-routing | Grade table-routing predictions against gold tables (with optional --catalog snap). |
Keep a record
| Verb | Purpose | |
|---|---|---|
index | Rebuild index.json from recorded run folders under --workspace. | |
pin | Override the default baseline or candidate arm in --workspace (`pin baseline | candidate ID`). |
share | Export allowlisted, leak-scanned summary counts and metrics (no customer SQL or text). | |
scan | Scan staged diffs, history (--all), commit ranges (--since), or tracked files (--tree) for customer secrets. | |
pr-summary | Render one Markdown or JSON pull-request comment from saved round/ablate, lint, attribute, cost, and safety outputs. | |
verify-attestation | Verify content hash, optional HMAC-SHA256 signature (--require-signature), and hash chain (--prev) on attestation.json. | |
export-otel | Export an attestation.json or round.json into OpenTelemetry OTLP JSON. |