Designs from the CLI
The dockito CLI keeps a design and a repo’s schema file in step, both ways. Install it first. Every command is also on CLI commands.
Publish
Section titled “Publish”A .dbml or .sql file becomes a design. Publishing it again makes the next version, and History shows what changed.
dockito publish schema.dbml --to book-clubdockito publish db/schema.sql --to book-clubFrom an ORM, through its own tool in your project (prisma migrate diff, drizzle-kit export, or the migrations it wrote). Only the SQL is sent:
dockito publish --from prisma # prisma/schema.prisma as a designdockito publish --from drizzlepull writes a design to a file your repo keeps, exactly as stored, so publishing it back changes nothing. --sql writes CREATE statements instead.
dockito pull <design> # schema.dbmldockito pull <design> db/schema.sql --sql postgresdb pull reads a live PostgreSQL or MySQL database’s schema into a .dbml file. It runs one read-only catalog query through the database’s own client (psql, mysql), so the connection and its password never leave your machine.
dockito db pull postgres://me@localhost:5432/bookclubdockito db query mysql # print the query, to run in any clientdockito db pull --catalog answer.jsoncheck lists every problem in a design, or in a local file without sending it, errors first, each with its fix. It exits 1 on errors.
dockito check schema.dbmldockito check <design> --tables orders,payments --level warningdockito check <design> --rules fk-no-index --ignored--doc compares a file with a design too, and exits 2 when they differ.
Change
Section titled “Change”edit-db changes a design with ops at the version you read, as your AI does. Read it first with dockito get <design>.
dockito get <design> --outlineecho '[{"op": "index", "table": "payments", "cols": ["invoice_id"]}]' | dockito edit-db <design> - --base 14changes gives what changed since a version, a line a table, then the migration SQL. Review it before you run it.
dockito changes <design> --since 12 --sql postgresSo a pull request can’t break the schema or let it drift from the design. This GitHub Actions step fails on errors (exit 1) and when the file differs from the design (exit 2):
- run: npm install -g dockito- run: dockito check schema.dbml --doc <design> env: DOCKITO_TOKEN: ${{ secrets.DOCKITO_TOKEN }}Without --doc no token is needed: the file is checked on the runner. Make the token in Tokens with View access.