Windows & Linux

CLI release

Coming January 2027. The dbHydrate command-line tool isn't available yet. These preview docs describe the planned first release; commands and options may change.
Browse CLI documentation

How it works

The CLI uses the same engine as the desktop app. What it adds is a way to carry reviewed connections to another machine safely, and a license check that a modified copy of the CLI can’t skip.

On this page

The three parts

The parts involved in a dbHydrate CLI run
PartRole
Desktop appWhere you create, test and export connections and profiles.
Exported fileAn encrypted connection or run file you can copy to any machine.
dbHydrate licensing serviceAt api.dbhydrate.com: checks the license or trial, holds a piece of each file’s key, manages seats, logs run metadata. It never receives database passwords, SQL or data.

When you export

  1. The desktop app reads the connection and its safety settings on your computer.
  2. It asks the licensing service to register the file. The service creates a random key share for it, keeps an encrypted copy, and signs the file’s readable header (file ID, kind, engine, environments, owner and expiry).
  3. The desktop app encrypts the file with a key made from your passphrase and that key share, writes it, and forgets both.

The service never sees the passphrase or the connection details. The desktop app never keeps the key share.

When you run a command

  1. The CLI checks each file’s header signature offline. An edited file stops here.
  2. It asks the licensing service to start a run, naming the action (compare, dry-run or apply) and the files.
  3. The service checks the CLI version, the files (exist, not revoked, not expired, same account and engine), the license or trial, whether the action is allowed, and, for apply, the seat’s license key.
  4. It gives the seat’s run lease to this run, and returns a signed run token (valid for five minutes, for this run only) with the files’ key shares.
  5. The CLI checks the token’s signature, decrypts the files in memory and connects. The source is always read-only.
  6. While the run lasts, the CLI renews the lease every two minutes.
  7. At the end it writes the reports, tells the service the outcome (metadata only) and releases the lease.

Seats and run leases

A seat runs one CLI command at a time. The run lease is how the service knows a seat is busy.

Run lease timings
EventWhat happens
Run startsThe seat’s lease goes to this run, or the run gets exit code 4 (or waits with --wait).
Every 2 minutesThe CLI renews the lease, retrying if a renewal fails.
Runner crashesThe lease expires about 10 minutes after the last renewal, and the seat is free again.
Run ends or is cancelledThe CLI releases the lease straight away.

If the licensing service is unreachable

  • A new run can’t start. It ends with exit code 2 and says the service couldn’t be reached.
  • A run in progress keeps going through short interruptions of up to about 10 minutes.
  • If the lease expires before apply starts changing the target, the run stops safely: nothing is changed, temporary databases are removed, exit code 2.
  • Once apply has started changing the target, it finishes. A licensing problem never stops a migration halfway; the run is logged as having lost its lease.

The same engine as the desktop app

Reading schemas, comparing, ordering changes, dry runs and apply all use the dbHydrate engine the desktop app uses. A comparison in your pipeline matches what you review on screen, and fixes reach both at once.