Core CLI reference
This guide documents the Soda Core CLI commands for working with Soda Data Contracts. You can use the CLI to generate, test, publish, and verify contracts using either Soda Core (local execution) or Soda Runner (remote execution).
Core CLI and Soda CLI are not the same.
Looking to manage your full Soda Cloud platform (datasources, datasets, monitors, runners, and more) from one tool? See the Soda CLI reference for the
sodaclicommand.
Which CLI should I use?
Soda has two command-line tools:
Core CLI (
soda) — a Python tool focused on data contracts, run locally. Create, test, publish, and verify contracts, with fine-grained check selection.Soda CLI (
sodacli) — a single Go binary that manages your entire Soda Cloud platform: datasources, datasets, contracts, monitors, results, incidents, IAM, runners, and secrets. Authenticate once and drive it from your terminal, CI/CD, or an AI agent.Use
sodaclito manage the full platform; usesodafor local, contract-only work. They work together:sodacli contract verify --localrunssodaunder the hood.
Soda CLI (sodacli)
Soda Core CLI (soda)
Language
Go single binary, no dependencies
Python (pip + data source connectors)
Execution
Cloud via Soda Runner, or local with --local
Local only
Scope
Full platform: datasources, datasets, contracts, monitors, results, runners, secrets, IAM, incidents
Contract verification and data source testing
Contract generation
contract create --mode copilot (AI) or skeleton
Manual authoring
CI/CD
--no-interactive, --output json, structured exit codes
Basic exit codes
For full language reference, see: Contract Language reference
For supported data source configurations, see: Data source reference for Soda Core
Installation
Soda Python LibrariesMake sure you install the following packages:
sodasoda-<data_source>: the package relevant to the data source(s) you will use. E.g.soda-postgres, orsoda-bigquery.Learn more about supported data sources.
Connect to Soda Cloud
The connection to Soda Cloud is made via a config file (sc_config.yml), used to create and test your Soda Cloud configuration. This is required for publishing contracts or pushing verification results.
Don’t have an account? Book a demo to get started.
Create Soda Cloud config
To connect the CLI or Python API to Soda Cloud, you must provide an sc_config.yml file for authentication, which will be necessary to run scans that send results to Soda Cloud, to publish or verify contracts via CLI, and to use the Python API.
Parameters
--file, -f
Yes
Path to a Soda Cloud YAML configuration file.
--verbose, -v
No
Display detailed logs during execution.
The above command will create the sc_config.yml file, which will look like the following:
Required fields
host
Yes
Soda Cloud region endpoint
You can reference environment variables instead of hardcoding values:
Set them in your environment:
CLI usage
Pass the sc_config.yml file when running CLI commands:
The CLI uses this file to authenticate and send results to Soda Cloud.
Python API usage
Provide the file path when calling Soda Cloud operations:
The Python API reads the file to authenticate and connect to Soda Cloud.
Test connection
--soda-cloud, -sc
Yes
Path to a Soda Cloud YAML configuration file
--verbose, -v
No
Display detailed logs during execution.
Wait time for a busy Soda Cloud
When Soda Cloud is busy, it can answer a request with HTTP status 429 and a Retry-After header instead of processing it. Soda Cloud has not done any work on such a request, so the CLI and Python API wait for the time Soda Cloud asks for, plus a small random extra so that many clients do not all resend at the same moment, and then send the same request again.
Each request waits up to 5 minutes in total. After that, the request fails like any other Soda Cloud error. Set the SODA_CLOUD_DEFERRAL_BUDGET_SECONDS environment variable to change the limit:
Not set or empty
Each request waits up to 300 seconds (5 minutes).
0
No waiting. The first 429 answer fails the request.
Any other positive number
Each request waits up to that many seconds.
Negative numbers and values that are not a number are ignored with a warning, and the default applies.
The log shows each wait and the outcome:
On a self-hosted Soda Runner, set the variable for the launcher pods with extraEnvs in the runner's values file. See Soda Runner: additional information.
Configure a data source
These commands help you define a local configuration for your data source (used by Soda Core) and validate the connection.
Create data source config
--file, -f
Yes
Output file path for the data source YAML configuration file.
--verbose, -v
No
Display detailed logs during execution.
Test data source connection
--data-source, -ds
Yes
Path to a data source YAML configuration file.
--verbose, -v
No
Display detailed logs during execution.
Create a contract
Bootstraps a contract file from an existing dataset's schema. Runs either locally or on a Soda Runner; output is written to a local file, to Soda Cloud as a draft, or both.
Local execution:
Runner execution:
--dataset, -d
Yes
Fully qualified dataset name (data_source_name/database_name/schema_name/table_name) aka Soda Cloud dataset identifier.
--file, -f
Conditional
Path to a contract YAML file to be created. Directories will be created if needed. Required unless --soda-cloud is set.
--data-source, -ds
Conditional
Path to a data source YAML config file. Required for local execution; ignored when --use-runner is set.
--soda-cloud, -sc
Conditional
Path to Soda Cloud YAML config file. Required when --use-runner is set, or when --file is omitted.
--use-runner, -a
No
Run introspection on Soda Runner instead of locally. Default: false.
--no-type-parameters, -ntp
No
Omit data type parameters (precision, scale, length) from generated columns.
--verbose, -v
No
Display detailed logs during execution.
For a full walkthrough including what the generated skeleton contains and common errors, see Create and edit contracts.
Test a contract (dry run)
Checks that a contract is syntactically valid before publishing or running a verification.
--contract, -c
Yes
Path to a contract YAML file
--verbose, -v
No
Display detailed logs during execution.
Publish a contract
Publishes a local contract to Soda Cloud, making it the source of truth for verification.
--contract, -c
Yes
Path to a contract YAML file.
--soda-cloud, -sc
Yes
Path to Soda Cloud YAML config file.
--verbose, -v
No
Display detailed logs during execution.
This action requires the "Manage contract" permission on the dataset; the user is identified based on the API key provided in the Soda Cloud configuration.
Learn more about permissions here: Dataset attributes & responsibilities
Fetch a contract from Soda Cloud
You can fetch a contract from Soda Cloud to output it in a local file.
--dataset, -d
Yes
Soda Cloud dataset identifier.
--file, -f
Yes
The path to a contract YAML file to update or create.
--soda-cloud, -sc
Yes
Path to Soda Cloud YAML config file.
--verbose, -v
no
Display detailed logs during execution.
Verify a contract
Executes a contract verification to check if the dataset complies with its expectations. You can verify a local contract file or a Soda Cloud contract either locally (in your Python environment) or remotely with a Soda Runner.
--use-runner, -r
No
Use Soda Runner for execution
--publish
No
Publish results and contract to Soda Cloud. This action requires the "Manage contract" permission on the dataset; the user is identified based on the API key provided in the Soda Cloud configuration. Learn more about permissions here: Dataset attributes & responsibilities
--data-source, -ds
without --use-runner
Path to a data source YAML config file
--contract, -c
without --use-runner
Path to the contract YAML file
--soda-cloud, -sc
with --use-runner or with --publish
Path to a Soda Cloud YAML config file
--dataset, -d
with --use-runner
Soda Cloud dataset identifier. When Soda Cloud cannot return a contract for the dataset, the command stops with exit code 3.
--set
No
Override contract variables at runtime (can be used multiple times)
--check-filter, -cf
No
Filter checks by field. Format: key=value, or key!=value to exclude the checks that match. Can be repeated. Supported keys: type, name, column, relative_path (alias path), check_path, qualifier, collection or its alias standard, source, scope, attributes.<key>. Wildcards (*, ?) supported. See Run a subset of checks
--verbose, -v
No
Display detailed logs during execution
--blocking-timeout-in-minutes, -btm
No
With --use-runner, the maximum time in minutes to wait for the remote verification to complete. Default: 60.
Exit codes
soda contract verify returns an exit code your pipeline can act on. The same codes apply with --use-runner.
0
All checks passed.
1
One or more checks failed.
2
One or more checks warned and none failed.
3
The verification could not run. Before it starts: a usage error such as a flag given more than once or an unknown flag, a scope check filter that names a contract scope no file declares, or with --dataset, a contract Soda Cloud could not return. Locally: a contract parse or validation error, or an engine error. On Soda Runner: a scan that errored, failed, was canceled, or timed out.
4
Results could not be sent to Soda Cloud. With --use-runner, this also covers a remote scan that could not be started, --check-paths or --check-filter values that Soda Cloud rejected, and a wait longer than --blocking-timeout-in-minutes.
Override variables
Use the --set option to define or override variables in the contract when running a verification.
--set
No
Define variable key-value pairs for substitution
Contract Collaboration
Soda enables collaboration on data contracts through requests and proposals. Data consumers can request changes, propose updates, and iterate with dataset owners until alignment is reached. From the CLI, you can fetch, review, and publish proposals, ensuring contract changes are tracked and versioned in Git.
Read more about Contract collaboration
Fetch a proposal
Fetches the content of a proposal from Soda Cloud and saves it as a contract file, which can then be published to Git. This allows dataset owners to incorporate approved changes into version-controlled data contracts.
-r
Yes
The request number. Identifies the request to fetch. Request numbers can be found when reviewing a proposal. See screenshot below.
-p
No
The proposal number. Defaults to the latest proposal if not specified. Proposal numbers are shown as the decimal part when reviewing a proposal. See screenshot below.
--soda-cloud, -sc
Yes
Path to the Soda Cloud config file (e.g., soda-cloud.yaml).
--f
Yes
Path to the output file where the contract will be written.
Push a proposal to Soda Cloud
Uploads a contract file to Soda Cloud as a proposal for a specific request. This allows dataset consumers or owners to share updates directly from the CLI and provide context with an accompanying message.
-sc, --soda-cloud
Yes
Path to the Soda Cloud configuration file.
-f, --file
Yes
Path to the contract file to be pushed to Soda Cloud.
-r, --request
Yes
The Contract Request number to which the proposal belongs.
-m, --message
No
A descriptive message about the changes being proposed.
Transition a request
Updates the status of a contract request in Soda Cloud. This is useful for marking a request as open, resolved, or closed when no action will be taken.
-sc, --soda-cloud
Yes
Path to the Soda Cloud configuration file.
-r, --request
Yes
The Contract Request number to be transitioned.
-s, --status
Yes
• open → Reopen or keep the request active
• done → Mark the request as completed.
• wontDo → Mark the request as closed without changes (“won’t do”).
Run a subset of checks
You can choose to run only specific checks from your contract using check filters (--check-filter) or check paths (--check-paths). Both options can be combined.
Check filters
Use --check-filter (or -cf) to select checks by their properties. Each filter is a key=value expression, or key!=value to exclude the checks that match. See Negated filters.
Supported fields
type
Check type
type=missing, type=schema
name
Check name (custom or default)
name=Email format
column
Column name (column-level checks only)
column=customer_email
relative_path
YAML path to the check within its file. path is an alias.
relative_path=columns.id.checks.missing
check_path
Full check path, including the collection it comes from where the check is not from a contract (see #check-paths)
check_path=data-standard.pii_rules:columns.id.checks.missing
qualifier
Check qualifier
qualifier=c2
scope
Key of the contract scope the check is in, or base for a check without a scope. See #contract-scope-filters
scope=eu, scope=base
attributes.<key>
Custom attribute value (supports list-valued attributes)
attributes.severity=critical
Learn more about check names, qualifiers, and attributes in the Contract Language reference.
Every check belongs to a check collection — the file that defines it. A contract is one kind of check collection, a Data Standard is another. When a run covers more than one collection, two more fields select by collection:
collection, standard
Name of the check collection the check comes from
collection=pii_rules
source
Kind of check collection: soda-contract or data-standard
source=data-standard
Negated filters
Write a filter as key!=value to leave out the checks that match it and run the rest. Every field takes it, and wildcards work the same way.
A negated filter leaves out only checks that have a value for its field. -cf column!=id keeps every dataset-level check, since those have no column, and -cf attributes.severity!=low keeps every check without a severity attribute.
Soda splits a filter on its first =, so -cf name=a!=b selects the checks named a!=b.
Contract scope filters
A check in a contract scope has the scope's key in the scope field. A check without a scope has base.
To select several scopes, repeat the filter: -cf scope=eu -cf scope=us.
A scope value that no file in the run declares stops the command with exit code 3 before the verification starts, locally and with --use-runner. A negated value counts too. The error names the unknown key and the known ones:
base is always known. A value with a * or ? wildcard must match at least one known key, so a pattern like scope=ap* that matches no scope stops the command the same way. The known keys are those of every file in the run. Data Standards do not support contract scopes.
Combining multiple filters
Repeat -cf to add multiple filters. Filters follow AND/OR grouping logic:
Same field (OR): at least one value must match.
Different fields (AND): all field groups must match.
Negated values: within a field, a check that matches a negated value is left out, even when it also matches a plain value. A field with only negated values keeps every check that none of them matches.
Wildcards
Filter values support wildcards using * (matches any sequence of characters) and ? (matches any single character). Matching is case-sensitive.
List-valued attributes
When filtering by an attribute that contains a list (e.g., tags: [prod, critical]), check filters support two matching modes:
Member match — use a plain value to match if any element in the list matches. Wildcards are supported.
Full list match — use [a,b] syntax to match only if the list equals that exact set of values. Order does not matter. Wildcards are not supported in full list match mode.
For list elements that contain commas or spaces, use double quotes inside the brackets:
Check paths
Use --check-paths (or -cp) to select checks by their hierarchical location in the contract YAML.
A check path is the hierarchical location of a check within your YAML contract file. It follows the contract's structure and identifies the exact check(s) to run.
A check path is composed of the keys that define where the check is located in the YAML. It can reference:
a check at the dataset level (e.g.
checks.freshness),a column-level check (e.g.
columns.last_updated_on.checks.invalid)a check with a qualifier (see Check qualifiers) (e.g.
columns.last_updated_on.checks.invalid.5bb8b1orchecks.row_count.5bb8b1) .
Each segment of the path corresponds to a level in the YAML hierarchy, separated by dots (.).
Example:
On Soda Cloud, the check path of a given check can be found on the check page in the check info panel.

Check paths in a contract scope
A check in a contract scope has a check path that starts with the scope:
For example, to run the missing check on the id column in the scope eu:
A path without the prefix matches only the check without a scope. -cp columns.id.checks.missing leaves out the missing check on id in the scope eu. In a local run, to select a check at one location in every scope, filter on relative_path=, which ignores the prefix.
Check paths outside a contract
Everything above describes contract check paths. A dataset can have other check collections applied to it at the same time, so a check from one of those is identified by a path that also names the collection it came from:
Data Standards are the only other kind today, so their checks look like this:
Because . and : separate the parts of a check path, a collection's name cannot contain either character. Contract check paths keep the forms shown above: no prefix for a check without a scope, and the scope.<scope key>: prefix for a check in a contract scope.
Combining check filters and check paths
You can use --check-filter and --check-paths together. The path selectors from --check-paths are combined with any other check filters using AND logic across different fields.
Behavior and results
The behavior below applies to both --check-filter and --check-paths.
One or more valid filters or paths provided
Only matching checks are executed.
Empty --check-paths
e.g. ... --check-paths --verbose ...
Ignored; all checks execute.
No checks match the filters
e.g. ... -cf type=nonexistent
No checks execute.
Partial match
e.g. ... -cf type=freshness -cf type=nonexistent
Only matching checks execute (in this case, only the freshness check).
Results in Soda Cloud
When using --check-filter or --check-paths, only the checks matching the selection are executed.
Checks not matching the filters are not executed. They go to Soda Cloud marked as excluded and keep their last status there.
Their status, metrics, and results are not updated; they are effectively untouched during this run.
However, in the Reporting API, the response will include all checks defined in the contract, representing, for each scan, the outcomes of all checks.
Checks that were skipped (because they did not match the filters) are still present in the list of check results, but are marked with CheckResultsData.level: excluded.
Last updated
Was this helpful?
