Using the CLI

How to use check-datapackage on the command-line.

check-datapackage has one command, check, which checks a Data Package’s metadata against the Data Package standard. The general pattern for the CLI is:

Terminal
check-datapackage COMMAND [ARGS] [OPTIONS]

To get an overview of the available commands and flags, run the following command, which is equivalent to using the --help flag:

Terminal
check-datapackage
Usage: check-datapackage COMMAND



check-datapackage checks if metadata is compliant with the Data Packagestandard



╭─ Commands ───────────────────────────────────────────────────────────────────╮

│ <check>               Check a Data Package's metadata against the Data       │

│                       Package standard.                                      │

│ --help                Display this message and exit.                         │

│ --install-completion  Install shell completion for this application.         │

│ --version             Display application version.                           │

╰──────────────────────────────────────────────────────────────────────────────╯

Checking Data Package metadata

Use the check command to check a Data Package’s metadata:

Terminal
check-datapackage check

The example below shows the output of running check-datapackage check in a directory containing a datapackage.json for an example Data Package, flora.

All checks passed!

Checking metadata in a custom location

By default, check looks for a datapackage.json file in the current directory, but you can specify a different path using the source argument:

Terminal
check-datapackage check another/directory/datapackage.json

You can also point check-datapackage to a remote Data Package by providing the full URL to the datapackage.json. For example:

Terminal
check-datapackage check https://raw.githubusercontent.com/seedcase-project/example-seed-beetle/refs/heads/main/datapackage.json
All checks passed!

For Data Packages on GitHub, use either a gh: or github: prefix as a shortcut instead of the full URL:

Terminal
check-datapackage check gh:seedcase-project/example-seed-beetle
All checks passed!

You can also include a branch or tag:

Terminal
check-datapackage check gh:seedcase-project/example-seed-beetle@main
Important

check raises an error when checks fail. This makes it suitable for CI and pre-commit workflows where failed checks should stop execution.

Enabling strict checks

By default, check checks properties marked as “MUST” in the Data Package standard. To additionally check “SHOULD” properties, use the --strict flag:

Terminal
check-datapackage check --strict

You can set strict = true in .cdp.toml as well; command-line options override file-based configuration. See the configuration guide for details.

For more details, see the check guide or run:

Terminal
check-datapackage check --help

Global options

In addition to --help, the top-level CLI provides:

Terminal
check-datapackage --install-completion

This installs shell completion for supported shells.

Terminal
check-datapackage --version

This prints the installed check-datapackage version.