> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# dbt™ Commands

> Pre-commit hooks for dbt™️ commands validate CLI operations, run history, and operation order. Ensure proper command syntax and dependencies before executing dbt™️ operations.

## `dbt-clean`

Run the `dbt clean` command. Deletes all folders specified in the clean-targets.

**Example**

```yaml theme={"system"}
repos:
  - repo: https://github.com/dbt-checkpoint/dbt-checkpoint
    rev: v1.0.0
    hooks:
      - id: dbt-clean
```

***

## `dbt-compile`

Run the `dbt compile` command. Generates executable SQL from source model, test, and analysis files.

**Arguments**

`--global-flags`: Global dbt flags applicable to all subcommands. Instead of dash `-` please use `+`.\
`--cmd-flags`: Command-specific dbt flags. Instead of dash `-` please use `+`.\
`--model-prefix`: Prefix dbt selector, for selecting parents.\
`--model-postfix`: Postfix dbt selector, for selecting children.\
`--models`: dbt-checkpoint is by default running changed files. If you need to override that, e.g. in case of Slim CI (`state:modified`), you can use this option.

**Example**

```yaml theme={"system"}
repos:
  - repo: https://github.com/dbt-checkpoint/dbt-checkpoint
    rev: v1.0.0
    hooks:
      - id: dbt-compile
        args: ["--model-prefix", "+", "--"]
```

or

```yaml theme={"system"}
repos:
  - repo: https://github.com/dbt-checkpoint/dbt-checkpoint
    rev: v1.0.0
    hooks:
      - id: dbt-compile
        args: ["--models", "state:modified", "--cmd-flags", "++defer", "++state", "path/to/artifacts", "--"]
```

⚠️ do not forget to include `--` as the last argument. Otherwise `pre-commit` would not be able to separate a list of files with args.

***

## `dbt-deps`

Run `dbt deps` command. Pulls the most recent version of the dependencies listed in your packages.yml.

**Example**

```yaml theme={"system"}
repos:
  - repo: https://github.com/dbt-checkpoint/dbt-checkpoint
    rev: v1.0.0
    hooks:
      - id: dbt-deps
```

***

## `dbt-docs-generate`

Run `dbt docs generate` command. The command is responsible for generating your project's documentation website.

**Example**

```yaml theme={"system"}
repos:
  - repo: https://github.com/dbt-checkpoint/dbt-checkpoint
    rev: v1.0.0
    hooks:
      - id: dbt-docs-generate
```

***

## `dbt-parse`

Run the `dbt parse` command. When running dbt >= 1.5, generates `manifest.json` from source model, test, and analysis files.

**Arguments**

`--global-flags`: Global dbt flags applicable to all subcommands. Instead of dash `-` please use `+`.\
`--cmd-flags`: Command-specific dbt flags. Instead of dash `-` please use `+`.<br />

**Example**

```yaml theme={"system"}
repos:
  - repo: https://github.com/dbt-checkpoint/dbt-checkpoint
    rev: v1.0.0
    hooks:
      - id: dbt-parse
```

or

```yaml theme={"system"}
repos:
  - repo: https://github.com/dbt-checkpoint/dbt-checkpoint
    rev: v1.0.0
    hooks:
      - id: dbt-parse
        args: ["--cmd-flags", "++profiles-dir", ".", "++project-dir", ".", "--"]
```

⚠️ do not forget to include `--` as the last argument. Otherwise `pre-commit` would not be able to separate a list of files with args.

***

## `dbt-run`

Run `dbt run` command. Executes compiled SQL model files.

**Arguments**

`--global-flags`: Global dbt flags applicable to all subcommands. Instead of dash `-` please use `+`.\
`--cmd-flags`: Command-specific dbt flags. Instead of dash `-` please use `+`.\
`--model-prefix`: Prefix dbt selector, for selecting parents.\
`--model-postfix`: Postfix dbt selector, for selecting children.\
`--models`: dbt-checkpoint is by default running changed files. If you need to override that, e.g. in case of Slim CI (`state:modified`), you can use this option.

**Example**

```yaml theme={"system"}
repos:
  - repo: https://github.com/dbt-checkpoint/dbt-checkpoint
    rev: v1.0.0
    hooks:
      - id: dbt-run
        args: ["--model-prefix", "+", "--"]
```

or

```yaml theme={"system"}
repos:
  - repo: https://github.com/dbt-checkpoint/dbt-checkpoint
    rev: v1.0.0
    hooks:
      - id: dbt-run
        args: ["--models", "state:modified", "--cmd-flags", "++defer", "++state", "path/to/artifacts", "--"]
```

⚠️ do not forget to include `--` as the last argument. Otherwise `pre-commit` would not be able to separate a list of files with args.

***

## `dbt-test`

Run `dbt test` command. Runs tests on data in deployed models.

**Arguments**

`--global-flags`: Global dbt flags applicable to all subcommands. Instead of dash `-` please use `+`.\
`--cmd-flags`: Command-specific dbt flags. Instead of dash `-` please use `+`.\
`--model-prefix`: Prefix dbt selector, for selecting parents.\
`--model-postfix`: Postfix dbt selector, for selecting children. `--models`: dbt-checkpoint is by default running changed files. If you need to override that, e.g. in case of Slim CI (`state:modified`), you can use this option.

**Example**

```yaml theme={"system"}
repos:
  - repo: https://github.com/dbt-checkpoint/dbt-checkpoint
    rev: v1.0.0
    hooks:
      - id: dbt-test
        args: ["--model-prefix", "+", "--"]
```

or

```yaml theme={"system"}
repos:
  - repo: https://github.com/dbt-checkpoint/dbt-checkpoint
    rev: v1.0.0
    hooks:
      - id: dbt-test
        args: ["--models", "state:modified", "--cmd-flags", "++defer", "++state", "path/to/artifacts", "--"]
```

⚠️ do not forget to include `--` as the last argument. Otherwise `pre-commit` would not be able to separate a list of files with args.


## Related topics

- [dbt™ Commands](/products/bolt/creating-schedules/command-settings/dbt-tm-commands.md)
- [dbt™-checkpoint Hooks](/integrations/pre-commit/dbt-tm-checkpoint-hooks/index.md)
- [3. Command Settings](/products/bolt/creating-schedules/command-settings/index.md)
- [Monte Carlo Commands](/products/bolt/creating-schedules/command-settings/monte-carlo-commands.md)
- [Re-executes the last dbt™ command from the point of failure](/products/bolt/creating-schedules/templates/dbt-tm-templates/re-executes-the-last-dbt-command.md)
