What is Data Contract CLI?
The datacontract CLI is an open-source command-line tool for working with data contracts.
It natively supports the Open Data Contract Standard (ODCS) to:
- Lint data contracts and validate them against the ODCS JSON Schema.
- Connect to data sources such as Snowflake, BigQuery, Databricks, Postgres, Kafka, S3, and many more.
- Test that the actual data complies with the schema and quality expectations defined in the contract.
- Export a contract to 25+ formats (SQL DDL, dbt, Avro, JSON Schema, HTML, Protobuf, …).
- Import an existing schema (SQL, dbt, BigQuery, Glue, Excel, …) into a data contract.
The tool is written in Python. It can be used as a standalone CLI tool, in a CI/CD pipeline, or directly as a Python library.

Why data contracts?
A data contract is a machine-readable, versioned agreement that describes the structure, semantics, quality, and service levels of a data set. Because the contract is a single file, it can be:
- stored in Git next to your code,
- reviewed in pull requests,
- linted and tested automatically in CI/CD, and
- used to generate downstream artifacts (DDL, dbt models, schemas, documentation).
A typical contract has a servers section with endpoint details, a schema describing the structure and semantics of the data, plus service levels and quality attributes that describe expectations such as freshness and number of rows. This is enough information to connect to the data source and check that the actual data product is compliant.
How it works
When you run datacontract test, the CLI connects to a data source and runs schema and quality tests to verify that the data contract is valid. Internally it uses different engines based on the server type — it connects with DuckDB, Spark, or a native connection, executes most checks with ibis (compiling dialect-specific SQL per backend), and validates JSON with fastjsonschema.
Next steps
- New here? Start with the Quickstart.
- Learn the underlying format in Open Data Contract Standard.
- Author contracts visually with the Data Contract Editor.
- Run checks against real data with Testing.
- See every command in the Commands reference.
Related links
- Website: datacontract.com
- Source code: github.com/datacontract/datacontract-cli
- Community Slack: datacontract.com/slack
- GitHub Action: datacontract/datacontract-action