CLI reference
This page provides documentation for our command line tools.
dbt-jobs-as-code
dbt-jobs-as-code 1.22.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/CD triggers) without removing 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 |
--use-desc-for-id |
boolean | Store the [[identifier]] tag in the job description instead of the job name. | False |
--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 (also supports glob patterns for those files or a directory). | 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 as linked_id when exporting jobs, to use the YAML with link or update-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 |
--use-desc-for-id |
boolean | Store the [[identifier]] tag in the job description instead of the job name. | False |
--help |
boolean | Show this message and exit. | False |
link
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 |
--use-desc-for-id |
boolean | Store the [[identifier]] tag in the job description instead of the job name. | 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 YML jobs config file (also supports glob patterns for those files or a directory).
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 |
--exclude-identifiers-matching |
text | Exclude jobs from dbt Cloud if their identifiers match this regex pattern. | None |
--use-desc-for-id |
boolean | Store the [[identifier]] tag in the job description instead of the job name. | False |
--account-id |
integer | [Optional] The ID of your dbt Cloud account. Required to reconcile deletions when the config defines no jobs at all. | None |
--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 YML jobs config file (also supports glob patterns for those files or a directory).
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 |
--exclude-identifiers-matching |
text | Exclude jobs from dbt Cloud if their identifiers match this regex pattern. | None |
--use-desc-for-id |
boolean | Store the [[identifier]] tag in the job description instead of the job name. | False |
--account-id |
integer | [Optional] The ID of your dbt Cloud account. Required to reconcile deletions when the config defines no jobs at all. | None |
--fail-fast |
boolean | Stop subsequent operations if any step fails during sync. | False |
--help |
boolean | Show this message and exit. | False |
unlink
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 |
--use-desc-for-id |
boolean | Store the [[identifier]] tag in the job description instead of the job name. | False |
--help |
boolean | Show this message and exit. | False |
update-jobs
Update existing dbt Cloud jobs from a YML file, matching each job by its linked_id.
Typical flow: import-jobs --include-linked-id > jobs.yml, edit the file, then update-jobs jobs.yml.
The jobs don't need to be linked (no [[identifier]] added to their name).
Unlike sync, this command never creates, deletes, links or unlinks jobs, and jobs not in
the file are left untouched. Nothing is updated if any job in the file can't be matched.
Use --dry-run to see the differences without applying them.
CONFIG is the path to your YML jobs config file (also supports glob patterns for those files or a directory).
Usage:
dbt-jobs-as-code update-jobs [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 |
--dry-run |
boolean | In dry run mode we don't update dbt Cloud. | False |
--fail-fast |
boolean | Stop subsequent operations if any job fails to update. | False |
--use-desc-for-id |
boolean | Store the [[identifier]] tag in the job description instead of the job name. | False |
--help |
boolean | Show this message and exit. | False |
validate
Check that the config file is valid
CONFIG is the path to your YML jobs config file (also supports glob patterns for those files or a directory).
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 |
--use-desc-for-id |
boolean | Store the [[identifier]] tag in the job description instead of the job name. | False |
--help |
boolean | Show this message and exit. | False |