Skip to content

CLI#

This page provides documentation for the dbt-bouncer CLI.

dbt-bouncer#

Entrypoint for dbt-bouncer.

Usage:

dbt-bouncer [OPTIONS] COMMAND [ARGS]...

Options:

  --config-file PUREPATH          Location of the YML config file.
  --check TEXT                    Limit the checks run to specific check
                                  names, comma-separated. Examples:
                                  'check_model_has_unique_test', 'check_model_
                                  names,check_source_freshness_populated'.
  --only TEXT                     Limit the checks run to specific categories,
                                  comma-separated. Examples:
                                  'manifest_checks',
                                  'catalog_checks,manifest_checks'.
  --output-file PATH              Location of the file where check metadata
                                  will be saved.
  --output-format [csv|json|junit|sarif|tap]
                                  Format for the output file or stdout when no
                                  output file is specified. Choices: csv,
                                  json, junit, sarif, tap. Defaults to json.
  --output-only-failures          If passed then only failures will be
                                  included in the output file.
  --show-all-failures             If passed then all failures will be printed
                                  to the console.
  -v, --verbosity                 Verbosity.
  --version                       Show the version and exit.
  --help                          Show this message and exit.

init#

Create a basic dbt-bouncer.yml file.

Raises: RuntimeError: If the config file already exists.

Usage:

dbt-bouncer init [OPTIONS]

Options:

  --help  Show this message and exit.

list#

List all available dbt-bouncer checks, grouped by category.

Usage:

dbt-bouncer list [OPTIONS]

Options:

  --help  Show this message and exit.

validate#

Validate the dbt-bouncer configuration file.

Checks for YAML syntax errors and common configuration issues, reporting line numbers for any issues found.

Raises: RuntimeError: If the config file is not found.

Usage:

dbt-bouncer validate [OPTIONS]

Options:

  --config-file PUREPATH  Location of the YML config file.
  --help                  Show this message and exit.

Validate command#

The validate subcommand checks your configuration file for common issues:

dbt-bouncer validate --config-file dbt-bouncer.yml

It will report:

  • YAML syntax errors with line numbers
  • Missing required fields (like name in checks)
  • Incorrect configuration types (e.g., if a check category is not a list)

Example output for a valid config:

Config file is valid!

Example output for issues:

Found 2 issue(s) in config file:
  Line 1: Check is missing required 'name' field
  Line 3: YAML syntax error: ...

Exit codes#

dbt-bouncer returns the following exit codes:

  • 0: All checks have succeeded.

  • 1:

    • At least one check has failed. Check the logs for more information.
    • A fatal error occurred during check setup or check execution. Check the logs for more information.