Introducing the dbdiagram CLI

You can now work with both dbdiagram and dbdocs from a single command line. The dbdiagram CLI syncs your local .dbml files with your diagrams and publishes documentation to dbdocs.io — from your terminal or CI pipeline, no app needed.

Keep your schema in version control, push it to update the diagram, and pull to bring web edits back into your repo.

What’s new:

  • Sync diagrams both ways with push and pull — schema and table positions included
  • Publish docs to dbdocs.io with build document
  • Set up once with init — later commands run without repeating flags
  • Automate updates in CI with a DBDIAGRAM_TOKEN, no browser login needed

Example:

npm install -g dbdiagram
dbdiagram auth login
dbdiagram init --entry schema.dbml --diagram-id <id>

dbdiagram push # local DBML → update the diagram
dbdiagram pull # diagram → update local DBML

RunSQL support is coming next, so you’ll design diagrams, publish docs, and test SQL queries from one CLI.

:books: Learn more →

Please give this feature a try and let us know what you think.
From dbx team with :heart: