@schemat/cli
v0.2.1
Published
Git-native database schema documentation — live interactive ER diagrams from your repo.
Maintainers
Readme
@schemat/cli
The schemat command — git-native database schema documentation with live,
interactive ER diagrams. Part of Schemat.
Install
npm i -g @schemat/cli # then: schemat <command>
# or one-off:
npx @schemat/cli devCommands
All commands take -r, --root <dir> (defaults to .). Point it at a project
whose schema Schemat can read: Prisma, Drizzle, TypeORM, MikroORM, Mongoose,
Sequelize, DBML, or SQL DDL. The source is auto-detected; -s, --source
<parser> forces one when detection is wrong or ambiguous.
schemat dev
Serve a live, auto-reloading ER diagram.
schemat dev -r . -p 5173Opens http://localhost:5173. Edit your schema file and the canvas reloads.
schemat export
Write a static diagram you can commit.
schemat export -f svg # -> schema.svg
schemat export -f mermaid -o db.mmd # -> db.mmd (Mermaid erDiagram)schemat snapshot
Freeze the current schema for drift checks.
schemat snapshot # -> .schemat/schema.snapshot.json (commit this)schemat check
Fail (exit 1) if the live schema drifted from the committed snapshot. For CI.
schemat check # text output
schemat check -f markdown # PR-comment formatDon't pipe
checkthroughtail/headin CI — that masks the exit code.
schemat diff
Structural diff between two schema sources (dirs or .prisma / .sql files).
schemat diff before.prisma after.prisma
schemat diff before/ after/ -f jsonCI
Use the bundled GitHub Action to gate PRs on schema drift — see the main README.
License
MIT © Ali Reza Hamid
