{"id":23520,"library":"dbt-autofix","title":"dbt-autofix","description":"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.","status":"active","version":"0.20.4","language":"python","source_language":"en","source_url":"https://github.com/dbt-labs/dbt-autofix","tags":["dbt","cli","autofix","deprecation","migration"],"install":[{"cmd":"pip install dbt-autofix","lang":"bash","label":"Install from PyPI"},{"cmd":"pip install dbt-autofix==0.20.4","lang":"bash","label":"Pin specific version"}],"dependencies":[{"reason":"Required to parse and compile dbt projects","package":"dbt-core","optional":false},{"reason":"CLI framework","package":"click","optional":false}],"imports":[{"note":"The package is a CLI tool; import is rarely needed. If you use it as a library, import the package directly","wrong":"","symbol":"dbt_autofix","correct":"import dbt_autofix"}],"quickstart":{"code":"pip install dbt-autofix\ncd /path/to/your/dbt/project\n# Run autofix on all models (dry-run first)\ndbt-autofix --dry-run\n# Apply fixes\ndbt-autofix --apply","lang":"bash","description":"Install the tool, navigate to your dbt project directory, run a dry-run to see changes, then apply fixes."},"warnings":[{"fix":"Run `dbt-autofix --dry-run` before `dbt-autofix --apply`.","message":"Always run with --dry-run first. dbt-autofix modifies files in-place; without dry-run you might lose original code.","severity":"gotcha","affected_versions":"all"},{"fix":"Update commands to use `dbt-autofix run` or refer to the new CLI structure. Check `dbt-autofix --help`.","message":"In version 0.20.0, the CLI changed from `dbt-autofix` to `dbt-autofix run` or subcommands. Older scripts using the old syntax will break.","severity":"breaking","affected_versions":">=0.20.0"},{"fix":"Remove `--config` flags; use `--project-dir` for project path and configure via `profiles.yml`.","message":"The `--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.","severity":"deprecated","affected_versions":">=0.20.0"},{"fix":"Manually review any changes to macros after autofix. Use version control to revert if needed.","message":"dbt-autofix may incorrectly fix deprecations in macros if macro arguments are not properly handled. Always review diff output.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use the CLI directly: `pip install dbt-autofix` then run `dbt-autofix` from the command line. Do not import in Python scripts.","cause":"The package is a CLI tool and not designed to be imported as a library. This error occurs when trying `import dbt_autofix`.","error":"ModuleNotFoundError: No module named 'dbt_autofix'"},{"fix":"Replace `--apply` with `--write`. Run `dbt-autofix run --help` for current options.","cause":"The `--apply` flag was renamed to `--write` in version 0.20.0. Using outdated flags causes errors.","error":"Error: Invalid value for '--apply': dbt-autofix: error: no such option: --apply"},{"fix":"Navigate to your dbt project root (where dbt_project.yml resides) before running dbt-autofix.","cause":"dbt-autofix must be run from inside a dbt project directory containing dbt_project.yml.","error":"RuntimeError: dbt project not found. Make sure you are in a dbt project directory."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}