Command line flags
For consistency, command-line interface (CLI) flags should come right after the dbt
prefix and its subcommands. This includes "global" flags (supported for all commands). When set, CLI flags override environment variables and profile configs.
For example, instead of using:
dbt --no-populate-cache run
You should use:
dbt run --no-populate-cache
Historically, passing flags (such as "global flags") before the subcommand is a legacy functionality that dbt Labs can remove at any time. We do not support using the same flag before and after the subcommand.
Using boolean and non-boolean flags
You can construct your commands with boolean flags to enable or disable or with non-boolean flags that use specific values, such as strings.
- Non-boolean config
- Boolean config
Use this non-boolean config structure:
- Replacing
<SUBCOMMAND>
with the command this config applies to. <THIS-CONFIG>
with the config you are enabling or disabling, and<SETTING>
with the new setting for the config.
CLI flags
<SUBCOMMAND> --<THIS-CONFIG>=<SETTING>
Example
CLI flags
dbt run --printer-width=80
dbt test --indirect-selection=eager
To enable or disable boolean configs:
- Use
<SUBCOMMAND>
this config applies to. - Followed by
--<THIS-CONFIG>
to turn it on, or--no-<THIS-CONFIG>
to turn it off. - Replace
<THIS-CONFIG>
with the config you are enabling or disabling
CLI flags
dbt <SUBCOMMAND> --<THIS-CONFIG>
dbt <SUBCOMMAND> --no-<THIS-CONFIG>
Example
CLI flags
dbt run --version-check
dbt run --no-version-check
0