Skip to content

CLI reference

This page provides documentation for our command line tools.

dbt-jobs-as-code

dbt-jobs-as-code 1.6.0

A CLI to allow defining dbt Cloud jobs as code

Usage:

dbt-jobs-as-code [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--version boolean Show the version and exit. False
--help boolean Show this message and exit. False

deactivate-jobs

Deactivate jobs triggers in dbt Cloud (schedule and CI/CI triggers) without remoing the jobs.

This can be useful when moving jobs from one project to another. When the new jobs have been created, this command can be used to deactivate the jobs from the old project.

Usage:

dbt-jobs-as-code deactivate-jobs [OPTIONS]

Options:

Name Type Description Default
--disable-ssl-verification boolean N/A False
--config text The path to your YML jobs config file (or pattern for those files). None
--account-id integer The ID of your dbt Cloud account. None
--project-id, -p integer [Optional] The ID of dbt Cloud project(s) to use for sync None
--environment-id, -e integer [Optional] The ID of dbt Cloud environment(s) to use for sync None
--job-id, -j integer The ID of the job to deactivate. None
--help boolean Show this message and exit. False

import-jobs

Generate YML file for import.

Either --config or --account-id must be provided to mention what Account ID to use.

Optional parameters: --project-id, --environment-id, --job-id

It is possible to repeat the optional parameters --job-id, --project-id, --environment-id option to import specific jobs.

Usage:

dbt-jobs-as-code import-jobs [OPTIONS]

Options:

Name Type Description Default
--disable-ssl-verification boolean N/A False
--config text The path to your YML jobs config file (or pattern for those files). None
--account-id integer The ID of your dbt Cloud account. None
--project-id, -p integer [Optional] The ID of dbt Cloud project(s) to use for sync None
--environment-id, -e integer [Optional] The ID of dbt Cloud environment(s) to use for sync None
--job-id, -j integer [Optional] The ID of the job to import. None
--include-linked-id boolean Include the job ID when exporting jobs. False
--managed-only boolean Only import jobs that are managed (have an identifier). False
--templated-fields text Path to a YAML file containing field templates to apply to the exported jobs. None
--filter text Only import jobs where the identifier prefix, before : contains this value, is empty or is '*'. None
--help boolean Show this message and exit. False

Link the YML file to dbt Cloud by adding the identifier to the job name. All relevant jobs get the part [[...]] added to their name

The YAML file will need to contain a linked_id for each job that needs to be linked.

Usage:

dbt-jobs-as-code link [OPTIONS] CONFIG

Options:

Name Type Description Default
--disable-ssl-verification boolean N/A False
--project-id, -p integer [Optional] The ID of dbt Cloud project(s) to use for sync None
--environment-id, -e integer [Optional] The ID of dbt Cloud environment(s) to use for sync None
--dry-run boolean In dry run mode we don't update dbt Cloud. False
--help boolean Show this message and exit. False

plan

Check the difference between a local file and dbt Cloud without updating dbt Cloud. This command will not update dbt Cloud.

CONFIG is the path to your jobs.yml config file or a glob pattern for those files.

Usage:

dbt-jobs-as-code plan [OPTIONS] CONFIG

Options:

Name Type Description Default
--disable-ssl-verification boolean N/A False
--vars-yml, -v text The path to your vars_yml YML file (or pattern for those files) when using a templated job YML file. None
--project-id, -p integer [Optional] The ID of dbt Cloud project(s) to use for sync None
--environment-id, -e integer [Optional] The ID of dbt Cloud environment(s) to use for sync None
--limit-projects-envs-to-yml, -l boolean [Flag] Limit sync/plan to the projects and environments listed in the jobs YML file False
--json boolean Output results in JSON format instead of human-readable text. False
--help boolean Show this message and exit. False

sync

Synchronize a dbt Cloud job config file against dbt Cloud. This command will update dbt Cloud with the changes in the local YML file. It is recommended to run a plan first to see what will be changed.

CONFIG is the path to your jobs.yml config file or a glob pattern for those files.

Usage:

dbt-jobs-as-code sync [OPTIONS] CONFIG

Options:

Name Type Description Default
--disable-ssl-verification boolean N/A False
--vars-yml, -v text The path to your vars_yml YML file (or pattern for those files) when using a templated job YML file. None
--project-id, -p integer [Optional] The ID of dbt Cloud project(s) to use for sync None
--environment-id, -e integer [Optional] The ID of dbt Cloud environment(s) to use for sync None
--limit-projects-envs-to-yml, -l boolean [Flag] Limit sync/plan to the projects and environments listed in the jobs YML file False
--json boolean Output results in JSON format instead of human-readable text. False
--help boolean Show this message and exit. False

Unlink the YML file to dbt Cloud. All relevant jobs get the part [[...]] removed from their name

Usage:

dbt-jobs-as-code unlink [OPTIONS]

Options:

Name Type Description Default
--disable-ssl-verification boolean N/A False
--config text The path to your YML jobs config file (or pattern for those files). None
--account-id integer The ID of your dbt Cloud account. None
--project-id, -p integer [Optional] The ID of dbt Cloud project(s) to use for sync None
--environment-id, -e integer [Optional] The ID of dbt Cloud environment(s) to use for sync None
--dry-run boolean In dry run mode we don't update dbt Cloud. False
--identifier, -i text [Optional] The identifiers we want to unlink. If not provided, all jobs are unlinked. None
--help boolean Show this message and exit. False

validate

Check that the config file is valid

CONFIG is the path to your jobs.yml config file or a glob pattern for those files.

Usage:

dbt-jobs-as-code validate [OPTIONS] CONFIG

Options:

Name Type Description Default
--disable-ssl-verification boolean N/A False
--vars-yml, -v text The path to your vars_yml YML file (or pattern for those files) when using a templated job YML file. None
--online boolean Connect to dbt Cloud to check that IDs are correct. False
--help boolean Show this message and exit. False