clerk-migrate
БесплатноБез исполняемых скриптовНе проверенMigrate users into Clerk from another auth provider, or between Clerk instances, using the `clerk migrate` command family. Use when the user says "migrate my…
от clerk★ 95 звёзд на GitHubОб этом скилле
Clerk Migrate
clerk migrate export gets users out of an auth platform into a run. clerk migrate import maps that export onto Clerk's user schema, checks every user against the destination instance, and creates them through the Backend API. clerk migrate runs shows what each run did, and clerk migrate undo deletes the users an import created.
clerk migrate export <platform> [-o <path>.json] [-y] [--json]
clerk migrate import <file|export-run-id> [--source <key|path>] [--dry-run] [--allow-partial] [--new-run]
[--require-password] [--skip-legal-checks] [--reserve-unverified] [--yes] [--json]
clerk migrate runs [run-id] [--json]
clerk migrate undo <run-id> [--dry-run] [--yes] [--include-signed-in] [--json]
clerk migrate sources [source] [--json]
clerk migrate help
Every subcommand except sources takes --runs-dir <path>, which overrides the CLERK_MIGRATE_DIR environment variable. import, undo and export clerk also take --secret-key, --app and --instance. Bare clerk migrate prints help.
The binary is the source of truth. Run
clerk migrate <subcommand> --helpto confirm anything this skill claims, and prefer--helpwhen they disagree.
Install nothing and clone nothing.
Routing
| The user wants to… | Go to |
|---|---|
| Get their users out of Auth0, Supabase, Firebase, Auth.js, Better Auth, WorkOS, or Clerk | references/export.md, then the import flow |
| Import a file they already have | The import flow |
| Know which platform a file came from | Step 1: identify the source |
| Migrate from a platform with no built-in source | references/sources.md |
| Move users from one Clerk instance to another (dev → prod) | references/clerk-to-clerk.md |
| See what a run did, or why users failed | references/runs.md |
| Undo an import | Re-running, runs, and undo |
The rules
Every clerk migrate command follows these five rules.
- Consent.
importandundowrite only after--yesor a yes at the prompt. Without either (agent mode, a non-TTY, or--json), they print a preview and exit2with the exact command to run. In agent mode that command is in the stderr JSON,error.examples[].command; with--json, stdout also carries the preview with"consent": "required". A suggested command may hold a--secret-key <key>placeholder: never fill in a real key yourself. --dry-runchecks against the real instance and writes nothing.import --dry-runexits2when the real import would be refused, and0otherwise.undo --dry-runexits0at the preview: readpreview.signedInSince.- One place for state. Every export, import and undo is a run folder,
<runs dir>/<run-id>/. The runs dir is--runs-dir, elseCLERK_MIGRATE_DIR, else<project root>/.clerk/migrate, where the project root is the linked directory, else the git toplevel, else the current directory. The CLI adds.clerk/to.gitignorebefore writing to the default location, because run files hold user data. Dry runs and refused imports write no run. - Target first.
import,undoandexport clerkprint the environment, app and instance they target, and where the key came from. Other exports print the platform they read. With--jsonthe same data is in thetargetfield. --jsoneverywhere. Every subcommand takes it, and it means no prompts.--jsonon anymigratesubcommand also forces agent mode, unless--modeis set.
Exit codes: 0 success, 1 some users failed or any runtime, API or auth error, 2 a usage error or a refusal, 130 interrupted. 0 does not mean every user arrived: skips under --allow-partial still exit 0. Users the run did not send come with 1 (Clerk refused a create, such as the user limit) or 130 (interrupted). Read result.failed, result.skipped, result.notSent and result.pending from import --json. A 130 prints no result: read run.state from clerk migrate runs <run-id> --json, and re-run to continue.
Invoking the CLI
Check the binary once per session:
command -v clerk >/dev/null 2>&1 && clerk migrate sources --json >/dev/null && echo ok
clerk migrate ships in clerk 4.2.0, so an older binary fails this check. If that prints ok, use bare clerk. Otherwise fall back to a package runner matching the project's lockfile: bunx clerk@latest, npx -y clerk@latest, pnpm dlx clerk@latest, or yarn dlx clerk@latest. The published package is clerk, not @clerk/cli.
Keys and targeting
Do not create or edit a .env file. The CLI resolves a Backend API key on its own, from flags, the process environment, the linked project, or (in an unlinked keyless project) the project's .env, .env.local and .clerk/.tmp/keyless.json:
clerk auth
Установить clerk-migrate в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadWriteGrepGlobВложенные файлы
FAQ
Что делает скилл clerk-migrate?
Migrate users into Clerk from another auth provider, or between Clerk instances, using the `clerk migrate` command family. Use when the user says "migrate my users to Clerk", "import users from Auth0 / Supabase / Firebase / Auth.js / Better Auth / WorkOS", "export my users", "move users from development to production", "undo the import", or hands over a user export file (JSON or CSV) and asks what to do with it. Covers exporting from the auth platform, choosing a source, writing one for a platform with no built-in, checking and running the import, inspecting runs, and undoing one. Don't use for adding Clerk to an app (use clerk-setup) or for general CLI tasks (use clerk-cli).
Как установить скилл clerk-migrate?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл clerk-migrate запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic