Skip to main content

Commands

The datacontract CLI groups its functionality into the following commands. Run datacontract --help or datacontract <command> --help at any time to see the latest usage.

CommandDescription
initCreate an empty data contract from a template.
editEdit a contract in the Data Contract Editor (web UI).
lintValidate that the contract is correctly formatted.
changelogShow a changelog between two contracts.
testRun schema and quality tests on configured servers.
dbtGenerate dbt tests from a contract and run them (dbt sync).
ciRun tests for CI/CD pipelines with annotations and summaries.
exportConvert a contract to a target format.
importCreate a contract from a source format.
catalogCreate an HTML catalog of data contracts.
publishPublish a contract to Entropy Data.
apiStart the CLI as a web server with a REST API.

Common usage

datacontract init odcs.yaml
datacontract edit odcs.yaml
datacontract lint odcs.yaml
datacontract changelog v1.odcs.yaml v2.odcs.yaml
datacontract test odcs.yaml
datacontract dbt sync orders.odcs.yaml --project-dir ./warehouse
datacontract export html datacontract.yaml --output odcs.html
datacontract import sql --source my-ddl.sql --dialect postgres --output odcs.yaml

Most commands accept a --debug flag for verbose logging.