CLI Reference

Global usage:

deet <command> [options]

Global options:

  • --help, -h: help
  • --version, -v: version
  • --json: JSON output (where supported)
  • --target <t>: backend target (duckdb, postgres, bigquery, snowflake)
  • --out <dir>: output directory (default: dist/)
  • --format <f>: output format (contract: ts|json, lineage: json|mermaid|markdown)
  • --profile <p>: policy profile (dev, prod, regulated)

deet check

Parse + typecheck .dt files.

deet check
deet check ./src/main.dt

deet compile

Compile .dt into SQL artifacts.

deet compile
deet compile --target duckdb --out dist
deet compile --target postgres --out dist
deet compile --target snowflake --out dist

deet contract

Export model contracts to TypeScript (.d.ts) or JSON.

deet contract
deet contract --format json --out contracts

Outputs:

  • contracts/<model>.d.ts (TypeScript interfaces), or
  • contracts/<model>.json (schema + nullability)

Default output directory is contracts/ (override with --out).

deet fmt

Format .dt files in place.

deet fmt
deet fmt ./src/main.dt

deet test

Run tests with DuckDB.

deet test
deet test --verbose

Tests are defined with assertions in .dt files:

test orders_have_valid_amount =
  orders
    |> assert(amount >= 0.00d, "Order amount must be non-negative")

Expected output:

Test Results:
  Total: 3
  Passed: 3 ✓
  Failed: 0 ✗
  Errors: 0 !
  Duration: 120ms

The CLI writes dist/test_report.json and exits non-zero on failures.

deet migrate

Best-effort migration for a dbt project.

deet migrate --project ./path/to/dbt --output migrated-deet

deet init

Initialize a new deet project (creates rxg.toml, src/, tests/, dist/).

deet init my-project
deet init my-project --context

deet context

Generate a .deet context file for LLMs.

deet context
deet context .deet

Expected output:

✓ Generated .deet context file at .deet
This file helps LLMs understand your project structure.
Keep it updated as your project evolves.
The file is automatically added to .gitignore.

See /docs/context-file for schema details, use cases, and templates.

deet lineage <model>

Show lineage for a model.

deet lineage my_model --format json
deet lineage my_model --format mermaid
deet lineage my_model --format mermaid > dist/lineage.mmd
deet lineage my_model --column total_spent

The default output (text) lists upstream/downstream nodes and columns; --format prints to stdout.

deet introspect <db>

Generate types from an existing database.

deet introspect postgres://user:pass@host:5432/db
deet introspect duckdb://./dev.duckdb

deet schema

Schema operations (infer, merge, validate).

deet schema infer
deet schema validate

deet schema infer

Infers schemas from inline data sources (e.g., source demo = inline(...)).

Expected output:

Schema inference report:
✓ ./src/example.dt: demo
  - col0: {"kind":"primitive","name":"i64"}

deet schema merge

Merges declared model schemas (when multiple models define a schema).

deet schema merge

deet schema validate

Validates declared source/model schemas for duplicate column names.

deet schema validate

The command exits 1 if any schema fails validation.

deet cloud

Cloud operations (login, publish, search). This is optional; the CLI works without an account.