Generate ODCS data contracts offline with the dqhub CLI
One command turns a DQHub pack into a schema-valid ODCS v3.1 contract — entirely on your machine, nothing sent to us.
Some teams can't (or won't) upload anything — and they shouldn't have to. The dqhub CLI turns a pack into an Open Data Contract Standard (ODCS) v3.1 contract entirely offline. No upload, no account, nothing leaves your machine.
One command
npx dqhub contract orders.dqhub.ymlThat prints a schema-valid *.odcs.yaml to your terminal. Write it to a file:
npx dqhub contract orders.dqhub.yml -o orders.odcs.yamlSet the contract status (defaults to draft):
npx dqhub contract orders.dqhub.yml --status active -o orders.odcs.yamlWhat you get
The CLI runs the exact same mapper as dqhub.io — its output is byte-for-byte identical. Each rule becomes an ODCS quality entry:
- library for the standard metrics (not-null, unique, row count)
- sql for portable, generated violation-count checks
- custom for engine-native checks (Soda, Great Expectations)
…with the schema block and dqhub* provenance so the contract stays traceable.
Why offline matters
- Nothing leaves your network. The tool never phones home with your data or your packs.
- CI-friendly. Drop it into a pipeline to regenerate contracts on every change.
- Same result as the website, so you can mix and match — author in the browser, regenerate in CI.
Pair it with the reference data for the value-set tables your checks join against, and you have a complete, offline contract workflow.