Build

CLI reference

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:

CodeMeaning
0Success. For checks: nothing left that blocks.
1The check ran and failed: a blocking finding, a broken consumer expectation, a failed prerequisite or a source that cannot connect.
2The 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.
3The 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

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 / optionTypeDefaultDescription
<domain>/<name>textrequiredDomain and product name separated by /. The name must be snake_case, 2–63 characters, starting with a letter (DP001).
--kindconsumer | source | aggregate | referenceconsumerTemplate 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.
--ownertextteam-ownerOwner group written to owner:. Use the Entra ID group that will own the product (DP002).
--rootpath.Directory that receives products/<name>/. Run it from the domain folder, or point --root at it.
--forceflagoffOverwrite 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 / optionTypeDefaultDescription
PATHpath.Product folder.
--formattext | json | sariftexttext 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.
--gateinteger, repeatable1, 2Gates to run: 1 static, 2 build, 4 deploy. Passing --gate replaces the default, so --gate 1 runs only the fast static rules.
--previouspathnoneThe same product as it is on main. Turns on the contract rules: DP007 (breaking change needs a new port version) and DP062 (semantic change).
--packYAML filebuilt-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 / optionTypeDefaultDescription
PATHpath.Product folder. Columns are taken from each port's SQL, or from columns: when the SQL cannot be read.
--setport.column=text, repeatablenoneDescription for one column. Works without prompts, so it can be used in scripts.
--interactive/--no-interactiveflaginteractivePrompt for each column that is still undescribed. Use --no-interactive in CI.
--aiflagoffAsk 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
ArgumentTypeDefaultDescription
PATHpath.Product folder.
KEYdotted keyrequiredFor 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 / optionTypeDefaultDescription
PATHpath.Product folder.
--emitdirectorynoneWrite every artefact to this directory, creating it if needed. Without it, only databricks.yml is printed to standard output.

Files written with --emit:

FileContent
databricks.ymlA 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.jsonOne ODCS v3.0.0 data contract per output port. See the product.yaml reference for how each field maps.
odps.jsonAn Open Data Product Standard descriptor for the product.
marketplace.jsonThe 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 / optionTypeDefaultDescription
PATHpath.The new version (usually your branch).
--againstpathrequiredThe old version (usually main).

The overall class is the most severe class of any port:

ClassTriggered by
internalNothing published changed.
additiveA new port, a new column, or a metadata change on a port (description, tests, access).
semanticThe SQL expression behind an existing column changed. DP062 warns; declare it as a bugfix or bump the version.
breaking-unusedColumns were removed that nobody read in 90 days (needs usage facts from the workspace).
breakingA 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 / optionTypeDescription
PORTtextPort reference, for example policy_admin.policies@v2.
--rowsJSON fileArray of row objects, for example a sample exported from the dev table.
--expectationsYAML fileMap 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 / optionTypeDefaultDescription
PATHpath.Product folder.
--samplepercentage, or full1%Share of each input to sample. 100% or full makes shallow clones instead.
--printegernonePull 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 / optionTypeDefaultDescription
PATHpath.Product folder.
--urlURLhttp://localhost:8000Base 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
OptionTypeDescription
--connectormssql-ct | mssql-cdc | mssql-batch | files | restThe ingestion method.
--probeJSON fileThe source description: {"connected": true, "tables": [{"name": ..., "primary_key": [...], "change_tracking": true, "cdc": false}]}.
ConnectorA table is ready whenOtherwise flagged as
mssql-ctchange tracking is enabled and it has a primary keychange tracking disabled or no primary key
mssql-cdcCDC is enabled on itCDC disabled
mssql-batch, files, restthe 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 / optionTypeDefaultDescription
DOMAINsnake_case textrequiredDomain name; catalogs become dp_<domain>_dev, dp_<domain>_test and dp_<domain>_prod.
--ownersgrouprequiredGroup that owns the domain's products and approves releases.
--developersgrouprequiredGroup that develops in the domain.
--outJSON fileinfra/terraform/envs/domains.auto.tfvars.jsonVariables 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.

OptionTypeDescription
--factsJSON fileFacts 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 / optionTypeDefaultDescription
ROOTpath.Repository root; every product.yaml below it is included.
--dry-run/--applyflagdry runThe 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 / optionTypeDefaultDescription
ROOTpath.Repository checkout.
--repoowner/namerequiredRepository the PRs are for.
--pack, --pack-versiontext–Upgrade policy_pack: <pack>@<old> to this version in every product.yaml and wam.yaml.
--wam-versionversion–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 / optionTypeDefaultDescription
PRODUCTdomain.productrequiredThe product to rebuild.
--fromYYYY-MM or YYYY-MM-DDrequiredFirst period. A month means its first day.
--toYYYY-MM or YYYY-MM-DDrequiredLast period. A month means day 28 of that month.
--concurrencyinteger3Partitions 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]
OptionTypeDefaultDescription
--tabletable namerequiredThe physical table that received bad data.
--bad-versionsN or N-MrequiredAffected Delta versions, inclusive.
--fix-releasetextrequiredRelease that contains the fix.
--manifestsJSON filerequiredRun manifests (run_id, product, release, inputs, started_at, outputs), as recorded by each run.
--graphJSON filerequiredProduct dependency graph: product to list of downstream products.
--dry-run/--applyflagdry 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.

OptionTypeDescription
--subject-keytextThe data subject's key. Only a 16-character SHA-256 prefix of it is printed.
--locationsJSON fileList 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]
OptionTypeDefaultDescription
--profileDatabricks CLI profilenoneRead metadata live through a SQL warehouse (system.information_schema, system.access, system.billing). Read-only.
--inputJSON filenoneA metadata snapshot exported earlier, for running without workspace access. One of --profile or --input is required.
--catalogstext, repeatableallCatalogs to scan.
--daysinteger90Look-back window for usage and spend.
--profile-columnsflagoffAlso count value patterns, such as e-mails or IBANs, in column samples. This reads data, not only metadata.
--outdirectoryassess-reportWrites assess-report.html, assess-report.json and summary.txt.
--share-anonymisedflagoffSend anonymised ratios to the peer benchmark. Opt-in; see what would be sent with benchmark show-payload.
--industrytextotherIndustry 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.

OptionTypeDefaultDescription
--manifestfilerequireddbt target/manifest.json.
--outdirectoryproductsWhere to write <product>/product.yaml.
--domaintextnoneDomain for all generated products.
--selectortextgroupWhat 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 / optionTypeDefaultDescription
MODELdbt unique_idrequiredFor example model.shop.orders.
--manifestfilerequireddbt target/manifest.json.
--outdirectory.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 / optionTypeDefaultDescription
SUBJECTreport, release, port or ai-systemrequiredWhat the pack covers.
NAMEtextnoneWith ai-system: the ai_system.name from product.yaml.
--periodtextnoneRequired for report, release and port, for example 2026-Q3.
--versionintegernoneRequired for ai-system: the training release.
--inputsJSON filerequiredCollected facts: lineage, manifests, quality results, approvals, access and changes. For ai-system: datasheet, attribute checks, PSI, snapshot, design, assumptions and mitigations.
--outdirectoryevidenceReceives <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.

OptionTypeDefaultDescription
--historyJSON filerequiredQuery history export.
--min-usersinteger5Minimum 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 / optionTypeDescription
FILEworkbookThe .xlsx file.
--mapJSON fileLegacy table to logical port.
--name, --owner, --domaintextValues for the draft product.yaml.
--outdirectoryRoot 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 / optionTypeDefaultDescription
RELEASEfolderrequiredRelease or mirror folder: artefacts, their .sigstore.json or .sig files, and sbom.spdx.json.
--identitytextwhatamesh release workflowSigstore signer identity prefix. Needs pip install sigstore.
--trusted-keykey_id=public.pem–Verify Ed25519 .sig files from a private mirror instead of Sigstore. Repeat for several keys.
--targetfolder.wam/platformWhere verified artefacts are staged, with installed.json listing digests and signers.