Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. dbt docs generate and serve

dbt · Testing & Documentation

dbt docs generate and serve

Easydbt-17
docsdocumentationlineagecatalog

Question

What do dbt docs generate and dbt docs serve do?

Solution

dbt can build a static documentation site from your project: model descriptions, columns, tests, and the lineage DAG.

dbt docs generate

1. Introspects the warehouse (optional catalog) and project manifest. 2. Writes target/manifest.json, target/catalog.json, and related artifacts. 3. Produces the docs site assets under target/.

dbt docs generate

dbt docs serve

Starts a local web server so you can browse the docs UI (search models, click lineage).

dbt docs serve

What good docs look like

YAML descriptions on models/columns, plus {{ doc('order_status') }} blocks for longer markdown:

models:
  - name: fct_orders
    description: One row per completed order at order grain.
    columns:
      - name: order_id
        description: Primary key from the orders system.

Mental model

YAML descriptions + tests + refs
        |
 dbt docs generate
        |
 static site + lineage graph
        |
 dbt docs serve / hosted docs

Interview tip: Docs are not optional fluff. Interviewers like hearing that you document grain, keys, and caveats so analysts stop reverse-engineering SQL.

PreviousNext