wam is the command-line interface for building, checking and running data products. Developers use it on their laptops and CI uses it in pipelines. This page lists every command with its arguments, options, outputs and exit codes. wam <command> --help prints the same information for the version you have installed.
pip install whatamesh # or: uv tool install whatamesh
wam --version # prints: wam <version>
Telemetry
wam sends nothing over the network for local commands. Traces are off unless you set WAM_TELEMETRY=otlp (with OTEL_EXPORTER_OTLP_ENDPOINT) or WAM_TELEMETRY=azure (with APPLICATIONINSIGHTS_CONNECTION_STRING), and the endpoint must be in WAM_TELEMETRY_ALLOW (default: localhost and Azure Monitor hosts). Vendor hosts are always refused. Spans carry the command, version, exit code and a hash of the product name, nothing else. WAM_LOG_FORMAT=json switches logs to structured JSON on stderr; WAM_TELEMETRY=console prints spans there.
Conventions
Paths. Most commands take a product folder: the directory that contains product.yaml. Its layout is fixed:
<domain>/products/<product>/
product.yaml # the product contract (see the product.yaml reference)
sql/<port>.sql # one SELECT per output port; other .sql files are internal steps
docs/README.md # shown on the marketplace page
The product's domain is taken from domain: in product.yaml, then from domain: in the nearest wam.yaml above the folder, then from the folder two levels up (<domain>/products/<product>).
Option syntax. Options are --name value. Repeatable options are repeated (--gate 1 --gate 2). Boolean pairs are written --flag/--no-flag, and the first form is the default unless the table says otherwise.
Exit codes. Every command follows the same scheme, so CI can branch on the result:
| Code | Meaning |
|---|---|
0 | Success. For checks: nothing left that blocks. |
1 | The check ran and failed: a blocking finding, a broken consumer expectation, a failed prerequisite or a source that cannot connect. |
2 | The input could not be used: product.yaml does not match the schema, an argument is missing or malformed, or a scaffold target already exists. Schema errors are printed as <file> (line N) [rule]: message. |
3 | The command needs an Enterprise licence for this step. Everything that can run without it has already run. |
Offline by default. Commands read local files only. Rules that need workspace facts (row counts, group membership, consumer expectations) are listed as skipped instead of failing. The commands that talk to a workspace say so in their description.
Command index
| Group | Commands |
|---|---|
| Build | new product, validate, describe, config explain, build, schema, diff, expect, preview, studio |
| Sources and domains | source test, domain add, platform doctor, domains sync, bot plan |
| Run and repair | backfill, remediate, gdpr plan |
| Adopt and assess | assess, benchmark show-payload, adopt dbt, convert dbt |
| Enterprise | evidence, explain, radar, migrate workbook, migrate scan, migrate convert, ai draft, mcp serve, licence verify, platform upgrade |
Build
wam new product
Creates a product folder from the template for its kind.
wam new product <domain>/<name> [--kind KIND] [--owner GROUP] [--root DIR] [--force]
| Argument / option | Type | Default | Description |
|---|---|---|---|
<domain>/<name> | text | required | Domain and product name separated by /. The name must be snake_case, 2–63 characters, starting with a letter (DP001). |
--kind | consumer | source | aggregate | reference | consumer | Template to start from. source adds a source.system.<name> input, classifications and a 6-hour freshness SLA. aggregate adds a 12-hour SLA. reference uses code as the key. |
--owner | text | team-owner | Owner group written to owner:. Use the Entra ID group that will own the product (DP002). |
--root | path | . | Directory that receives products/<name>/. Run it from the domain folder, or point --root at it. |
--force | flag | off | Overwrite an existing product folder. Without it, an existing folder exits with code 2. |
It writes product.yaml, sql/<name>.sql with a placeholder SELECT and docs/README.md.
wam new product risk/lapse_risk --kind consumer --owner team-risk-analytics --root domains/risk
wam validate
Runs the rulebook on one product: gate 1 (static) and gate 2 (build) rules by default. This is the command CI runs on every pull request.
wam validate [PATH] [--format text|json|sarif] [--gate N]... [--previous PATH] [--pack FILE]
| Argument / option | Type | Default | Description |
|---|---|---|---|
PATH | path | . | Product folder. |
--format | text | json | sarif | text | text prints one line per finding and then ok or blocked. json prints the report: findings[] (with rule, severity, message, file, line, hint and waived), skipped and pack. sarif prints SARIF 2.1.0 for GitHub code scanning and editors, without waived findings. |
--gate | integer, repeatable | 1, 2 | Gates to run: 1 static, 2 build, 4 deploy. Passing --gate replaces the default, so --gate 1 runs only the fast static rules. |
--previous | path | none | The same product as it is on main. Turns on the contract rules: DP007 (breaking change needs a new port version) and DP062 (semantic change). |
--pack | YAML file | built-in [email protected] | Policy pack to apply: disabled rules, severity overrides, grace dates and defaults. See Rulebook. |
A text finding reads <rule> <severity>[ (waived)] <file>[:line] <message>, for example DP060 block product.yaml port 'claims' (P1) is missing required checks: reconcile. SQL files that do not parse are reported as rule SQL, severity block. Online rules that were skipped are listed at the end.
Exits 1 if at least one block finding is not waived, 2 if product.yaml does not load, and 0 otherwise. Warnings never fail the command.
wam validate domains/finance/products/premiums_written
wam validate . --previous ../main/domains/finance/products/premiums_written --format sarif > wam.sarif
wam validate . --gate 1 --pack policy/acme-standards.yaml
wam describe
Fills in missing column descriptions in product.yaml, keeping comments, key order and quoting (DP011).
wam describe [PATH] [--set PORT.COLUMN=TEXT]... [--interactive/--no-interactive] [--ai]
| Argument / option | Type | Default | Description |
|---|---|---|---|
PATH | path | . | Product folder. Columns are taken from each port's SQL, or from columns: when the SQL cannot be read. |
--set | port.column=text, repeatable | none | Description for one column. Works without prompts, so it can be used in scripts. |
--interactive/--no-interactive | flag | interactive | Prompt for each column that is still undescribed. Use --no-interactive in CI. |
--ai | flag | off | Ask the configured AI Gateway endpoint for suggestions. Enterprise; without a licence it warns and continues without suggestions. |
It prints described N column(s) and only writes the file when something changed.
wam config explain
Shows the value a setting actually has and which layer it comes from.
wam config explain [PATH] KEY
| Argument | Type | Default | Description |
|---|---|---|---|
PATH | path | . | Product folder. |
KEY | dotted key | required | For example tier, triggers.condition or compute.performance_target. |
Layers apply lowest first: platform defaults, then the policy pack, then the domain wam.yaml (its defaults: map, or the whole file), then product.yaml, then command-line flags. Maps merge key by key; lists and single values replace. The output is the winning value and its source, followed by each value it overrides:
triggers.condition = 'ANY_UPDATED' (from product.yaml)
overrides platform defaults: 'ALL_UPDATED'
wam build
Compiles the product into deployable artefacts. Nothing is deployed.
wam build [PATH] [--emit DIR]
| Argument / option | Type | Default | Description |
|---|---|---|---|
PATH | path | . | Product folder. |
--emit | directory | none | Write every artefact to this directory, creating it if needed. Without it, only databricks.yml is printed to standard output. |
Files written with --emit:
| File | Content |
|---|---|
databricks.yml | A Declarative Automation Bundle with targets dev (default, development mode), test and prod. Each has one job: a resolve task, one port_<name> task per output port, checks and then record (always runs). Retries and the run-duration alert depend on the tier (P1: 3 retries and 60 minutes; P2: 2 and 120; P3: 1 and 240; P4: 0 and 480). P1 also notifies on-call. A table-update trigger is added on the inputs when triggers.mode is inputs or both, and a cron schedule when it is schedule or both. |
contract.<port>.odcs.json | One ODCS v3.0.0 data contract per output port. See the product.yaml reference for how each field maps. |
odps.json | An Open Data Product Standard descriptor for the product. |
marketplace.json | The payload for the marketplace page: ports, columns, terms, classification, freshness and the README. |
Bundle variables that you must set at deploy time: catalog (set per target), domain_sp (the domain's service principal), release (set at gate 4), wam_version (defaults to wam_version: or 0.1.0), owner_email and oncall_destination_id.
wam schema
Prints the JSON Schema (draft 2020-12) of product.yaml, with $id https://whatamesh.dev/schema/product.v1.json. Point your editor's YAML extension at it to get completion and inline errors.
wam schema > product.schema.json
wam diff
Classifies the change between two versions of a product, port by port.
wam diff [PATH] --against PATH
| Argument / option | Type | Default | Description |
|---|---|---|---|
PATH | path | . | The new version (usually your branch). |
--against | path | required | The old version (usually main). |
The overall class is the most severe class of any port:
| Class | Triggered by |
|---|---|
internal | Nothing published changed. |
additive | A new port, a new column, or a metadata change on a port (description, tests, access). |
semantic | The SQL expression behind an existing column changed. DP062 warns; declare it as a bugfix or bump the version. |
breaking-unused | Columns were removed that nobody read in 90 days (needs usage facts from the workspace). |
breaking | A port or column was removed, a column type changed, or the keys changed. DP007 then requires a new port version. |
change class: breaking
claims: removed column(s) ['loss_cause']
claims: added column(s) ['loss_cause_code']
wam expect
Runs consumer expectations against sample rows. This is the local form of DP063.
wam expect PORT --rows FILE --expectations FILE
| Argument / option | Type | Description |
|---|---|---|
PORT | text | Port reference, for example policy_admin.policies@v2. |
--rows | JSON file | Array of row objects, for example a sample exported from the dev table. |
--expectations | YAML file | Map of consumer name to a list of expectations, each in the same form as an expectations: entry. |
Each failure prints DP063 breaks <consumer>: <message>. Exits 1 if any expectation fails.
wam preview
Plans a pull-request sandbox: a schema tagged for cleanup that holds a repeatable sample of each production input (TABLESAMPLE ... REPEATABLE (42)), or a shallow clone when the sample is 100% or full, so the product runs on real data without touching production. It prints the schema name and the SQL statements. Running them needs a workspace profile.
wam preview [PATH] [--sample SIZE] [--pr NUMBER]
| Argument / option | Type | Default | Description |
|---|---|---|---|
PATH | path | . | Product folder. |
--sample | percentage, or full | 1% | Share of each input to sample. 100% or full makes shallow clones instead. |
--pr | integer | none | Pull request number, used in the sandbox schema name so parallel PRs never collide. |
How personal data is handled in the sandbox is set by sandbox.pii in product.yaml.
wam studio
Prints the Product Studio URL for this product.
| Argument / option | Type | Default | Description |
|---|---|---|---|
PATH | path | . | Product folder. |
--url | URL | http://localhost:8000 | Base URL of the Studio app in your workspace. |
Sources and domains
wam source test
Checks a source before you build on it: whether it connects, and which tables are ready for incremental ingestion.
wam source test --connector NAME --probe FILE
| Option | Type | Description |
|---|---|---|
--connector | mssql-ct | mssql-cdc | mssql-batch | files | rest | The ingestion method. |
--probe | JSON file | The source description: {"connected": true, "tables": [{"name": ..., "primary_key": [...], "change_tracking": true, "cdc": false}]}. |
| Connector | A table is ready when | Otherwise flagged as |
|---|---|---|
mssql-ct | change tracking is enabled and it has a primary key | change tracking disabled or no primary key |
mssql-cdc | CDC is enabled on it | CDC disabled |
mssql-batch, files, rest | the source connects | — |
files reads CSV, JSON, Parquet, XML and Excel through read_files. rest pages through an API with a cursor and keeps each item exactly once. The command exits 1 only if the source cannot connect; flagged tables are reported, not failed.
wam domain add
Plans a new domain and writes it into the Terraform variables, so the platform team creates it with terraform apply.
wam domain add DOMAIN --owners GROUP --developers GROUP [--out FILE]
| Argument / option | Type | Default | Description |
|---|---|---|---|
DOMAIN | snake_case text | required | Domain name; catalogs become dp_<domain>_dev, dp_<domain>_test and dp_<domain>_prod. |
--owners | group | required | Group that owns the domain's products and approves releases. |
--developers | group | required | Group that develops in the domain. |
--out | JSON file | infra/terraform/envs/domains.auto.tfvars.json | Variables file. Existing domains in it are kept; this domain is added or replaced. |
wam platform doctor
Checks platform prerequisites. Every failed check prints the fix and the team that owns it. Exits 1 if any check fails.
| Option | Type | Description |
|---|---|---|
--facts | JSON file | Facts collected from the workspace: one true/false per prerequisite check. |
wam domains sync
Maps your domains and products onto Unity Catalog domains and Discover. One domain is created per mesh domain and each product's port tables are assigned to it.
| Argument / option | Type | Default | Description |
|---|---|---|---|
ROOT | path | . | Repository root; every product.yaml below it is included. |
--dry-run/--apply | flag | dry run | The dry run prints how many domains would be created and assets assigned. --apply needs the Databricks adapter from the platform installation. |
Products are certified in Discover only with the Enterprise catalog_sync feature.
wam bot plan
Prints the pull requests the bot would open for routine upgrades: one per repository and kind, labelled whatamesh-bot and bot:<kind>, so five products that need the same pack upgrade become one PR. Pinned values change in place and comments and layout are kept.
| Argument / option | Type | Default | Description |
|---|---|---|---|
ROOT | path | . | Repository checkout. |
--repo | owner/name | required | Repository the PRs are for. |
--pack, --pack-version | text | – | Upgrade policy_pack: <pack>@<old> to this version in every product.yaml and wam.yaml. |
--wam-version | version | – | Upgrade wam_version pins to this version. |
Opening the PRs needs a bot account and token per Git provider; the GitHub and GitLab REST calls are built by whatamesh.bots.
Run and repair
wam backfill
Plans a backfill of a window-loaded product in monthly partitions, run in parallel batches. Downstream products trigger once at the end, not once per partition.
wam backfill PRODUCT --from DATE --to DATE [--concurrency N]
| Argument / option | Type | Default | Description |
|---|---|---|---|
PRODUCT | domain.product | required | The product to rebuild. |
--from | YYYY-MM or YYYY-MM-DD | required | First period. A month means its first day. |
--to | YYYY-MM or YYYY-MM-DD | required | Last period. A month means day 28 of that month. |
--concurrency | integer | 3 | Partitions per batch. |
wam remediate
Plans the fix when bad data was published: which runs read the affected table versions, and which downstream products must rebuild, in dependency order.
wam remediate --table TABLE --bad-versions N[-M] --fix-release RELEASE --manifests FILE --graph FILE [--dry-run/--apply]
| Option | Type | Default | Description |
|---|---|---|---|
--table | table name | required | The physical table that received bad data. |
--bad-versions | N or N-M | required | Affected Delta versions, inclusive. |
--fix-release | text | required | Release that contains the fix. |
--manifests | JSON file | required | Run manifests (run_id, product, release, inputs, started_at, outputs), as recorded by each run. |
--graph | JSON file | required | Product dependency graph: product to list of downstream products. |
--dry-run/--apply | flag | dry run | --apply runs the cascade and needs the Enterprise remediation feature (exit 3 without it). |
wam gdpr plan
Lists the tables and statements that an access or erasure request touches, found through PII lineage.
| Option | Type | Description |
|---|---|---|
--subject-key | text | The data subject's key. Only a 16-character SHA-256 prefix of it is printed. |
--locations | JSON file | List of {table, key_column, scd2} locations that hold the subject. |
For each location it prints a DELETE (including history for SCD2 tables) and the VACUUM to run after the retention check.
Adopt and assess
wam assess
A read-only readiness scan of an existing estate: tables without owners, untagged personal data, duplicated tables, unused tables, spend you can attribute, and a business case.
wam assess (--profile NAME | --input FILE) [--catalogs NAME]... [--days N] [--profile-columns] [--out DIR] [--share-anonymised] [--industry NAME]
| Option | Type | Default | Description |
|---|---|---|---|
--profile | Databricks CLI profile | none | Read metadata live through a SQL warehouse (system.information_schema, system.access, system.billing). Read-only. |
--input | JSON file | none | A metadata snapshot exported earlier, for running without workspace access. One of --profile or --input is required. |
--catalogs | text, repeatable | all | Catalogs to scan. |
--days | integer | 90 | Look-back window for usage and spend. |
--profile-columns | flag | off | Also count value patterns, such as e-mails or IBANs, in column samples. This reads data, not only metadata. |
--out | directory | assess-report | Writes assess-report.html, assess-report.json and summary.txt. |
--share-anonymised | flag | off | Send anonymised ratios to the peer benchmark. Opt-in; see what would be sent with benchmark show-payload. |
--industry | text | other | Industry used to group the benchmark. |
wam benchmark show-payload
Prints exactly what --share-anonymised would send, so you can review it first. Takes the assess-report.json path and --industry.
wam adopt dbt
Turns an existing dbt project into governed data products without rewriting it. One product.yaml with mode: adopted is written per dbt group, and each one is validated right away.
| Option | Type | Default | Description |
|---|---|---|---|
--manifest | file | required | dbt target/manifest.json. |
--out | directory | products | Where to write <product>/product.yaml. |
--domain | text | none | Domain for all generated products. |
--selector | text | group | What becomes a product. Default: one product per dbt group. |
For each product it prints its ports, any differences from dbt it had to resolve, and the blocking findings to fix before publishing.
wam convert dbt
Rewrites one adopted dbt model as native product SQL with logical {{ ref() }} inputs.
| Argument / option | Type | Default | Description |
|---|---|---|---|
MODEL | dbt unique_id | required | For example model.shop.orders. |
--manifest | file | required | dbt target/manifest.json. |
--out | directory | . | Receives <model>.sql. |
Enterprise
These commands come with the Enterprise package. They register themselves on wam when it is installed, so the CLI stays the same tool.
wam evidence
Builds an evidence pack for auditors: HTML, JSON and its SHA-256 hash.
wam evidence (report|release|port) --period PERIOD --inputs FILE [--out DIR]
wam evidence ai-system NAME --version N --inputs FILE [--out DIR]
| Argument / option | Type | Default | Description |
|---|---|---|---|
SUBJECT | report, release, port or ai-system | required | What the pack covers. |
NAME | text | none | With ai-system: the ai_system.name from product.yaml. |
--period | text | none | Required for report, release and port, for example 2026-Q3. |
--version | integer | none | Required for ai-system: the training release. |
--inputs | JSON file | required | Collected facts: lineage, manifests, quality results, approvals, access and changes. For ai-system: datasheet, attribute checks, PSI, snapshot, design, assumptions and mitigations. |
--out | directory | evidence | Receives <stem>.json and <stem>.html. |
wam explain
Prints the waterfall behind a metric movement: which inputs moved it, step by step. Takes PORT and --metrics FILE, the before and after evaluations from the explain job.
wam radar
Proposes candidate data products from repeated queries in the query history.
| Option | Type | Default | Description |
|---|---|---|---|
--history | JSON file | required | Query history export. |
--min-users | integer | 5 | Minimum distinct users of a pattern before it becomes a candidate. |
wam migrate workbook
Promotes an Excel workbook to a draft product. It extracts the SQL and Power Query, maps legacy tables to ports and translates the SQL.
| Argument / option | Type | Description |
|---|---|---|
FILE | workbook | The .xlsx file. |
--map | JSON file | Legacy table to logical port. |
--name, --owner, --domain | text | Values for the draft product.yaml. |
--out | directory | Root for products/<name>/ (default .). |
It prints the number of mapped and unmapped tables and every assumption it made.
wam migrate scan
Scans a folder of .sql and .dtsx (SSIS) files and prints the lineage edges and proposed product boundaries as JSON. Takes PATH.
wam migrate convert
Converts one T-SQL file to Databricks SQL on standard output. Notes go to standard error; constructs it cannot convert are marked -- manual rewrite needed. Takes FILE.
wam ai draft
Drafts a product through your own AI Gateway endpoint (WAM_AI_ENDPOINT) and opens it as a pull request. Takes --sources (the input references) and --prompt (what the product should do). Exits 3 without a licence.
wam mcp serve
Runs an MCP server over standard input and output (newline-delimited JSON-RPC) for local agents and IDEs. It serves product search and contracts from the products below the current directory. --read-only/--full defaults to read-only.
wam licence verify
Checks a licence file against the public key, then prints the customer, edition, number of domains, expiry date and mode. Takes FILE and --public-key. Exits 1 if the licence is invalid.
wam platform upgrade
Installs apps, policy packs, connectors and prompt sets from a downloaded release or a private mirror, but only when every artefact and the SBOM carry a valid signature from a trusted signer. A missing, broken or foreign signature refuses the whole release (exit 4); there is no override.
| Argument / option | Type | Default | Description |
|---|---|---|---|
RELEASE | folder | required | Release or mirror folder: artefacts, their .sigstore.json or .sig files, and sbom.spdx.json. |
--identity | text | whatamesh release workflow | Sigstore signer identity prefix. Needs pip install sigstore. |
--trusted-key | key_id=public.pem | – | Verify Ed25519 .sig files from a private mirror instead of Sigstore. Repeat for several keys. |
--target | folder | .wam/platform | Where verified artefacts are staged, with installed.json listing digests and signers. |