Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
271474d
feat(migrate): add migration command suite
royanger Aug 6, 2026
f32b73f
test(migrate): support multiselect prompt stubs
royanger Aug 6, 2026
9a56d9f
docs(migrate): mention migration command
royanger Aug 6, 2026
080eb66
docs(changeset): add migrate changeset
royanger Aug 6, 2026
d94307e
refactor(migrate): keep migration state in the CLI config, not a cwd …
royanger Aug 6, 2026
2f22633
feat(migrate): add `clerk migrate settings`, and resolve migration en…
royanger Aug 6, 2026
194d8f6
feat(migrate): explain each setting in `migrate settings`, and fix th…
royanger Aug 6, 2026
909003b
feat(migrate): move the Supabase scope of `skip-unsupported-providers…
royanger Aug 6, 2026
922890a
feat(migrate): wrap the logs and transformers subcommands in the gutter
royanger Aug 6, 2026
05b6536
feat(migrate): follow the CLI's spinner, next-steps, pluralization an…
royanger Aug 6, 2026
68c7057
feat(prompts): advertise select-all in the multiselect footer
royanger Aug 6, 2026
e9a6692
feat(migrate): offer to fix the settings the readiness report flags
royanger Aug 6, 2026
18cef5e
feat(migrate): document `clerk migrate` rather than `clerk migrate run`
royanger Aug 6, 2026
85afd33
fix(migrate): read the Firebase hash parameters only when the transfo…
royanger Aug 6, 2026
a38470f
Merge branch 'main' into ra/integrate-migration-tool-into-cli
royanger Aug 17, 2026
3a667d7
chore: ignore local migration exports and service account keys
royanger Aug 18, 2026
829d979
fix(config): persist the migration entry to disk
royanger Aug 18, 2026
9a96503
refactor(migrate)!: rename `migrate run` to `migrate import`, drop --…
royanger Aug 18, 2026
35c2b09
feat(migrate): timestamp export filenames and ask where to save
royanger Aug 18, 2026
5a16189
feat(migrate): URL-encode credentials pasted into a connection string
royanger Aug 18, 2026
8f374a9
feat(migrate): choose the Clerk export source from a flat instance list
royanger Aug 18, 2026
f077786
feat(migrate): prompt for the Firebase service account key
royanger Aug 18, 2026
f0ba767
refactor(migrate): restyle `clerk migrate transformers list`
royanger Aug 18, 2026
aa62b62
refactor(migrate): name log files after the commands that write them
royanger Sep 8, 2026
b1fec90
refactor: move the redaction placeholder into constants
royanger Sep 8, 2026
f9c0b08
feat(migrate): accept Firebase's own variable names and restyle setti…
royanger Sep 8, 2026
bcce90a
Merge branch 'main' into ra/integrate-migration-tool-into-cli
royanger Sep 8, 2026
bf4d6ed
fix(cli): name the host when a request cannot connect
royanger Sep 11, 2026
1c029c8
feat(migrate): ask once where migration logs go, and remember it
royanger Sep 11, 2026
9900266
feat(migrate): clear one setting by name
royanger Sep 11, 2026
0f35744
fix(migrate): warn instead of refusing when an import may exceed the …
royanger Sep 11, 2026
0faebbc
feat(migrate): sign in and link before an import starts
royanger Sep 11, 2026
4bf8048
feat(migrate): accept libsql/Turso connection strings
royanger Sep 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/migrate-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"clerk": minor
---

Add `clerk migrate` for importing users with `migrate import`, exporting from supported auth providers, reviewing migration logs, undoing a migration, and extending imports with custom transformers.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ coverage

# logs
logs
!packages/cli-core/src/commands/migrate/logs/
!packages/cli-core/src/commands/migrate/logs/**
_.log
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

Expand Down Expand Up @@ -44,3 +46,7 @@ test/e2e/.har

# Local planning/spec docs
docs/superpowers/

# Local migration exports and the credentials that produced them
exports/
*service-account*.json
4 changes: 3 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Default to using Bun instead of Node.js.
- `Bun.serve()` supports WebSockets, HTTPS, and routes. Don't use `express`.
- `bun:sqlite` for SQLite. Don't use `better-sqlite3`.
- `Bun.redis` for Redis. Don't use `ioredis`.
- `Bun.sql` for Postgres. Don't use `pg` or `postgres.js`.
- `Bun.sql` for Postgres and MySQL. Don't use `pg`, `postgres.js`, or `mysql2`.
- `WebSocket` is built-in. Don't use `ws`.
- Prefer `Bun.file` over `node:fs`'s readFile/writeFile
- Bun.$`ls` instead of execa.
Expand All @@ -56,6 +56,8 @@ When running multiple test files directly with `bun test`, always pass `--isolat

These flags require Bun >= 1.3.13 — older versions silently ignore them and lose isolation. `bun run test` and `bun run test:e2e` run `scripts/check-bun-version.ts` first, which fails fast when the installed Bun is older than the `engines.bun` floor in package.json.

The same floor also covers `Bun.sql`'s MySQL adapter used by the DB-backed export commands: MySQL support landed in Bun 1.2.21, but binary columns (password hashes) only decoded correctly from 1.3.6. See the header of `scripts/check-bun-version.ts`.

## Versioning

The `CLI_VERSION` global is injected at compile time via `bun build --compile --define "CLI_VERSION=..."`. The CI release workflow injects the real version.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Commands:
init [options] Initialize Clerk in your project
link [options] Link this project to a Clerk application
mcp Manage the Clerk remote MCP server connection for AI editors and CLIs
migrate Migrate users into Clerk from another auth provider
open Open Clerk resources in your browser
telemetry Control CLI usage telemetry (status, disable, enable)
unlink [options] Unlink this project from its Clerk application
Expand Down
139 changes: 65 additions & 74 deletions bun.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion packages/cli-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
"@commander-js/extra-typings": "^15.0.0",
"@napi-rs/keyring": "^1.3.0",
"commander": "^15.0.0",
"csv-parser": "^3.2.1",
"env-paths": "^4.0.0",
"external-editor": "^3.1.0",
"magicast": "^0.5.3",
"semver": "^7.8.5",
"yaml": "^2.9.0"
"yaml": "^2.9.0",
"zod": "^4.4.3"
},
"devDependencies": {
"@clerk/shared": "^4.29.1",
Expand Down
2 changes: 2 additions & 0 deletions packages/cli-core/src/cli-program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { registerCompletion } from "./commands/completion/index.ts";
import { registerUpdate } from "./commands/update/index.ts";
import { registerDeploy } from "./commands/deploy/index.ts";
import { registerWebhooks } from "./commands/webhooks/index.ts";
import { registerMigrate } from "./commands/migrate/index.ts";
import { getEnvironment } from "./lib/config.ts";
import {
setCurrentEnv,
Expand Down Expand Up @@ -83,6 +84,7 @@ const registrants: CommandRegistrant[] = [
registerUpdate,
registerDeploy,
registerWebhooks,
registerMigrate,
registerExtras,
];

Expand Down
1,157 changes: 1,157 additions & 0 deletions packages/cli-core/src/commands/migrate/README.md

Large diffs are not rendered by default.

Loading
Loading