Skip to main content

Scaffold production-ready dbt projects with opinionated defaults

Project description

dbt-forge

dbt-forge is a Python CLI for scaffolding opinionated dbt projects with a consistent layout, starter models, adapter-specific profiles, and optional CI / SQLFluff setup. The project is currently in its 0.3.x alpha phase.

Features

  • src/-packaged Python CLI built on Typer and Rich
  • Interactive or default-driven project generation
  • Adapter templates for BigQuery, Snowflake, PostgreSQL, DuckDB, Databricks, Redshift, Trino, and Spark
  • 11 add subcommands for extending an existing dbt project: mart, source, snapshot, seed, exposure, macro, pre-commit, ci, model, test, package
  • doctor command with 10 project health checks, --fix auto-repair, and --ci mode
  • status command — Rich terminal dashboard showing model counts by layer, test/doc coverage, sources, and packages
  • update command — re-apply dbt-forge templates with unified diffs and per-file accept/skip
  • Custom presets via --preset flag — YAML files with defaults and locked fields for team standardization
  • add model auto-detects existing sources from YAML files for staging layer selection
  • add test supports schema tests (column-level in .yml) in addition to data and unit tests
  • add package generates package-specific vars in dbt_project.yml (e.g., elementary, dbt-project-evaluator)
  • Optional pre-commit hooks, SQLFluff config, .editorconfig, and CI templates
  • Environment config scaffolding: generate_schema_name macro and adapter-specific .env.example
  • CODEOWNERS file generation with mart-based ownership mapping
  • Curated package registry with 20 dbt packages and known-good version ranges
  • Generated .env support so local dbt commands resolve profiles/ consistently

Install

pip install dbt-forge

Or with uv:

uv tool install dbt-forge

Quickstart

dbt-forge init

For a non-interactive scaffold:

dbt-forge init my_dbt_project --defaults

Add components inside an existing dbt project:

dbt-forge add mart finance
dbt-forge add source salesforce
dbt-forge add snapshot orders
dbt-forge add seed dim_country
dbt-forge add exposure weekly_revenue
dbt-forge add macro cents_to_dollars
dbt-forge add pre-commit
dbt-forge add ci github
dbt-forge add model users
dbt-forge add test stg_orders
dbt-forge add package dbt-utils

Run health checks on an existing project:

dbt-forge doctor
dbt-forge doctor --fix
dbt-forge doctor --ci
dbt-forge doctor --check naming-conventions

View project stats and update templates:

dbt-forge status
dbt-forge update --dry-run
dbt-forge update

Manage presets:

dbt-forge preset validate company-standard.yml
dbt-forge init my_project --preset company-standard.yml

Supported Python

  • Python 3.11
  • Python 3.12
  • Python 3.13

Local Development

cd cli
uv sync --all-groups
uv run pre-commit install --hook-type commit-msg
uv run ruff check .
uv run pytest
uv build
uvx twine check dist/*

Commit Messages

This repo uses Conventional Commits. Every commit message must start with a type such as:

  • feat: add databricks profile scaffolding
  • fix: handle missing target directory
  • chore: refresh release workflow

The local commit-msg hook enforces this after you run:

uv run pre-commit install --hook-type commit-msg

Release Process

The package publishes from GitHub Actions on v* tags. The website in this repo is supporting docs/marketing and is not a separately versioned release artifact.

From the repository root:

python3 scripts/release_assistant.py prepare 0.3.0
python3 scripts/release_assistant.py verify 0.3.0
python3 scripts/release_assistant.py publish 0.3.0 --confirm

prepare stages the version and changelog updates. verify is the release gate and requires a clean main branch aligned with origin/main. publish dispatches the TestPyPI preflight, waits for manual confirmation, then tags and creates the GitHub Release.

For the detailed checklist and publish prerequisites, see RELEASING.md.

Publishing Setup

  • Public repo: maroil/dbt-forge
  • Configure GitHub environments named pypi and testpypi
  • Register the GitHub repo as a Trusted Publisher in PyPI and TestPyPI

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbt_forge-0.3.0.tar.gz (57.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbt_forge-0.3.0-py3-none-any.whl (66.3 kB view details)

Uploaded Python 3

File details

Details for the file dbt_forge-0.3.0.tar.gz.

File metadata

  • Download URL: dbt_forge-0.3.0.tar.gz
  • Upload date:
  • Size: 57.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dbt_forge-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9ce69a20204d3a50e5eb4622678025355a194359cbe79a9ed7796affdf84ff92
MD5 4ef450d6bef323ff98987d7dfed95a02
BLAKE2b-256 3b6445b5c5f5208c3ff30fb20c102b636add3fb62e1bfdd0427298032471c22d

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbt_forge-0.3.0.tar.gz:

Publisher: release.yml on maroil/dbt-forge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dbt_forge-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: dbt_forge-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 66.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dbt_forge-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8cdd0d9d69375ebc6a0a721bd46d6f2b748c8a72e0c9d6ec98fc393fc136d6c5
MD5 9286af8e80edf39968838b1b1e4b78e7
BLAKE2b-256 a0d2135bb2fe72ad22377af2b643b94a81ad3a200328ac8f42022bcaeabc74be

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbt_forge-0.3.0-py3-none-any.whl:

Publisher: release.yml on maroil/dbt-forge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page