claudekit-cli 4.1.0 → 4.1.1-dev.2

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/cli-manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "4.1.0",
3
- "generatedAt": "2026-05-11T04:25:35.081Z",
2
+ "version": "4.1.1-dev.2",
3
+ "generatedAt": "2026-05-12T14:03:18.535Z",
4
4
  "commands": {
5
5
  "agents": {
6
6
  "name": "agents",
package/dist/index.js CHANGED
@@ -16137,10 +16137,14 @@ var init_frontmatter_parser = __esm(() => {
16137
16137
  import { readdir } from "node:fs/promises";
16138
16138
  import { homedir as homedir6 } from "node:os";
16139
16139
  import { join as join6 } from "node:path";
16140
- function getAgentSourcePath() {
16140
+ function getAgentSourcePath(globalOnly = false) {
16141
+ const globalPath = join6(homedir6(), ".claude/agents");
16142
+ if (globalOnly) {
16143
+ return findFirstExistingPath([globalPath]);
16144
+ }
16141
16145
  return findFirstExistingPath([
16142
16146
  ...getProjectLayoutCandidates(process.cwd(), "agents"),
16143
- join6(home3, ".claude/agents")
16147
+ globalPath
16144
16148
  ]);
16145
16149
  }
16146
16150
  async function discoverAgents(sourcePath) {
@@ -16177,12 +16181,10 @@ async function findAgentByName(name, sourcePath) {
16177
16181
  const agents = await discoverAgents(sourcePath);
16178
16182
  return agents.find((a3) => a3.name.toLowerCase() === name.toLowerCase()) || null;
16179
16183
  }
16180
- var home3;
16181
16184
  var init_agents_discovery = __esm(() => {
16182
16185
  init_kit_layout();
16183
16186
  init_logger();
16184
16187
  init_frontmatter_parser();
16185
- home3 = homedir6();
16186
16188
  });
16187
16189
 
16188
16190
  // node_modules/chalk/source/vendor/ansi-styles/index.js
@@ -20819,10 +20821,14 @@ var init_safe_prompts = __esm(() => {
20819
20821
  import { readdir as readdir4 } from "node:fs/promises";
20820
20822
  import { homedir as homedir10 } from "node:os";
20821
20823
  import { join as join16, relative as relative3 } from "node:path";
20822
- function getCommandSourcePath() {
20824
+ function getCommandSourcePath(globalOnly = false) {
20825
+ const globalPath = join16(homedir10(), ".claude/commands");
20826
+ if (globalOnly) {
20827
+ return findFirstExistingPath([globalPath]);
20828
+ }
20823
20829
  return findFirstExistingPath([
20824
20830
  ...getProjectLayoutCandidates(process.cwd(), "commands"),
20825
- join16(home4, ".claude/commands")
20831
+ globalPath
20826
20832
  ]);
20827
20833
  }
20828
20834
  async function scanCommandDir(dir, rootDir) {
@@ -20872,12 +20878,11 @@ async function findCommandByName(name, sourcePath) {
20872
20878
  const commands = await discoverCommands(sourcePath);
20873
20879
  return commands.find((c2) => c2.name.toLowerCase() === name.toLowerCase()) || commands.find((c2) => c2.displayName?.toLowerCase() === name.toLowerCase()) || null;
20874
20880
  }
20875
- var home4, SKIP_DIRS;
20881
+ var SKIP_DIRS;
20876
20882
  var init_commands_discovery = __esm(() => {
20877
20883
  init_kit_layout();
20878
20884
  init_logger();
20879
20885
  init_frontmatter_parser();
20880
- home4 = homedir10();
20881
20886
  SKIP_DIRS = ["node_modules", ".git", "dist", "build"];
20882
20887
  });
20883
20888
 
@@ -49300,7 +49305,7 @@ function resolveAgentDirs() {
49300
49305
  dirs.push({ path: candidate, label: rel });
49301
49306
  }
49302
49307
  }
49303
- const globalPath = join28(home5, ".claude", "agents");
49308
+ const globalPath = join28(home3, ".claude", "agents");
49304
49309
  dirs.push({ path: globalPath, label: "~/.claude/agents" });
49305
49310
  const seen = new Set;
49306
49311
  return dirs.filter(({ path: path3 }) => {
@@ -49389,11 +49394,11 @@ function registerAgentsBrowserRoutes(app) {
49389
49394
  res.status(404).json({ error: "Agent not found" });
49390
49395
  });
49391
49396
  }
49392
- var home5;
49397
+ var home3;
49393
49398
  var init_agents_routes = __esm(() => {
49394
49399
  init_frontmatter_parser();
49395
49400
  init_kit_layout();
49396
- home5 = homedir15();
49401
+ home3 = homedir15();
49397
49402
  });
49398
49403
 
49399
49404
  // src/schemas/ck-config.schema.json
@@ -51445,10 +51450,10 @@ function mergeServers(lists) {
51445
51450
  function isSafeProjectPath(projectPath) {
51446
51451
  if (projectPath.includes(".."))
51447
51452
  return false;
51448
- const home6 = homedir23();
51453
+ const home4 = homedir23();
51449
51454
  try {
51450
51455
  const resolved = resolve14(projectPath);
51451
- if (!resolved.startsWith(home6))
51456
+ if (!resolved.startsWith(home4))
51452
51457
  return false;
51453
51458
  return existsSync21(resolved);
51454
51459
  } catch {
@@ -51774,26 +51779,34 @@ async function copyHooksCompanionDirs(sourceDir, targetDir) {
51774
51779
  function resolveSourceOrigin(sourcePath) {
51775
51780
  if (!sourcePath)
51776
51781
  return "global";
51777
- const home6 = homedir24();
51782
+ const home4 = homedir24();
51778
51783
  const cwd2 = process.cwd();
51779
- if (cwd2 === home6)
51784
+ if (cwd2 === home4)
51780
51785
  return "global";
51781
51786
  const cwdPrefix = cwd2.endsWith(sep6) ? cwd2 : `${cwd2}${sep6}`;
51782
51787
  if (sourcePath === cwd2 || sourcePath.startsWith(cwdPrefix))
51783
51788
  return "project";
51784
51789
  return "global";
51785
51790
  }
51786
- function getConfigSourcePath() {
51791
+ function getConfigSourcePath(globalOnly = false) {
51792
+ if (globalOnly)
51793
+ return getGlobalConfigSourcePath();
51787
51794
  return findExistingProjectConfigPath(process.cwd()) ?? getGlobalConfigSourcePath();
51788
51795
  }
51789
51796
  function getGlobalConfigSourcePath() {
51790
51797
  return join41(homedir24(), ".claude", "CLAUDE.md");
51791
51798
  }
51792
- function getRulesSourcePath() {
51793
- return findExistingProjectLayoutPath(process.cwd(), "rules") ?? join41(homedir24(), ".claude", "rules");
51799
+ function getRulesSourcePath(globalOnly = false) {
51800
+ const globalPath = join41(homedir24(), ".claude", "rules");
51801
+ if (globalOnly)
51802
+ return globalPath;
51803
+ return findExistingProjectLayoutPath(process.cwd(), "rules") ?? globalPath;
51794
51804
  }
51795
- function getHooksSourcePath() {
51796
- return findExistingProjectLayoutPath(process.cwd(), "hooks") ?? join41(homedir24(), ".claude", "hooks");
51805
+ function getHooksSourcePath(globalOnly = false) {
51806
+ const globalPath = join41(homedir24(), ".claude", "hooks");
51807
+ if (globalOnly)
51808
+ return globalPath;
51809
+ return findExistingProjectLayoutPath(process.cwd(), "hooks") ?? globalPath;
51797
51810
  }
51798
51811
  async function discoverConfig(sourcePath) {
51799
51812
  const path3 = sourcePath ?? getConfigSourcePath();
@@ -54298,12 +54311,12 @@ function scrubHookEntry(entry, event, capabilities, pathRewrite) {
54298
54311
  }
54299
54312
  function rewriteCommandPath(command, pathRewrite) {
54300
54313
  if (pathRewrite.commandSubstitutions && pathRewrite.commandSubstitutions.size > 0) {
54301
- const home6 = homedir26();
54314
+ const home4 = homedir26();
54302
54315
  for (const [originalAbsPath, wrapperAbsPath] of pathRewrite.commandSubstitutions) {
54303
54316
  const candidates = new Set([
54304
54317
  originalAbsPath,
54305
- originalAbsPath.replace(home6, "$HOME"),
54306
- originalAbsPath.replace(home6, "~")
54318
+ originalAbsPath.replace(home4, "$HOME"),
54319
+ originalAbsPath.replace(home4, "~")
54307
54320
  ]);
54308
54321
  for (const candidate of candidates) {
54309
54322
  if (command.includes(candidate)) {
@@ -56109,13 +56122,17 @@ __export(exports_skills_discovery, {
56109
56122
  import { readFile as readFile24, readdir as readdir13, stat as stat9 } from "node:fs/promises";
56110
56123
  import { homedir as homedir28 } from "node:os";
56111
56124
  import { dirname as dirname15, join as join45 } from "node:path";
56112
- function getSkillSourcePath() {
56125
+ function getSkillSourcePath(globalOnly = false) {
56126
+ const globalPath = join45(homedir28(), ".claude/skills");
56127
+ if (globalOnly) {
56128
+ return findFirstExistingPath([globalPath]);
56129
+ }
56113
56130
  const bundledRoot = join45(process.cwd(), "node_modules", "claudekit-engineer");
56114
56131
  return findFirstExistingPath([
56115
56132
  join45(bundledRoot, "skills"),
56116
56133
  ...getProjectLayoutCandidates(bundledRoot, "skills"),
56117
56134
  ...getProjectLayoutCandidates(process.cwd(), "skills"),
56118
- join45(home6, ".claude/skills")
56135
+ globalPath
56119
56136
  ]);
56120
56137
  }
56121
56138
  async function hasSkillMd(dir) {
@@ -56228,13 +56245,12 @@ async function findSkillByName(name, sourcePath) {
56228
56245
  const skills = await discoverSkills(sourcePath);
56229
56246
  return skills.find((s) => s.name.toLowerCase() === name.toLowerCase()) || null;
56230
56247
  }
56231
- var import_gray_matter5, home6, SKIP_DIRS3;
56248
+ var import_gray_matter5, SKIP_DIRS3;
56232
56249
  var init_skills_discovery = __esm(() => {
56233
56250
  init_kit_layout();
56234
56251
  init_skill_frontmatter_validator();
56235
56252
  init_logger();
56236
56253
  import_gray_matter5 = __toESM(require_gray_matter(), 1);
56237
- home6 = homedir28();
56238
56254
  SKIP_DIRS3 = ["node_modules", ".git", "dist", "build", ".venv", "__pycache__", "common"];
56239
56255
  });
56240
56256
 
@@ -56875,13 +56891,13 @@ function recordHookRegistrationOutcome(provider, mergeResult, warnings, feedback
56875
56891
  function warnConversionFallback(warning) {
56876
56892
  console.warn(`[migrate] Falling back to raw checksum for ${sanitizeUntrusted(warning.provider)} ${sanitizeUntrusted(warning.type)} "${sanitizeUntrusted(warning.item, 80)}" because ${sanitizeUntrusted(warning.format)} conversion failed: ${sanitizeUntrusted(warning.error, 260)}`);
56877
56893
  }
56878
- async function discoverMigrationItems(include, configSource) {
56879
- const agentsSource = include.agents ? getAgentSourcePath() : null;
56880
- const commandsSource = include.commands ? getCommandSourcePath() : null;
56881
- const skillsSource = include.skills ? getSkillSourcePath() : null;
56882
- const hooksSource = include.hooks ? getHooksSourcePath() : null;
56883
- const configSourcePath = include.config ? configSource ?? getConfigSourcePath() : null;
56884
- const rulesSourcePath = include.rules ? getRulesSourcePath() : null;
56894
+ async function discoverMigrationItems(include, configSource, globalOnly = false) {
56895
+ const agentsSource = include.agents ? getAgentSourcePath(globalOnly) : null;
56896
+ const commandsSource = include.commands ? getCommandSourcePath(globalOnly) : null;
56897
+ const skillsSource = include.skills ? getSkillSourcePath(globalOnly) : null;
56898
+ const hooksSource = include.hooks ? getHooksSourcePath(globalOnly) : null;
56899
+ const configSourcePath = include.config ? configSource ?? getConfigSourcePath(globalOnly) : null;
56900
+ const rulesSourcePath = include.rules ? getRulesSourcePath(globalOnly) : null;
56885
56901
  const [agents, commands, skills, configItem, ruleItems, hookItems] = await Promise.all([
56886
56902
  agentsSource ? discoverAgents(agentsSource) : Promise.resolve([]),
56887
56903
  commandsSource ? discoverCommands(commandsSource) : Promise.resolve([]),
@@ -56958,12 +56974,12 @@ function registerMigrationRoutes(app) {
56958
56974
  };
56959
56975
  const discovered = await discoverMigrationItems(includeAll);
56960
56976
  const cwd2 = process.cwd();
56961
- const home7 = homedir29();
56977
+ const home4 = homedir29();
56962
56978
  res.status(200).json({
56963
56979
  cwd: cwd2,
56964
56980
  targetPaths: {
56965
56981
  project: join46(cwd2, ".claude"),
56966
- global: join46(home7, ".claude")
56982
+ global: join46(home4, ".claude")
56967
56983
  },
56968
56984
  sourcePaths: discovered.sourcePaths,
56969
56985
  sourceOrigins: {
@@ -57574,7 +57590,7 @@ function registerMigrationRoutes(app) {
57574
57590
  const configSource = sourceParsed.value;
57575
57591
  const effectiveGlobal = requestedGlobal;
57576
57592
  const warnings = [];
57577
- const discovered = await discoverMigrationItems(include, configSource);
57593
+ const discovered = await discoverMigrationItems(include, configSource, requestedGlobal);
57578
57594
  const hasItems = discovered.agents.length > 0 || discovered.commands.length > 0 || discovered.skills.length > 0 || discovered.configItem !== null || discovered.ruleItems.length > 0 || discovered.hookItems.length > 0;
57579
57595
  if (!hasItems) {
57580
57596
  res.status(200).json({
@@ -60585,8 +60601,8 @@ function toDateStr(d3) {
60585
60601
  return `${y3}-${m2}-${day}`;
60586
60602
  }
60587
60603
  async function scanActivityMetrics(periodDays) {
60588
- const home7 = homedir33();
60589
- const projectsDir2 = join56(home7, ".claude", "projects");
60604
+ const home4 = homedir33();
60605
+ const projectsDir2 = join56(home4, ".claude", "projects");
60590
60606
  const cutoff = new Date;
60591
60607
  cutoff.setDate(cutoff.getDate() - periodDays);
60592
60608
  const dailyMap = new Map;
@@ -60656,29 +60672,29 @@ async function scanActivityMetrics(periodDays) {
60656
60672
  return { totalSessions, projects: projectActivities, dailyCounts };
60657
60673
  }
60658
60674
  async function resolveSessionDir(projectId) {
60659
- const home7 = homedir33();
60675
+ const home4 = homedir33();
60660
60676
  if (projectId.startsWith("discovered-")) {
60661
60677
  try {
60662
60678
  const encodedPathB64 = projectId.slice("discovered-".length);
60663
60679
  const projectPath = Buffer.from(encodedPathB64, "base64url").toString("utf-8");
60664
60680
  const claudeEncoded = encodePath(projectPath);
60665
- return join56(home7, ".claude", "projects", claudeEncoded);
60681
+ return join56(home4, ".claude", "projects", claudeEncoded);
60666
60682
  } catch {
60667
60683
  return null;
60668
60684
  }
60669
60685
  }
60670
60686
  if (projectId === "current") {
60671
60687
  const cwdEncoded = encodePath(process.cwd());
60672
- return join56(home7, ".claude", "projects", cwdEncoded);
60688
+ return join56(home4, ".claude", "projects", cwdEncoded);
60673
60689
  }
60674
60690
  if (projectId === "global") {
60675
- const globalEncoded = encodePath(join56(home7, ".claude"));
60676
- return join56(home7, ".claude", "projects", globalEncoded);
60691
+ const globalEncoded = encodePath(join56(home4, ".claude"));
60692
+ return join56(home4, ".claude", "projects", globalEncoded);
60677
60693
  }
60678
60694
  const registered = await ProjectsRegistryManager.getProject(projectId);
60679
60695
  if (registered) {
60680
60696
  const claudeEncoded = encodePath(registered.path);
60681
- return join56(home7, ".claude", "projects", claudeEncoded);
60697
+ return join56(home4, ".claude", "projects", claudeEncoded);
60682
60698
  }
60683
60699
  return null;
60684
60700
  }
@@ -60830,8 +60846,8 @@ async function parseSessionDetail(filePath, limit, offset) {
60830
60846
  }
60831
60847
  function registerSessionRoutes(app) {
60832
60848
  app.get("/api/sessions", async (_req, res) => {
60833
- const home7 = homedir33();
60834
- const projectsDir2 = join56(home7, ".claude", "projects");
60849
+ const home4 = homedir33();
60850
+ const projectsDir2 = join56(home4, ".claude", "projects");
60835
60851
  if (!existsSync37(projectsDir2)) {
60836
60852
  res.json({ projects: [] });
60837
60853
  return;
@@ -61514,10 +61530,10 @@ function hasOpenCodeInstallSignal2() {
61514
61530
  join59(process.cwd(), "opencode.jsonc"),
61515
61531
  join59(process.cwd(), ".opencode/agents"),
61516
61532
  join59(process.cwd(), ".opencode/commands"),
61517
- join59(home7, ".config/opencode/AGENTS.md"),
61518
- join59(home7, ".config/opencode/agents"),
61519
- join59(home7, ".config/opencode/commands"),
61520
- join59(home7, ".opencode", "bin", OPENCODE_BINARY_NAME2)
61533
+ join59(home4, ".config/opencode/AGENTS.md"),
61534
+ join59(home4, ".config/opencode/agents"),
61535
+ join59(home4, ".config/opencode/commands"),
61536
+ join59(home4, ".opencode", "bin", OPENCODE_BINARY_NAME2)
61521
61537
  ]);
61522
61538
  }
61523
61539
  async function detectInstalledAgents() {
@@ -61541,108 +61557,108 @@ function isSkillInstalled(skillName, agent, options2) {
61541
61557
  const installPath = getInstallPath(skillName, agent, options2);
61542
61558
  return existsSync38(installPath);
61543
61559
  }
61544
- var home7, OPENCODE_BINARY_NAME2, agents;
61560
+ var home4, OPENCODE_BINARY_NAME2, agents;
61545
61561
  var init_agents = __esm(() => {
61546
- home7 = homedir37();
61562
+ home4 = homedir37();
61547
61563
  OPENCODE_BINARY_NAME2 = platform5() === "win32" ? "opencode.exe" : "opencode";
61548
61564
  agents = {
61549
61565
  "claude-code": {
61550
61566
  name: "claude-code",
61551
61567
  displayName: "Claude Code",
61552
61568
  projectPath: ".claude/skills",
61553
- globalPath: join59(home7, ".claude/skills"),
61554
- detect: async () => existsSync38(join59(home7, ".claude"))
61569
+ globalPath: join59(home4, ".claude/skills"),
61570
+ detect: async () => existsSync38(join59(home4, ".claude"))
61555
61571
  },
61556
61572
  cursor: {
61557
61573
  name: "cursor",
61558
61574
  displayName: "Cursor",
61559
61575
  projectPath: ".cursor/skills",
61560
- globalPath: join59(home7, ".cursor/skills"),
61561
- detect: async () => existsSync38(join59(home7, ".cursor"))
61576
+ globalPath: join59(home4, ".cursor/skills"),
61577
+ detect: async () => existsSync38(join59(home4, ".cursor"))
61562
61578
  },
61563
61579
  codex: {
61564
61580
  name: "codex",
61565
61581
  displayName: "Codex",
61566
61582
  projectPath: ".codex/skills",
61567
- globalPath: join59(home7, ".codex/skills"),
61568
- detect: async () => existsSync38(join59(home7, ".codex"))
61583
+ globalPath: join59(home4, ".codex/skills"),
61584
+ detect: async () => existsSync38(join59(home4, ".codex"))
61569
61585
  },
61570
61586
  opencode: {
61571
61587
  name: "opencode",
61572
61588
  displayName: "OpenCode",
61573
61589
  projectPath: ".claude/skills",
61574
- globalPath: join59(home7, ".claude/skills"),
61590
+ globalPath: join59(home4, ".claude/skills"),
61575
61591
  detect: async () => hasOpenCodeInstallSignal2()
61576
61592
  },
61577
61593
  goose: {
61578
61594
  name: "goose",
61579
61595
  displayName: "Goose",
61580
61596
  projectPath: ".goose/skills",
61581
- globalPath: join59(home7, ".config/goose/skills"),
61582
- detect: async () => existsSync38(join59(home7, ".config/goose"))
61597
+ globalPath: join59(home4, ".config/goose/skills"),
61598
+ detect: async () => existsSync38(join59(home4, ".config/goose"))
61583
61599
  },
61584
61600
  "gemini-cli": {
61585
61601
  name: "gemini-cli",
61586
61602
  displayName: "Gemini CLI",
61587
61603
  projectPath: ".agents/skills",
61588
- globalPath: join59(home7, ".agents/skills"),
61589
- detect: async () => existsSync38(join59(home7, ".gemini"))
61604
+ globalPath: join59(home4, ".agents/skills"),
61605
+ detect: async () => existsSync38(join59(home4, ".gemini"))
61590
61606
  },
61591
61607
  antigravity: {
61592
61608
  name: "antigravity",
61593
61609
  displayName: "Antigravity",
61594
61610
  projectPath: ".agent/skills",
61595
- globalPath: join59(home7, ".gemini/antigravity/skills"),
61596
- detect: async () => existsSync38(join59(process.cwd(), ".agent")) || existsSync38(join59(home7, ".gemini/antigravity"))
61611
+ globalPath: join59(home4, ".gemini/antigravity/skills"),
61612
+ detect: async () => existsSync38(join59(process.cwd(), ".agent")) || existsSync38(join59(home4, ".gemini/antigravity"))
61597
61613
  },
61598
61614
  "github-copilot": {
61599
61615
  name: "github-copilot",
61600
61616
  displayName: "GitHub Copilot",
61601
61617
  projectPath: ".github/skills",
61602
- globalPath: join59(home7, ".copilot/skills"),
61603
- detect: async () => existsSync38(join59(home7, ".copilot"))
61618
+ globalPath: join59(home4, ".copilot/skills"),
61619
+ detect: async () => existsSync38(join59(home4, ".copilot"))
61604
61620
  },
61605
61621
  amp: {
61606
61622
  name: "amp",
61607
61623
  displayName: "Amp",
61608
61624
  projectPath: ".agents/skills",
61609
- globalPath: join59(home7, ".config/agents/skills"),
61610
- detect: async () => existsSync38(join59(home7, ".config/amp"))
61625
+ globalPath: join59(home4, ".config/agents/skills"),
61626
+ detect: async () => existsSync38(join59(home4, ".config/amp"))
61611
61627
  },
61612
61628
  kilo: {
61613
61629
  name: "kilo",
61614
61630
  displayName: "Kilo Code",
61615
61631
  projectPath: ".kilocode/skills",
61616
- globalPath: join59(home7, ".kilocode/skills"),
61617
- detect: async () => existsSync38(join59(home7, ".kilocode"))
61632
+ globalPath: join59(home4, ".kilocode/skills"),
61633
+ detect: async () => existsSync38(join59(home4, ".kilocode"))
61618
61634
  },
61619
61635
  roo: {
61620
61636
  name: "roo",
61621
61637
  displayName: "Roo Code",
61622
61638
  projectPath: ".roo/skills",
61623
- globalPath: join59(home7, ".roo/skills"),
61624
- detect: async () => existsSync38(join59(home7, ".roo"))
61639
+ globalPath: join59(home4, ".roo/skills"),
61640
+ detect: async () => existsSync38(join59(home4, ".roo"))
61625
61641
  },
61626
61642
  windsurf: {
61627
61643
  name: "windsurf",
61628
61644
  displayName: "Windsurf",
61629
61645
  projectPath: ".windsurf/skills",
61630
- globalPath: join59(home7, ".codeium/windsurf/skills"),
61631
- detect: async () => existsSync38(join59(home7, ".codeium/windsurf"))
61646
+ globalPath: join59(home4, ".codeium/windsurf/skills"),
61647
+ detect: async () => existsSync38(join59(home4, ".codeium/windsurf"))
61632
61648
  },
61633
61649
  cline: {
61634
61650
  name: "cline",
61635
61651
  displayName: "Cline",
61636
61652
  projectPath: ".cline/skills",
61637
- globalPath: join59(home7, ".cline/skills"),
61638
- detect: async () => existsSync38(join59(home7, ".cline"))
61653
+ globalPath: join59(home4, ".cline/skills"),
61654
+ detect: async () => existsSync38(join59(home4, ".cline"))
61639
61655
  },
61640
61656
  openhands: {
61641
61657
  name: "openhands",
61642
61658
  displayName: "OpenHands",
61643
61659
  projectPath: ".openhands/skills",
61644
- globalPath: join59(home7, ".openhands/skills"),
61645
- detect: async () => existsSync38(join59(home7, ".openhands"))
61660
+ globalPath: join59(home4, ".openhands/skills"),
61661
+ detect: async () => existsSync38(join59(home4, ".openhands"))
61646
61662
  }
61647
61663
  };
61648
61664
  });
@@ -61759,11 +61775,11 @@ async function syncRegistry() {
61759
61775
  }
61760
61776
  return { removed };
61761
61777
  }
61762
- var home8, REGISTRY_PATH2, SkillInstallationSchema, SkillRegistrySchema, REGISTRY_PATH_MIGRATIONS;
61778
+ var home5, REGISTRY_PATH2, SkillInstallationSchema, SkillRegistrySchema, REGISTRY_PATH_MIGRATIONS;
61763
61779
  var init_skills_registry = __esm(() => {
61764
61780
  init_zod();
61765
- home8 = homedir38();
61766
- REGISTRY_PATH2 = join60(home8, ".claudekit", "skill-registry.json");
61781
+ home5 = homedir38();
61782
+ REGISTRY_PATH2 = join60(home5, ".claudekit", "skill-registry.json");
61767
61783
  SkillInstallationSchema = exports_external.object({
61768
61784
  skill: exports_external.string(),
61769
61785
  agent: exports_external.string(),
@@ -62874,7 +62890,7 @@ var package_default;
62874
62890
  var init_package = __esm(() => {
62875
62891
  package_default = {
62876
62892
  name: "claudekit-cli",
62877
- version: "4.1.0",
62893
+ version: "4.1.1-dev.2",
62878
62894
  description: "CLI tool for bootstrapping and updating ClaudeKit projects",
62879
62895
  type: "module",
62880
62896
  repository: {
@@ -62918,6 +62934,7 @@ var init_package = __esm(() => {
62918
62934
  "dev:all": "./scripts/dev-quick-start.sh all",
62919
62935
  metrics: "bun run scripts/workflow-metrics.ts",
62920
62936
  validate: "bun run typecheck && bun run lint && bun test && bun run ui:test && bun run build",
62937
+ "ci:local": "bash scripts/ci-local.sh",
62921
62938
  "install:hooks": "./.githooks/install.sh",
62922
62939
  prepare: `node -e "try{require('child_process').execSync('git rev-parse --git-dir',{stdio:'ignore'});require('child_process').execSync('bash .githooks/install.sh',{stdio:'inherit'})}catch(e){console.warn('[i] Hook install skipped:',e.message)}"`,
62923
62940
  "help:check-parity": "bun run scripts/check-help-parity.ts",
@@ -64872,8 +64889,20 @@ function buildInitCommand(isGlobal, kit, beta, yes) {
64872
64889
  function resolveCkExecutable(platformName = process.platform) {
64873
64890
  return platformName === "win32" ? "ck.cmd" : "ck";
64874
64891
  }
64875
- function shouldRunCkExecutableInShell(platformName = process.platform) {
64876
- return platformName === "win32";
64892
+ function resolveCkInitSpawnCommand(initArgs, options2 = {}) {
64893
+ const execPath = options2.execPath ?? process.execPath;
64894
+ const argv = options2.argv ?? process.argv;
64895
+ const currentEntrypoint = argv[1];
64896
+ if (currentEntrypoint) {
64897
+ return {
64898
+ command: execPath,
64899
+ args: [currentEntrypoint, ...initArgs]
64900
+ };
64901
+ }
64902
+ return {
64903
+ command: resolveCkExecutable(options2.platformName),
64904
+ args: initArgs
64905
+ };
64877
64906
  }
64878
64907
  async function fetchLatestReleaseTag(kit, beta) {
64879
64908
  try {
@@ -64983,10 +65012,8 @@ async function promptKitUpdate(beta, yes, deps) {
64983
65012
  const displayCmd = `ck ${args.join(" ")}`;
64984
65013
  logger.info(`Running: ${displayCmd}`);
64985
65014
  const spawnFn = deps?.spawnInitFn ?? ((spawnArgs) => new Promise((resolve30) => {
64986
- const child = spawn2(resolveCkExecutable(), spawnArgs, {
64987
- stdio: "inherit",
64988
- shell: shouldRunCkExecutableInShell()
64989
- });
65015
+ const initCommand = resolveCkInitSpawnCommand(spawnArgs);
65016
+ const child = spawn2(initCommand.command, initCommand.args, { stdio: "inherit" });
64990
65017
  child.on("close", (code) => resolve30(code ?? 1));
64991
65018
  child.on("error", (err) => {
64992
65019
  logger.verbose(`Failed to spawn ck init: ${err.message}`);
@@ -73979,76 +74006,6 @@ var init_ownership_display = __esm(() => {
73979
74006
  import_picocolors25 = __toESM(require_picocolors(), 1);
73980
74007
  });
73981
74008
 
73982
- // src/ui/node_modules/picocolors/picocolors.js
73983
- var require_picocolors2 = __commonJS((exports, module) => {
73984
- var p = process || {};
73985
- var argv = p.argv || [];
73986
- var env2 = p.env || {};
73987
- var isColorSupported = !(!!env2.NO_COLOR || argv.includes("--no-color")) && (!!env2.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
73988
- var formatter = (open6, close, replace3 = open6) => (input) => {
73989
- let string = "" + input, index = string.indexOf(close, open6.length);
73990
- return ~index ? open6 + replaceClose(string, close, replace3, index) + close : open6 + string + close;
73991
- };
73992
- var replaceClose = (string, close, replace3, index) => {
73993
- let result = "", cursor = 0;
73994
- do {
73995
- result += string.substring(cursor, index) + replace3;
73996
- cursor = index + close.length;
73997
- index = string.indexOf(close, cursor);
73998
- } while (~index);
73999
- return result + string.substring(cursor);
74000
- };
74001
- var createColors = (enabled = isColorSupported) => {
74002
- let f3 = enabled ? formatter : () => String;
74003
- return {
74004
- isColorSupported: enabled,
74005
- reset: f3("\x1B[0m", "\x1B[0m"),
74006
- bold: f3("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
74007
- dim: f3("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
74008
- italic: f3("\x1B[3m", "\x1B[23m"),
74009
- underline: f3("\x1B[4m", "\x1B[24m"),
74010
- inverse: f3("\x1B[7m", "\x1B[27m"),
74011
- hidden: f3("\x1B[8m", "\x1B[28m"),
74012
- strikethrough: f3("\x1B[9m", "\x1B[29m"),
74013
- black: f3("\x1B[30m", "\x1B[39m"),
74014
- red: f3("\x1B[31m", "\x1B[39m"),
74015
- green: f3("\x1B[32m", "\x1B[39m"),
74016
- yellow: f3("\x1B[33m", "\x1B[39m"),
74017
- blue: f3("\x1B[34m", "\x1B[39m"),
74018
- magenta: f3("\x1B[35m", "\x1B[39m"),
74019
- cyan: f3("\x1B[36m", "\x1B[39m"),
74020
- white: f3("\x1B[37m", "\x1B[39m"),
74021
- gray: f3("\x1B[90m", "\x1B[39m"),
74022
- bgBlack: f3("\x1B[40m", "\x1B[49m"),
74023
- bgRed: f3("\x1B[41m", "\x1B[49m"),
74024
- bgGreen: f3("\x1B[42m", "\x1B[49m"),
74025
- bgYellow: f3("\x1B[43m", "\x1B[49m"),
74026
- bgBlue: f3("\x1B[44m", "\x1B[49m"),
74027
- bgMagenta: f3("\x1B[45m", "\x1B[49m"),
74028
- bgCyan: f3("\x1B[46m", "\x1B[49m"),
74029
- bgWhite: f3("\x1B[47m", "\x1B[49m"),
74030
- blackBright: f3("\x1B[90m", "\x1B[39m"),
74031
- redBright: f3("\x1B[91m", "\x1B[39m"),
74032
- greenBright: f3("\x1B[92m", "\x1B[39m"),
74033
- yellowBright: f3("\x1B[93m", "\x1B[39m"),
74034
- blueBright: f3("\x1B[94m", "\x1B[39m"),
74035
- magentaBright: f3("\x1B[95m", "\x1B[39m"),
74036
- cyanBright: f3("\x1B[96m", "\x1B[39m"),
74037
- whiteBright: f3("\x1B[97m", "\x1B[39m"),
74038
- bgBlackBright: f3("\x1B[100m", "\x1B[49m"),
74039
- bgRedBright: f3("\x1B[101m", "\x1B[49m"),
74040
- bgGreenBright: f3("\x1B[102m", "\x1B[49m"),
74041
- bgYellowBright: f3("\x1B[103m", "\x1B[49m"),
74042
- bgBlueBright: f3("\x1B[104m", "\x1B[49m"),
74043
- bgMagentaBright: f3("\x1B[105m", "\x1B[49m"),
74044
- bgCyanBright: f3("\x1B[106m", "\x1B[49m"),
74045
- bgWhiteBright: f3("\x1B[107m", "\x1B[49m")
74046
- };
74047
- };
74048
- module.exports = createColors();
74049
- module.exports.createColors = createColors;
74050
- });
74051
-
74052
74009
  // src/commands/watch/phases/implementation-git-helpers.ts
74053
74010
  import { spawn as spawn5 } from "node:child_process";
74054
74011
  async function getCurrentBranch2(cwd2) {
@@ -85598,16 +85555,16 @@ async function checkPathRefsValid(projectDir) {
85598
85555
  };
85599
85556
  }
85600
85557
  const baseDir = dirname27(claudeMdPath);
85601
- const home9 = homedir41();
85558
+ const home6 = homedir41();
85602
85559
  const broken = [];
85603
85560
  for (const ref of refs) {
85604
85561
  let refPath;
85605
85562
  if (ref.startsWith("$HOME") || ref.startsWith("${HOME}") || ref.startsWith("%USERPROFILE%")) {
85606
- refPath = normalize6(ref.replace(/^\$\{?HOME\}?/, home9).replace("%USERPROFILE%", home9));
85563
+ refPath = normalize6(ref.replace(/^\$\{?HOME\}?/, home6).replace("%USERPROFILE%", home6));
85607
85564
  } else if (ref.startsWith("$CLAUDE_PROJECT_DIR") || ref.startsWith("${CLAUDE_PROJECT_DIR}") || ref.startsWith("%CLAUDE_PROJECT_DIR%")) {
85608
85565
  refPath = normalize6(ref.replace(/^\$\{?CLAUDE_PROJECT_DIR\}?/, projectDir).replace("%CLAUDE_PROJECT_DIR%", projectDir));
85609
85566
  } else if (ref.startsWith("~")) {
85610
- refPath = normalize6(ref.replace(/^~/, home9));
85567
+ refPath = normalize6(ref.replace(/^~/, home6));
85611
85568
  } else if (ref.startsWith("/")) {
85612
85569
  refPath = normalize6(ref);
85613
85570
  } else if (/^[A-Za-z]:/.test(ref)) {
@@ -85616,7 +85573,7 @@ async function checkPathRefsValid(projectDir) {
85616
85573
  refPath = resolve32(baseDir, ref);
85617
85574
  }
85618
85575
  const normalizedPath = normalize6(refPath);
85619
- const isWithinHome = normalizedPath.startsWith(home9);
85576
+ const isWithinHome = normalizedPath.startsWith(home6);
85620
85577
  const isWithinBase2 = normalizedPath.startsWith(normalize6(baseDir));
85621
85578
  const isAbsoluteAllowed = ref.startsWith("/") || /^[A-Za-z]:/.test(ref);
85622
85579
  if (!isWithinHome && !isWithinBase2 && !isAbsoluteAllowed) {
@@ -86745,12 +86702,12 @@ function extractHookScriptPath(cmd) {
86745
86702
  }
86746
86703
  function resolveHookScriptPath(scriptPath, projectDir) {
86747
86704
  let resolved = scriptPath.replace(/\\/g, "/");
86748
- const home9 = homedir42();
86749
- resolved = resolved.replace(/^\$\{?HOME\}?/, home9);
86705
+ const home6 = homedir42();
86706
+ resolved = resolved.replace(/^\$\{?HOME\}?/, home6);
86750
86707
  resolved = resolved.replace(/^\$\{?CLAUDE_PROJECT_DIR\}?/, projectDir);
86751
- resolved = resolved.replace(/^%USERPROFILE%/, home9);
86708
+ resolved = resolved.replace(/^%USERPROFILE%/, home6);
86752
86709
  resolved = resolved.replace(/^%CLAUDE_PROJECT_DIR%/, projectDir);
86753
- resolved = resolved.replace(/^~\//, `${home9}/`);
86710
+ resolved = resolved.replace(/^~\//, `${home6}/`);
86754
86711
  if (resolved.startsWith(".claude/") || resolved === ".claude") {
86755
86712
  resolved = join83(projectDir, resolved);
86756
86713
  }
@@ -88799,8 +88756,8 @@ class ReportGenerator {
88799
88756
  };
88800
88757
  }
88801
88758
  scrubPath(path7) {
88802
- const home9 = process.env.HOME || process.env.USERPROFILE || "";
88803
- return home9 ? path7.replace(home9, "~") : path7;
88759
+ const home6 = process.env.HOME || process.env.USERPROFILE || "";
88760
+ return home6 ? path7.replace(home6, "~") : path7;
88804
88761
  }
88805
88762
  getStatusIcon(status) {
88806
88763
  switch (status) {
@@ -88914,8 +88871,8 @@ class DoctorUIRenderer {
88914
88871
  }
88915
88872
  }
88916
88873
  shortenPath(path7) {
88917
- const home9 = process.env.HOME || process.env.USERPROFILE || "";
88918
- let shortened = home9 ? path7.replace(home9, "~") : path7;
88874
+ const home6 = process.env.HOME || process.env.USERPROFILE || "";
88875
+ let shortened = home6 ? path7.replace(home6, "~") : path7;
88919
88876
  const maxLen = 50;
88920
88877
  if (shortened.length > maxLen) {
88921
88878
  const start = shortened.slice(0, 20);
@@ -107485,7 +107442,7 @@ import { basename as basename27, join as join142, resolve as resolve46 } from "n
107485
107442
  init_logger();
107486
107443
 
107487
107444
  // src/ui/ck-cli-design/tokens.ts
107488
- var import_picocolors27 = __toESM(require_picocolors2(), 1);
107445
+ var import_picocolors27 = __toESM(require_picocolors(), 1);
107489
107446
  import { homedir as homedir47, platform as platform16 } from "node:os";
107490
107447
  import { resolve as resolve45, win32 as win322 } from "node:path";
107491
107448
  var PANEL_MIN_WIDTH = 60;
@@ -107644,11 +107601,11 @@ function wrapText(value, width) {
107644
107601
  }
107645
107602
  function formatDisplayPath(value) {
107646
107603
  const normalized = value.replace(/\\/g, "/");
107647
- const home9 = homedir47().replace(/\\/g, "/");
107648
- if (normalized === home9)
107604
+ const home6 = homedir47().replace(/\\/g, "/");
107605
+ if (normalized === home6)
107649
107606
  return "~";
107650
- if (normalized.startsWith(`${home9}/`)) {
107651
- return normalized.replace(home9, "~");
107607
+ if (normalized.startsWith(`${home6}/`)) {
107608
+ return normalized.replace(home6, "~");
107652
107609
  }
107653
107610
  return normalized;
107654
107611
  }
@@ -108102,8 +108059,8 @@ function pickGenericModel(models) {
108102
108059
  return sorted[0] ?? null;
108103
108060
  }
108104
108061
  async function resolveOpenCodeDefaultModel(opts = {}) {
108105
- const home9 = opts.homeDir ?? homedir49();
108106
- const authedProviders = await readAuthedProviders(home9);
108062
+ const home6 = opts.homeDir ?? homedir49();
108063
+ const authedProviders = await readAuthedProviders(home6);
108107
108064
  if (authedProviders.length === 0) {
108108
108065
  return { ok: false, reason: "no-auth", authedProviders: [] };
108109
108066
  }
@@ -109182,15 +109139,16 @@ async function migrateCommand(options2) {
109182
109139
  const scope = resolveMigrationScope(process.argv.slice(2), options2);
109183
109140
  const spinner = de();
109184
109141
  spinner.start("Discovering portable items...");
109185
- const agentSource = scope.agents ? getAgentSourcePath() : null;
109186
- const commandSource = scope.commands ? getCommandSourcePath() : null;
109187
- const skillSource = scope.skills ? getSkillSourcePath() : null;
109188
- const hooksSource = scope.hooks ? getHooksSourcePath() : null;
109189
- const rulesSourcePath = scope.rules ? getRulesSourcePath() : null;
109142
+ const sourceGlobalOnly = options2.global === true;
109143
+ const agentSource = scope.agents ? getAgentSourcePath(sourceGlobalOnly) : null;
109144
+ const commandSource = scope.commands ? getCommandSourcePath(sourceGlobalOnly) : null;
109145
+ const skillSource = scope.skills ? getSkillSourcePath(sourceGlobalOnly) : null;
109146
+ const hooksSource = scope.hooks ? getHooksSourcePath(sourceGlobalOnly) : null;
109147
+ const rulesSourcePath = scope.rules ? getRulesSourcePath(sourceGlobalOnly) : null;
109190
109148
  const agents2 = agentSource ? await discoverAgents(agentSource) : [];
109191
109149
  const commands = commandSource ? await discoverCommands(commandSource) : [];
109192
109150
  const skills = skillSource ? await discoverSkills(skillSource) : [];
109193
- const configItem = scope.config ? await discoverConfig(options2.source) : null;
109151
+ const configItem = scope.config ? await discoverConfig(options2.source ?? (sourceGlobalOnly ? getConfigSourcePath(true) : undefined)) : null;
109194
109152
  const ruleItems = rulesSourcePath ? await discoverRules(rulesSourcePath) : [];
109195
109153
  const { items: hookItems, skippedShellHooks } = hooksSource ? await discoverHooks(hooksSource) : { items: [], skippedShellHooks: [] };
109196
109154
  if (skippedShellHooks.length > 0) {
@@ -109338,7 +109296,11 @@ async function migrateCommand(options2) {
109338
109296
  title: "ck migrate"
109339
109297
  }).join(`
109340
109298
  `));
109341
- f2.info(import_picocolors30.default.dim(` CWD: ${process.cwd()}`));
109299
+ if (sourceGlobalOnly) {
109300
+ f2.info(import_picocolors30.default.dim(` Scope: global (--global / -g) - reading from ${formatDisplayPath(join142(homedir51(), ".claude"))}`));
109301
+ } else {
109302
+ f2.info(import_picocolors30.default.dim(` CWD: ${process.cwd()}`));
109303
+ }
109342
109304
  console.log();
109343
109305
  console.log(renderPanel({
109344
109306
  title: "Found",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudekit-cli",
3
- "version": "4.1.0",
3
+ "version": "4.1.1-dev.2",
4
4
  "description": "CLI tool for bootstrapping and updating ClaudeKit projects",
5
5
  "type": "module",
6
6
  "repository": {
@@ -44,6 +44,7 @@
44
44
  "dev:all": "./scripts/dev-quick-start.sh all",
45
45
  "metrics": "bun run scripts/workflow-metrics.ts",
46
46
  "validate": "bun run typecheck && bun run lint && bun test && bun run ui:test && bun run build",
47
+ "ci:local": "bash scripts/ci-local.sh",
47
48
  "install:hooks": "./.githooks/install.sh",
48
49
  "prepare": "node -e \"try{require('child_process').execSync('git rev-parse --git-dir',{stdio:'ignore'});require('child_process').execSync('bash .githooks/install.sh',{stdio:'inherit'})}catch(e){console.warn('[i] Hook install skipped:',e.message)}\"",
49
50
  "help:check-parity": "bun run scripts/check-help-parity.ts",