Registry / devops / dbt-autofix

dbt-autofix

JSON →
library0.20.6pypypi✓ verified 85d ago

dbt-autofix is a CLI tool that automatically fixes deprecations and breaking changes in dbt projects. It scans your dbt models, tests, and configurations and applies transformations to migrate to newer versions of dbt. Current version: 0.20.4, requires Python >=3.10, <3.14. Release cadence is irregular with frequent patch releases.

pip install dbt-autofix
INSTALL
IMPORT
SIG · DBT-AUTOFIX
D
dbt-autofix
devopspythonv0.20.6
Install
5.5s avg
Import
Disk
54MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.20.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 5.75s
py 3.11
✓ —
✓ 5.6s
py 3.12
✓ —
✓ 5.15s
py 3.13
✓ —
✓ 5.3s
py 3.9
1/2 runs
1/2 runs
54MB installed
● package 54MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dbt_autofix
import dbt_autofix
The package is a CLI tool; import is rarely needed. If you use it as a library, import the package directly

Install the tool, navigate to your dbt project directory, run a dry-run to see changes, then apply fixes.

pip install dbt-autofix cd /path/to/your/dbt/project # Run autofix on all models (dry-run first) dbt-autofix --dry-run # Apply fixes dbt-autofix --apply
dbt-autofix --version
Debug
Known issues
gotchaAlways run with --dry-run first. dbt-autofix modifies files in-place; without dry-run you might lose original code.
fix
Run `dbt-autofix --dry-run` before `dbt-autofix --apply`.
affects: all
breakingIn version 0.20.0, the CLI changed from `dbt-autofix` to `dbt-autofix run` or subcommands. Older scripts using the old syntax will break.
fix
Update commands to use `dbt-autofix run` or refer to the new CLI structure. Check `dbt-autofix --help`.
affects: >=0.20.0
deprecatedThe `--config` flag for custom configuration files was deprecated in 0.18.0 and removed in 0.20.0. Use `--project-dir` and custom profiles instead.
fix
Remove `--config` flags; use `--project-dir` for project path and configure via `profiles.yml`.
affects: >=0.20.0
gotchadbt-autofix may incorrectly fix deprecations in macros if macro arguments are not properly handled. Always review diff output.
fix
Manually review any changes to macros after autofix. Use version control to revert if needed.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'dbt_autofix'
The package is a CLI tool and not designed to be imported as a library. This error occurs when trying `import dbt_autofix`.
fix
Use the CLI directly: `pip install dbt-autofix` then run `dbt-autofix` from the command line. Do not import in Python scripts.
Error: Invalid value for '--apply': dbt-autofix: error: no such option: --apply
The `--apply` flag was renamed to `--write` in version 0.20.0. Using outdated flags causes errors.
fix
Replace `--apply` with `--write`. Run `dbt-autofix run --help` for current options.
RuntimeError: dbt project not found. Make sure you are in a dbt project directory.
dbt-autofix must be run from inside a dbt project directory containing dbt_project.yml.
fix
Navigate to your dbt project root (where dbt_project.yml resides) before running dbt-autofix.
Upgrade
Version history
0.20.6latest on PyPI · released Jun 11, 2026
Audit
Dependencies
dbt-corerequiredRequired to parse and compile dbt projects
clickrequiredCLI framework
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
dbt-autofix — pip install dbt-autofix · libregistry