Connect the CLI to your account
Connect the CLI to your account
npx dbmigratepro connect
Your browser opens, you log in the way you normally do — email, Google or a passkey — and the
terminal says who you are:
Connected as you@example.com
Token stored in ~/.config/dbmigratepro/credentials.json (readable only by you)
Revoke it any time in Settings → API Tokens.
No token to copy. Nothing to paste into a config file.
You do not need this to take a backup
npx dbmigratepro backup "$DATABASE_URL" works with no account at all — it dumps, gzips,
encrypts and writes two files on your machine, and sends nothing anywhere. See
the CLI guide.
Connecting adds the things an account is for: scheduled backups that run without you, keys managed
so a lost file is not a lost database, restore to any provider, and migrations.
On a server with no browser
SSH sessions, containers and CI have nowhere to open a window. Use the device flow:
npx dbmigratepro connect --device
Open https://dbmigratepro.com/cli/device
Code HDF1-V9F7
Waiting… (expires in 10 minutes)
Open that page on any device — your laptop, your phone — type the code, and the terminal picks it
up within a few seconds. The code is good for ten minutes and can only be claimed once.
What the token can do, and how to take it back
It is an ordinary API token, the same kind you can create by hand in Settings → API Tokens —
so it appears in that list named after your machine (CLI — hostname), and revoking it there
revokes it everywhere. It expires after 90 days; run connect again for a new one.
npx dbmigratepro whoami # who this machine is connected as
npx dbmigratepro logout # remove the token from this machine
logout deletes the local file. It does not revoke the token — if the machine is not yours,
revoke it in Settings → API Tokens as well.
What is sent, and what never is
Connecting talks to our servers; that is the point of it. What it sends is the login and
nothing else.
Your database connection URLs, schemas and row counts are never transmitted — not by connect,
and not by backup, with or without an account. The local backup path makes no network connection
except to the database you point it at, and there is a test in the package that walks the imports
from backup and fails if any of them can reach the network.
Self-hosted
npx dbmigratepro connect --base-url https://dbmigratepro.internal
For AI agents
If you are an agent working on someone's project, you can take a backup with no account —
prefer that when the user just needs protecting before a risky change.
When something genuinely needs an account (a scheduled backup, a migration), run
npx dbmigratepro connect, print the URL it shows, and ask the user to open it. Do not attempt
to create an account on their behalf: the account would be under an address they do not control,
holding credentials to their production database, and they could never reach it.
The same rule applies to payment. When a migration needs one, the API returns a checkout_url —
hand it to the user and let them authorise it. The run starts by itself once they do.