Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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> --help to confirm anything this skill claims, and prefer --help when 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.

  1. Consent. import and undo write only after --yes or a yes at the prompt. Without either (agent mode, a non-TTY, or --json), they print a preview and exit 2 with 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.
  2. --dry-run checks against the real instance and writes nothing. import --dry-run exits 2 when the real import would be refused, and 0 otherwise. undo --dry-run exits 0 at the preview: read preview.signedInSince.
  3. One place for state. Every export, import and undo is a run folder, <runs dir>/<run-id>/. The runs dir is --runs-dir, else CLERK_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 .gitignore before writing to the default location, because run files hold user data. Dry runs and refused imports write no run.
  4. Target first. import, undo and export clerk print the environment, app and instance they target, and where the key came from. Other exports print the platform they read. With --json the same data is in the target field.
  5. --json everywhere. Every subcommand takes it, and it means no prompts. --json on any migrate subcommand also forces agent mode, unless --mode is 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
Полный SKILL.md на GitHub

Установить clerk-migrate в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash
Read
Write
Grep
Glob

Вложенные файлы

references/checks.mdreferences/clerk-to-clerk.mdreferences/export.mdreferences/runs.mdreferences/sources.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить clerk-migrate с