dbt · Testing & Documentation

dbt docs generate and serve

Easydocsdocumentationlineagecatalog

Interview question

What do dbt docs generate and dbt docs serve do?

How to answer

The short answer

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

dbt docs generate

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

dbt docs serve

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

Shell
dbt docs serve

What good docs look like

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

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

Mental model

Output
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.