claudekit-cli 3.36.0 → 3.37.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -10971,6 +10971,16 @@ var init_fm_to_yaml = __esm(() => {
10971
10971
  });
10972
10972
 
10973
10973
  // src/commands/portable/provider-registry.ts
10974
+ var exports_provider_registry = {};
10975
+ __export(exports_provider_registry, {
10976
+ providers: () => providers,
10977
+ getProvidersSupporting: () => getProvidersSupporting,
10978
+ getProviderConfig: () => getProviderConfig,
10979
+ getPortableInstallPath: () => getPortableInstallPath,
10980
+ getAllProviderTypes: () => getAllProviderTypes,
10981
+ detectProviderPathCollisions: () => detectProviderPathCollisions,
10982
+ detectInstalledProviders: () => detectInstalledProviders
10983
+ });
10974
10984
  import { existsSync, readdirSync, statSync } from "node:fs";
10975
10985
  import { homedir } from "node:os";
10976
10986
  import { join } from "node:path";
@@ -10994,6 +11004,12 @@ function hasInstallSignal(path) {
10994
11004
  function hasAnyInstallSignal(paths) {
10995
11005
  return paths.some((path) => hasInstallSignal(path));
10996
11006
  }
11007
+ function getAllProviderTypes() {
11008
+ return Object.keys(providers);
11009
+ }
11010
+ function getProviderConfig(type) {
11011
+ return providers[type];
11012
+ }
10997
11013
  async function detectInstalledProviders() {
10998
11014
  const installed = [];
10999
11015
  for (const [type, config] of Object.entries(providers)) {
@@ -11006,6 +11022,19 @@ async function detectInstalledProviders() {
11006
11022
  function getProvidersSupporting(type) {
11007
11023
  return Object.entries(providers).filter(([, config]) => config[type] != null).map(([name]) => name);
11008
11024
  }
11025
+ function getPortableInstallPath(itemName, provider, portableType, options2) {
11026
+ const config = providers[provider];
11027
+ const pathConfig = config[portableType];
11028
+ if (!pathConfig)
11029
+ return null;
11030
+ const basePath = options2.global ? pathConfig.globalPath : pathConfig.projectPath;
11031
+ if (!basePath)
11032
+ return null;
11033
+ if (pathConfig.writeStrategy === "merge-single" || pathConfig.writeStrategy === "yaml-merge" || pathConfig.writeStrategy === "json-merge" || pathConfig.writeStrategy === "single-file") {
11034
+ return basePath;
11035
+ }
11036
+ return join(basePath, `${itemName}${pathConfig.fileExtension}`);
11037
+ }
11009
11038
  function detectProviderPathCollisions(selectedProviders, options2) {
11010
11039
  const portableTypes = ["agents", "commands", "skills", "config", "rules", "hooks"];
11011
11040
  const collisions = [];
@@ -12185,6 +12214,18 @@ function isUnknownChecksum(checksum) {
12185
12214
  var UNKNOWN_CHECKSUM = "unknown";
12186
12215
 
12187
12216
  // src/commands/portable/portable-registry.ts
12217
+ var exports_portable_registry = {};
12218
+ __export(exports_portable_registry, {
12219
+ writePortableRegistry: () => writePortableRegistry,
12220
+ updateAppliedManifestVersion: () => updateAppliedManifestVersion,
12221
+ syncPortableRegistry: () => syncPortableRegistry,
12222
+ removePortableInstallation: () => removePortableInstallation,
12223
+ removeInstallationsByFilter: () => removeInstallationsByFilter,
12224
+ readPortableRegistry: () => readPortableRegistry,
12225
+ getInstallationsByType: () => getInstallationsByType,
12226
+ findPortableInstallations: () => findPortableInstallations,
12227
+ addPortableInstallation: () => addPortableInstallation
12228
+ });
12188
12229
  import { existsSync as existsSync2 } from "node:fs";
12189
12230
  import { mkdir, readFile as readFile2, rename, unlink, writeFile } from "node:fs/promises";
12190
12231
  import { homedir as homedir3 } from "node:os";
@@ -12444,6 +12485,9 @@ function findPortableInstallations(registry, item, type, provider, global2) {
12444
12485
  return true;
12445
12486
  });
12446
12487
  }
12488
+ function getInstallationsByType(registry, type) {
12489
+ return registry.installations.filter((i) => i.type === type);
12490
+ }
12447
12491
  async function updateAppliedManifestVersion(version) {
12448
12492
  await withRegistryLock(async () => {
12449
12493
  const registry = await readPortableRegistry();
@@ -42177,7 +42221,7 @@ var init_claudekit_data = __esm(() => {
42177
42221
  });
42178
42222
 
42179
42223
  // src/types/ck-config.ts
42180
- var PlanValidationModeSchema, PlanFocusAreaSchema, PlanResolutionOrderSchema, ProjectTypeSchema, PackageManagerSchema, FrameworkSchema, GeminiModelSchema, StatuslineModeSchema, CodingLevelSchema, PlanResolutionSchema, PlanValidationSchema, CkPlanConfigSchema, CkDocsConfigSchema, CkPathsConfigSchema, CkLocaleConfigSchema, CkTrustConfigSchema, CkProjectConfigSchema, CkGeminiConfigSchema, CkSkillsConfigSchema, ResolvedModelConfigSchema, ModelTierMapSchema, CkModelTaxonomySchema, CkAssertionSchema, CkHooksConfigSchema, CkConfigSchema, DEFAULT_CK_CONFIG, CK_HOOK_NAMES;
42224
+ var PlanValidationModeSchema, PlanFocusAreaSchema, PlanResolutionOrderSchema, ProjectTypeSchema, PackageManagerSchema, FrameworkSchema, GeminiModelSchema, StatuslineModeSchema, CodingLevelSchema, PlanResolutionSchema, PlanValidationSchema, CkPlanConfigSchema, CkDocsConfigSchema, CkPathsConfigSchema, CkLocaleConfigSchema, CkTrustConfigSchema, CkProjectConfigSchema, CkGeminiConfigSchema, CkSkillsConfigSchema, UpdatePipelineSchema, ResolvedModelConfigSchema, ModelTierMapSchema, CkModelTaxonomySchema, CkAssertionSchema, CkHooksConfigSchema, CkConfigSchema, DEFAULT_CK_CONFIG, CK_HOOK_NAMES;
42181
42225
  var init_ck_config = __esm(() => {
42182
42226
  init_zod();
42183
42227
  PlanValidationModeSchema = exports_external.enum(["prompt", "auto", "strict", "none"]);
@@ -42270,6 +42314,11 @@ var init_ck_config = __esm(() => {
42270
42314
  useGemini: exports_external.boolean().optional()
42271
42315
  }).passthrough().optional()
42272
42316
  }).passthrough();
42317
+ UpdatePipelineSchema = exports_external.object({
42318
+ autoInitAfterUpdate: exports_external.boolean().default(false),
42319
+ autoMigrateAfterInit: exports_external.boolean().default(false),
42320
+ migrateProviders: exports_external.union([exports_external.literal("auto"), exports_external.array(exports_external.string())]).default("auto")
42321
+ });
42273
42322
  ResolvedModelConfigSchema = exports_external.object({
42274
42323
  model: exports_external.string(),
42275
42324
  effort: exports_external.string().optional()
@@ -42312,6 +42361,7 @@ var init_ck_config = __esm(() => {
42312
42361
  skills: CkSkillsConfigSchema.optional(),
42313
42362
  assertions: exports_external.array(CkAssertionSchema).optional(),
42314
42363
  hooks: CkHooksConfigSchema.optional(),
42364
+ updatePipeline: UpdatePipelineSchema.optional(),
42315
42365
  modelTaxonomy: CkModelTaxonomySchema.optional()
42316
42366
  }).passthrough();
42317
42367
  DEFAULT_CK_CONFIG = {
@@ -42374,6 +42424,11 @@ var init_ck_config = __esm(() => {
42374
42424
  "scout-block": true,
42375
42425
  "privacy-block": true,
42376
42426
  "post-edit-simplify-reminder": true
42427
+ },
42428
+ updatePipeline: {
42429
+ autoInitAfterUpdate: false,
42430
+ autoMigrateAfterInit: false,
42431
+ migrateProviders: "auto"
42377
42432
  }
42378
42433
  };
42379
42434
  CK_HOOK_NAMES = [
@@ -48320,6 +48375,31 @@ var init_ck_config_schema = __esm(() => {
48320
48375
  },
48321
48376
  additionalProperties: false
48322
48377
  },
48378
+ updatePipeline: {
48379
+ type: "object",
48380
+ description: "Auto-chaining behavior for update -> init -> migrate pipeline",
48381
+ properties: {
48382
+ autoInitAfterUpdate: {
48383
+ type: "boolean",
48384
+ default: false,
48385
+ description: "Automatically run ck init after ck update when kit has new version"
48386
+ },
48387
+ autoMigrateAfterInit: {
48388
+ type: "boolean",
48389
+ default: false,
48390
+ description: "Automatically run ck migrate after ck init for detected providers"
48391
+ },
48392
+ migrateProviders: {
48393
+ oneOf: [
48394
+ { type: "string", const: "auto" },
48395
+ { type: "array", items: { type: "string" } }
48396
+ ],
48397
+ default: "auto",
48398
+ description: "Which providers to auto-migrate. 'auto' scans filesystem."
48399
+ }
48400
+ },
48401
+ additionalProperties: false
48402
+ },
48323
48403
  modelTaxonomy: {
48324
48404
  type: "object",
48325
48405
  description: "Custom model mappings for portable migration. Keys are provider names (e.g., 'codex', 'gemini-cli'), values map tiers to model config.",
@@ -56495,6 +56575,11 @@ function isUpdateCheckDisabled() {
56495
56575
  function normalizeVersion(version) {
56496
56576
  return version.replace(/^v/i, "");
56497
56577
  }
56578
+ function isPrereleaseVersion(version) {
56579
+ if (!version)
56580
+ return false;
56581
+ return /-(beta|alpha|rc|dev)[.\d]/i.test(normalizeVersion(version));
56582
+ }
56498
56583
  function parseVersionParts(version) {
56499
56584
  const normalized = normalizeVersion(version);
56500
56585
  const [base, ...prereleaseParts] = normalized.split("-");
@@ -56639,7 +56724,7 @@ var package_default;
56639
56724
  var init_package = __esm(() => {
56640
56725
  package_default = {
56641
56726
  name: "claudekit-cli",
56642
- version: "3.36.0",
56727
+ version: "3.37.0-dev.1",
56643
56728
  description: "CLI tool for bootstrapping and updating ClaudeKit projects",
56644
56729
  type: "module",
56645
56730
  repository: {
@@ -56655,6 +56740,10 @@ var init_package = __esm(() => {
56655
56740
  },
56656
56741
  files: [
56657
56742
  "bin/ck.js",
56743
+ "bin/ck-linux-x64",
56744
+ "bin/ck-darwin-arm64",
56745
+ "bin/ck-darwin-x64",
56746
+ "bin/ck-win32-x64.exe",
56658
56747
  "dist/index.js",
56659
56748
  "dist/ui/"
56660
56749
  ],
@@ -56668,6 +56757,7 @@ var init_package = __esm(() => {
56668
56757
  "compile:binary": "bun run ui:build && bun run scripts/compile-binary.ts --outfile bin/ck && cp bin/ck /usr/local/bin/ck && echo '✅ Installed globally: /usr/local/bin/ck'",
56669
56758
  "compile:binaries": "node scripts/build-all-binaries.js",
56670
56759
  "check-version-sync": "node scripts/check-binary-version-sync.js",
56760
+ "verify:package": "node scripts/prepublish-check.js",
56671
56761
  "build:platform-binaries": "bun run scripts/build-platform-binaries.js",
56672
56762
  test: "bun test",
56673
56763
  "test:integration": "CK_RUN_CLI_INTEGRATION=1 bun test tests/integration/cli.test.ts",
@@ -57959,9 +58049,7 @@ function buildInitCommand(isGlobal, kit, beta) {
57959
58049
  return parts.join(" ");
57960
58050
  }
57961
58051
  function isBetaVersion(version) {
57962
- if (!version)
57963
- return false;
57964
- return /-(beta|alpha|rc|dev)[.\d]/i.test(version);
58052
+ return isPrereleaseVersion(version);
57965
58053
  }
57966
58054
  function parseCliVersionFromOutput(output2) {
57967
58055
  if (!output2)
@@ -58033,7 +58121,11 @@ async function fetchLatestReleaseTag(kit, beta) {
58033
58121
  async function promptKitUpdate(beta, yes, deps) {
58034
58122
  try {
58035
58123
  const execFn = deps?.execAsyncFn ?? execAsync2;
58036
- const setup = await (deps?.getSetupFn ?? getClaudeKitSetup)();
58124
+ const loadFullConfigFn = deps?.loadFullConfigFn ?? CkConfigManager.loadFull;
58125
+ const confirmFn = deps?.confirmFn ?? se;
58126
+ const isCancelFn = deps?.isCancelFn ?? lD;
58127
+ const getSetupFn = deps?.getSetupFn ?? getClaudeKitSetup;
58128
+ const setup = await getSetupFn();
58037
58129
  const hasLocal = !!setup.project.metadata;
58038
58130
  const hasGlobal = !!setup.global.metadata;
58039
58131
  const localMetadata = hasLocal ? await readMetadataFile(setup.project.path) : null;
@@ -58063,15 +58155,22 @@ async function promptKitUpdate(beta, yes, deps) {
58063
58155
  logger.info(`Kit update available: ${kitVersion} -> ${latestTag}`);
58064
58156
  }
58065
58157
  }
58066
- if (!yes) {
58158
+ let autoInit = false;
58159
+ try {
58160
+ const ckConfig = await loadFullConfigFn(null);
58161
+ autoInit = ckConfig.config.updatePipeline?.autoInitAfterUpdate ?? false;
58162
+ } catch {}
58163
+ if (!yes && !autoInit) {
58067
58164
  logger.info("");
58068
- const shouldUpdate = await se({
58165
+ const shouldUpdate = await confirmFn({
58069
58166
  message: promptMessage
58070
58167
  });
58071
- if (lD(shouldUpdate) || !shouldUpdate) {
58168
+ if (isCancelFn(shouldUpdate) || !shouldUpdate) {
58072
58169
  log.info("Skipped kit content update");
58073
58170
  return;
58074
58171
  }
58172
+ } else if (autoInit && !yes) {
58173
+ logger.info("Auto-running kit update (updatePipeline.autoInitAfterUpdate is enabled)");
58075
58174
  } else {
58076
58175
  logger.verbose("Auto-proceeding with kit update (--yes flag)");
58077
58176
  }
@@ -58137,6 +58236,8 @@ async function updateCliCommand(options2, deps = getDefaultUpdateCliCommandDeps(
58137
58236
  }
58138
58237
  s.start("Checking for updates...");
58139
58238
  let targetVersion = null;
58239
+ const preferInstalledPrereleaseChannel = !opts.release && !(opts.dev || opts.beta) && isPrereleaseVersion(currentVersion);
58240
+ const usePrereleaseChannel = opts.dev || opts.beta || preferInstalledPrereleaseChannel;
58140
58241
  if (opts.release && opts.release !== "latest") {
58141
58242
  try {
58142
58243
  const exists = await npmRegistryClient.versionExists(CLAUDEKIT_CLI_NPM_PACKAGE_NAME, opts.release, registryUrl);
@@ -58156,7 +58257,7 @@ async function updateCliCommand(options2, deps = getDefaultUpdateCliCommandDeps(
58156
58257
  }
58157
58258
  targetVersion = opts.release;
58158
58259
  s.stop(`Target version: ${targetVersion}`);
58159
- } else if (opts.dev || opts.beta) {
58260
+ } else if (usePrereleaseChannel) {
58160
58261
  targetVersion = await npmRegistryClient.getDevVersion(CLAUDEKIT_CLI_NPM_PACKAGE_NAME, registryUrl);
58161
58262
  if (!targetVersion) {
58162
58263
  s.stop("No dev version available");
@@ -58173,15 +58274,16 @@ async function updateCliCommand(options2, deps = getDefaultUpdateCliCommandDeps(
58173
58274
  throw new CliUpdateError(`Failed to fetch version information from npm registry. Check your internet connection and try again. Manual update: ${packageManagerDetector.getUpdateCommand(pm, CLAUDEKIT_CLI_NPM_PACKAGE_NAME, undefined, registryUrl)}`);
58174
58275
  }
58175
58276
  const comparison = import_compare_versions3.compareVersions(currentVersion, targetVersion);
58277
+ const targetIsPrerelease = isPrereleaseVersion(targetVersion);
58176
58278
  if (comparison === 0) {
58177
58279
  outro(`[+] Already on the latest CLI version (${currentVersion})`);
58178
- await promptKitUpdateFn(opts.dev || opts.beta, opts.yes);
58280
+ await promptKitUpdateFn(targetIsPrerelease, opts.yes);
58179
58281
  return;
58180
58282
  }
58181
58283
  const isDevChannelSwitch = (opts.dev || opts.beta) && isBetaVersion(targetVersion) && !isBetaVersion(currentVersion);
58182
58284
  if (comparison > 0 && !opts.release && !isDevChannelSwitch) {
58183
58285
  outro(`[+] Current version (${currentVersion}) is newer than latest (${targetVersion})`);
58184
- await promptKitUpdateFn(opts.dev || opts.beta, opts.yes);
58286
+ await promptKitUpdateFn(targetIsPrerelease, opts.yes);
58185
58287
  return;
58186
58288
  }
58187
58289
  const isUpgrade = comparison < 0 || isDevChannelSwitch;
@@ -58191,7 +58293,7 @@ async function updateCliCommand(options2, deps = getDefaultUpdateCliCommandDeps(
58191
58293
  note(`CLI update available: ${currentVersion} -> ${targetVersion}
58192
58294
 
58193
58295
  Run 'ck update' to install`, "Update Check");
58194
- await promptKitUpdateFn(opts.dev || opts.beta, opts.yes);
58296
+ await promptKitUpdateFn(targetIsPrerelease, opts.yes);
58195
58297
  outro("Check complete");
58196
58298
  return;
58197
58299
  }
@@ -58257,7 +58359,7 @@ Run '${redactCommandForLog(updateCmd)}' manually, restart terminal, then check c
58257
58359
  throw new CliUpdateError(mismatchMessage);
58258
58360
  }
58259
58361
  outro(`[+] Successfully updated ClaudeKit CLI to ${activeVersion}`);
58260
- await promptKitUpdateFn(opts.dev || opts.beta, opts.yes);
58362
+ await promptKitUpdateFn(targetIsPrerelease, opts.yes);
58261
58363
  } catch (error) {
58262
58364
  if (error instanceof CliUpdateError) {
58263
58365
  throw error;
@@ -58281,6 +58383,7 @@ Manual update: ${redactCommandForLog(updateCmd)}`;
58281
58383
  }
58282
58384
  var import_compare_versions3, import_fs_extra5, execAsync2, CliUpdateError;
58283
58385
  var init_update_cli = __esm(() => {
58386
+ init_ck_config_manager();
58284
58387
  init_npm_registry();
58285
58388
  init_package_manager_detector();
58286
58389
  init_metadata_migration();
@@ -58446,7 +58549,7 @@ class CliVersionChecker {
58446
58549
  return null;
58447
58550
  }
58448
58551
  try {
58449
- const latestVersion = await NpmRegistryClient.getLatestVersion(CLAUDEKIT_CLI_NPM_PACKAGE_NAME);
58552
+ const latestVersion = isPrereleaseVersion(currentVersion) ? await NpmRegistryClient.getDevVersion(CLAUDEKIT_CLI_NPM_PACKAGE_NAME) ?? await NpmRegistryClient.getLatestVersion(CLAUDEKIT_CLI_NPM_PACKAGE_NAME) : await NpmRegistryClient.getLatestVersion(CLAUDEKIT_CLI_NPM_PACKAGE_NAME);
58450
58553
  if (!latestVersion) {
58451
58554
  logger.debug("Failed to fetch latest CLI version from npm");
58452
58555
  return null;
@@ -95391,6 +95494,116 @@ import { join as join108 } from "node:path";
95391
95494
  init_logger();
95392
95495
  init_path_resolver();
95393
95496
  var import_fs_extra30 = __toESM(require_lib3(), 1);
95497
+
95498
+ // src/commands/init/phases/post-init-migrate-nudge.ts
95499
+ init_ck_config_manager();
95500
+ init_logger();
95501
+ init_safe_prompts();
95502
+ import { exec as exec8 } from "node:child_process";
95503
+ import { promisify as promisify14 } from "node:util";
95504
+ var execAsync8 = promisify14(exec8);
95505
+ var SAFE_PROVIDER_NAME = /^[a-z0-9-]+$/;
95506
+ async function maybePostInitMigrate(ctx, deps) {
95507
+ if (ctx.cancelled || !ctx.resolvedDir)
95508
+ return;
95509
+ try {
95510
+ const providerRegistry = deps?.detectInstalledProvidersFn && deps?.getProviderConfigFn ? null : await Promise.resolve().then(() => (init_provider_registry(), exports_provider_registry));
95511
+ const portableRegistry = deps?.readPortableRegistryFn ? null : await Promise.resolve().then(() => (init_portable_registry(), exports_portable_registry));
95512
+ const detectInstalledProvidersFn = deps?.detectInstalledProvidersFn ?? providerRegistry?.detectInstalledProviders;
95513
+ const getProviderConfigFn = deps?.getProviderConfigFn ?? providerRegistry?.getProviderConfig;
95514
+ const readPortableRegistryFn = deps?.readPortableRegistryFn ?? portableRegistry?.readPortableRegistry;
95515
+ const loadFullConfigFn = deps?.loadFullConfigFn ?? CkConfigManager.loadFull;
95516
+ if (!detectInstalledProvidersFn || !getProviderConfigFn || !readPortableRegistryFn) {
95517
+ return;
95518
+ }
95519
+ const allProviders = await detectInstalledProvidersFn();
95520
+ const targets = allProviders.filter((p) => p !== "claude-code");
95521
+ if (targets.length === 0)
95522
+ return;
95523
+ const providerNames = targets.map((p) => getProviderConfigFn(p).displayName).join(", ");
95524
+ const registry = await readPortableRegistryFn();
95525
+ const hasHistory = registry.installations.some((i) => i.provider !== "claude-code");
95526
+ const ckConfig = await loadFullConfigFn(ctx.options.global ? null : ctx.resolvedDir);
95527
+ const pipeline = ckConfig.config.updatePipeline;
95528
+ const autoMigrate = pipeline?.autoMigrateAfterInit ?? false;
95529
+ if (autoMigrate) {
95530
+ await runAutoMigrate(ctx, pipeline, targets, providerNames, deps);
95531
+ } else if (!hasHistory && !ctx.isNonInteractive) {
95532
+ await showNudge(ctx, providerNames, deps);
95533
+ }
95534
+ } catch (error) {
95535
+ logger.debug(`Post-init migrate check skipped: ${error instanceof Error ? error.message : "unknown"}`);
95536
+ }
95537
+ }
95538
+ async function showNudge(ctx, providerNames, deps) {
95539
+ const noteFn = deps?.noteFn ?? note;
95540
+ const confirmFn = deps?.confirmFn ?? se;
95541
+ const isCancelFn = deps?.isCancelFn ?? lD;
95542
+ const execAsyncFn = deps?.execAsyncFn ?? execAsync8;
95543
+ noteFn([
95544
+ `Detected providers: ${providerNames}`,
95545
+ "Run `ck migrate` to sync your kit to these providers.",
95546
+ "Set `autoMigrateAfterInit: true` in .ck.json to auto-sync on future updates."
95547
+ ].join(`
95548
+ `), "[i] Provider Sync Available");
95549
+ const shouldMigrate = await confirmFn({
95550
+ message: "Run ck migrate now?"
95551
+ });
95552
+ if (isCancelFn(shouldMigrate) || !shouldMigrate)
95553
+ return;
95554
+ const parts = ["ck", "migrate"];
95555
+ if (ctx.options.global)
95556
+ parts.push("-g");
95557
+ parts.push("--yes");
95558
+ const cmd = parts.join(" ");
95559
+ try {
95560
+ logger.info(`Running: ${cmd}`);
95561
+ await execAsyncFn(cmd, { timeout: 300000 });
95562
+ logger.success("Migration complete");
95563
+ } catch (error) {
95564
+ logger.warning(`Migration failed: ${error instanceof Error ? error.message : "unknown"}. Run \`ck migrate\` manually to retry.`);
95565
+ }
95566
+ }
95567
+ async function runAutoMigrate(ctx, pipeline, detectedTargets, providerNames, deps) {
95568
+ const execAsyncFn = deps?.execAsyncFn ?? execAsync8;
95569
+ let providers2;
95570
+ if (!pipeline?.migrateProviders || pipeline.migrateProviders === "auto") {
95571
+ providers2 = detectedTargets;
95572
+ } else if (Array.isArray(pipeline.migrateProviders)) {
95573
+ const invalid = pipeline.migrateProviders.filter((p) => !detectedTargets.includes(p));
95574
+ if (invalid.length > 0) {
95575
+ logger.warning(`Unknown/uninstalled providers in migrateProviders: ${invalid.join(", ")}`);
95576
+ }
95577
+ providers2 = pipeline.migrateProviders.filter((p) => detectedTargets.includes(p));
95578
+ } else {
95579
+ return;
95580
+ }
95581
+ if (providers2.length === 0)
95582
+ return;
95583
+ const safeProviders = providers2.filter((p) => SAFE_PROVIDER_NAME.test(p));
95584
+ if (safeProviders.length !== providers2.length) {
95585
+ logger.warning("Some provider names contain invalid characters and were skipped");
95586
+ }
95587
+ if (safeProviders.length === 0)
95588
+ return;
95589
+ const parts = ["ck", "migrate"];
95590
+ if (ctx.options.global)
95591
+ parts.push("-g");
95592
+ for (const p of safeProviders) {
95593
+ parts.push("--agent", p);
95594
+ }
95595
+ parts.push("--yes");
95596
+ const cmd = parts.join(" ");
95597
+ logger.info(`Auto-migrating to: ${providerNames}`);
95598
+ try {
95599
+ await execAsyncFn(cmd, { timeout: 300000 });
95600
+ logger.success("Auto-migration complete");
95601
+ } catch (error) {
95602
+ logger.warning(`Auto-migration failed: ${error instanceof Error ? error.message : "unknown"}. Run \`ck migrate\` manually to retry.`);
95603
+ }
95604
+ }
95605
+
95606
+ // src/commands/init/phases/post-install-handler.ts
95394
95607
  async function handlePostInstall(ctx) {
95395
95608
  if (ctx.cancelled || !ctx.extractDir || !ctx.resolvedDir || !ctx.claudeDir) {
95396
95609
  return ctx;
@@ -95460,6 +95673,7 @@ async function handlePostInstall(ctx) {
95460
95673
  logger.debug(`Project auto-registration skipped: ${error instanceof Error ? error.message : "Unknown error"}`);
95461
95674
  }
95462
95675
  }
95676
+ await maybePostInitMigrate(ctx);
95463
95677
  return {
95464
95678
  ...ctx,
95465
95679
  installSkills
@@ -95500,9 +95714,9 @@ async function detectAccessibleKits() {
95500
95714
 
95501
95715
  // src/domains/github/preflight-checker.ts
95502
95716
  init_logger();
95503
- import { exec as exec8 } from "node:child_process";
95504
- import { promisify as promisify14 } from "node:util";
95505
- var execAsync8 = promisify14(exec8);
95717
+ import { exec as exec9 } from "node:child_process";
95718
+ import { promisify as promisify15 } from "node:util";
95719
+ var execAsync9 = promisify15(exec9);
95506
95720
  function createSuccessfulPreflightResult() {
95507
95721
  return {
95508
95722
  success: true,
@@ -95535,7 +95749,7 @@ async function runPreflightChecks() {
95535
95749
  errorLines: []
95536
95750
  };
95537
95751
  try {
95538
- const { stdout: stdout2 } = await execAsync8("gh --version", { timeout: GH_COMMAND_TIMEOUT_MS });
95752
+ const { stdout: stdout2 } = await execAsync9("gh --version", { timeout: GH_COMMAND_TIMEOUT_MS });
95539
95753
  const match2 = stdout2.match(/(\d+\.\d+\.\d+)/);
95540
95754
  if (!match2) {
95541
95755
  logger.debug(`GitHub CLI version not detected from output: ${stdout2.trim()}`);
@@ -95573,7 +95787,7 @@ async function runPreflightChecks() {
95573
95787
  }
95574
95788
  }
95575
95789
  try {
95576
- await execAsync8("gh auth status -h github.com", {
95790
+ await execAsync9("gh auth status -h github.com", {
95577
95791
  timeout: GH_COMMAND_TIMEOUT_MS,
95578
95792
  env: { ...process.env, GH_NO_UPDATE_NOTIFIER: "1" }
95579
95793
  });