whatisgithub

What is merlin-dbt?

dgarhdez/merlin-dbt — explained in plain English

Analysis updated 2026-05-18

1PythonAudience · dataComplexity · 2/5LicenseSetup · moderate

In one sentence

merlin is a command line tool that turns a dbt project's manifest.json into a Mermaid flowchart showing how data models connect upstream and downstream.

Mindmap

mindmap
  root((merlin))
    What it does
      Reads manifest.json
      Draws Mermaid diagrams
      Shows model lineage
    Tech stack
      Python
      dbt
      Mermaid
    Use cases
      PR diagrams
      Documentation
      CI automation
    Audience
      Data engineers
      dbt users
    Setup
      Needs dbt compile
      pip or npm install

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add a lineage diagram automatically to every dbt pull request description.

USE CASE 2

Check what will break downstream before changing a dbt model.

USE CASE 3

Generate documentation diagrams showing how sources, models, and snapshots connect.

What is it built with?

PythondbtMermaidCLI

How does it compare?

dgarhdez/merlin-dbta-bissell/unleash-liteabhiinnovates/whatsapp-hr-assistant
Stars111
LanguagePythonPythonPython
Setup difficultymoderatehardhard
Complexity2/54/53/5
Audiencedataresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires an existing dbt project with a compiled manifest.json, so dbt compile must run first.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

So what is it?

merlin is a command-line tool that reads your dbt project's manifest file and produces Mermaid flowchart diagrams showing how your data models are connected. dbt (data build tool) is a popular tool used by data engineers to transform data in warehouses, it creates a manifest.json file that describes all the models, sources, and relationships in a project. Mermaid is a text-based diagram format that GitHub, many documentation tools, and AI assistants can render as visual flowcharts. You run merlin by naming a model and choosing how much of its data lineage (the chain of upstream and downstream dependencies) to include. The pattern +my_model+ shows the model plus everything that feeds into it and everything that depends on it, +my_model shows only upstream ancestors, my_model+ shows only downstream descendants, and my_model alone gives just that one model. Traversal stops at source nodes, which are treated as roots with no further ancestors. The output uses different shapes to distinguish models (rectangles), sources (stadium shapes), seeds, and snapshots (both hexagons), so you can see at a glance what type each node is. The typical use is to pipe the diagram output into a GitHub pull request description so reviewers can immediately see what data dependencies a change affects. A GitHub Actions example in the README shows how to automate this. You can also use the --raw flag to get plain Mermaid syntax for scripting. Requirements are Python 3.10 or later and a dbt project with a current manifest.json generated by running dbt compile. The tool supports dbt Core 1.0 and later.

Copy-paste prompts

Prompt 1
Write a GitHub Actions step that runs merlin on the model I just changed and posts the diagram as a PR comment.
Prompt 2
Show me how to install merlin-dbt with pip and run it against my dbt project's target directory.
Prompt 3
Explain the difference between running merlin +my_model, my_model+, and +my_model+ on a dbt model.
Prompt 4
Help me set up dbt compile in CI so merlin always has a fresh manifest.json before generating a lineage diagram.

Frequently asked questions

What is merlin-dbt?

merlin is a command line tool that turns a dbt project's manifest.json into a Mermaid flowchart showing how data models connect upstream and downstream.

What language is merlin-dbt written in?

Mainly Python. The stack also includes Python, dbt, Mermaid.

What license does merlin-dbt use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is merlin-dbt to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is merlin-dbt for?

Mainly data.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.