claudekit-cli 4.0.0-dev.6 → 4.0.0-dev.8
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 +2 -2
- package/dist/index.js +109 -50
- package/package.json +1 -1
package/cli-manifest.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -62842,7 +62842,7 @@ var package_default;
|
|
|
62842
62842
|
var init_package = __esm(() => {
|
|
62843
62843
|
package_default = {
|
|
62844
62844
|
name: "claudekit-cli",
|
|
62845
|
-
version: "4.0.0-dev.
|
|
62845
|
+
version: "4.0.0-dev.8",
|
|
62846
62846
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
62847
62847
|
type: "module",
|
|
62848
62848
|
repository: {
|
|
@@ -64837,6 +64837,9 @@ function buildInitCommand(isGlobal, kit, beta, yes) {
|
|
|
64837
64837
|
parts.push("--beta");
|
|
64838
64838
|
return parts.join(" ");
|
|
64839
64839
|
}
|
|
64840
|
+
function resolveCkExecutable(platformName = process.platform) {
|
|
64841
|
+
return platformName === "win32" ? "ck.cmd" : "ck";
|
|
64842
|
+
}
|
|
64840
64843
|
async function fetchLatestReleaseTag(kit, beta) {
|
|
64841
64844
|
try {
|
|
64842
64845
|
const { GitHubClient: GitHubClient2 } = await Promise.resolve().then(() => (init_github_client(), exports_github_client));
|
|
@@ -64945,7 +64948,10 @@ async function promptKitUpdate(beta, yes, deps) {
|
|
|
64945
64948
|
const displayCmd = `ck ${args.join(" ")}`;
|
|
64946
64949
|
logger.info(`Running: ${displayCmd}`);
|
|
64947
64950
|
const spawnFn = deps?.spawnInitFn ?? ((spawnArgs) => new Promise((resolve30) => {
|
|
64948
|
-
const child = spawn2(
|
|
64951
|
+
const child = spawn2(resolveCkExecutable(), spawnArgs, {
|
|
64952
|
+
stdio: "inherit",
|
|
64953
|
+
shell: false
|
|
64954
|
+
});
|
|
64949
64955
|
child.on("close", (code) => resolve30(code ?? 1));
|
|
64950
64956
|
child.on("error", (err) => {
|
|
64951
64957
|
logger.verbose(`Failed to spawn ck init: ${err.message}`);
|
|
@@ -85508,23 +85514,43 @@ import { existsSync as existsSync55 } from "node:fs";
|
|
|
85508
85514
|
import { readdir as readdir20 } from "node:fs/promises";
|
|
85509
85515
|
import { join as join80 } from "node:path";
|
|
85510
85516
|
async function checkProjectConfigCompleteness(setup, projectDir) {
|
|
85517
|
+
const baseResult = {
|
|
85518
|
+
id: "ck-project-config-complete",
|
|
85519
|
+
name: "Project Config Completeness",
|
|
85520
|
+
group: "claudekit",
|
|
85521
|
+
priority: "standard",
|
|
85522
|
+
autoFixable: false
|
|
85523
|
+
};
|
|
85511
85524
|
if (setup.project.path === setup.global.path) {
|
|
85512
85525
|
return {
|
|
85513
|
-
|
|
85514
|
-
name: "Project Config Completeness",
|
|
85515
|
-
group: "claudekit",
|
|
85516
|
-
priority: "standard",
|
|
85526
|
+
...baseResult,
|
|
85517
85527
|
status: "info",
|
|
85518
|
-
message: "Not in a project directory"
|
|
85519
|
-
|
|
85528
|
+
message: "Not in a project directory"
|
|
85529
|
+
};
|
|
85530
|
+
}
|
|
85531
|
+
const hasGlobalInstall = !!setup.global.metadata;
|
|
85532
|
+
const hasProjectOptIn = !!setup.project.metadata;
|
|
85533
|
+
if (!hasProjectOptIn) {
|
|
85534
|
+
if (hasGlobalInstall) {
|
|
85535
|
+
return {
|
|
85536
|
+
...baseResult,
|
|
85537
|
+
status: "info",
|
|
85538
|
+
message: "Using global ClaudeKit (no project override)",
|
|
85539
|
+
details: "Run 'ck init' here only if you want project-specific agents/skills/rules"
|
|
85540
|
+
};
|
|
85541
|
+
}
|
|
85542
|
+
return {
|
|
85543
|
+
...baseResult,
|
|
85544
|
+
status: "warn",
|
|
85545
|
+
message: "ClaudeKit not installed",
|
|
85546
|
+
suggestion: "Run 'ck init' (choose global or project scope when prompted)"
|
|
85520
85547
|
};
|
|
85521
85548
|
}
|
|
85522
85549
|
const projectClaudeDir = join80(projectDir, ".claude");
|
|
85523
85550
|
const requiredDirs = ["agents", "commands", "skills"];
|
|
85524
85551
|
const missingDirs = [];
|
|
85525
85552
|
for (const dir of requiredDirs) {
|
|
85526
|
-
|
|
85527
|
-
if (!existsSync55(dirPath)) {
|
|
85553
|
+
if (!existsSync55(join80(projectClaudeDir, dir))) {
|
|
85528
85554
|
missingDirs.push(dir);
|
|
85529
85555
|
}
|
|
85530
85556
|
}
|
|
@@ -85537,39 +85563,27 @@ async function checkProjectConfigCompleteness(setup, projectDir) {
|
|
|
85537
85563
|
const totalRequired = requiredDirs.length + 1;
|
|
85538
85564
|
if (hasOnlyClaudeMd || missingDirs.length === totalRequired) {
|
|
85539
85565
|
return {
|
|
85540
|
-
|
|
85541
|
-
name: "Project Config Completeness",
|
|
85542
|
-
group: "claudekit",
|
|
85543
|
-
priority: "standard",
|
|
85566
|
+
...baseResult,
|
|
85544
85567
|
status: "fail",
|
|
85545
85568
|
message: "Incomplete configuration",
|
|
85546
85569
|
details: "Only CLAUDE.md found - missing agents, commands, rules, skills",
|
|
85547
|
-
suggestion: "Run 'ck init' to install complete ClaudeKit in project"
|
|
85548
|
-
autoFixable: false
|
|
85570
|
+
suggestion: "Run 'ck init' to install complete ClaudeKit in project"
|
|
85549
85571
|
};
|
|
85550
85572
|
}
|
|
85551
85573
|
if (missingDirs.length > 0) {
|
|
85552
85574
|
return {
|
|
85553
|
-
|
|
85554
|
-
name: "Project Config Completeness",
|
|
85555
|
-
group: "claudekit",
|
|
85556
|
-
priority: "standard",
|
|
85575
|
+
...baseResult,
|
|
85557
85576
|
status: "warn",
|
|
85558
85577
|
message: `Missing ${missingDirs.length} directories`,
|
|
85559
85578
|
details: `Missing: ${missingDirs.join(", ")}`,
|
|
85560
|
-
suggestion: "Run 'ck init' to update project configuration"
|
|
85561
|
-
autoFixable: false
|
|
85579
|
+
suggestion: "Run 'ck init' to update project configuration"
|
|
85562
85580
|
};
|
|
85563
85581
|
}
|
|
85564
85582
|
return {
|
|
85565
|
-
|
|
85566
|
-
name: "Project Config Completeness",
|
|
85567
|
-
group: "claudekit",
|
|
85568
|
-
priority: "standard",
|
|
85583
|
+
...baseResult,
|
|
85569
85584
|
status: "pass",
|
|
85570
85585
|
message: "Complete configuration",
|
|
85571
|
-
details: projectClaudeDir
|
|
85572
|
-
autoFixable: false
|
|
85586
|
+
details: projectClaudeDir
|
|
85573
85587
|
};
|
|
85574
85588
|
}
|
|
85575
85589
|
// src/domains/health-checks/checkers/env-keys-checker.ts
|
|
@@ -98985,39 +98999,82 @@ class TarExtractor {
|
|
|
98985
98999
|
}
|
|
98986
99000
|
|
|
98987
99001
|
// src/domains/installation/extraction/zip-extractor.ts
|
|
98988
|
-
init_environment();
|
|
98989
99002
|
init_logger();
|
|
98990
99003
|
var import_extract_zip = __toESM(require_extract_zip(), 1);
|
|
98991
99004
|
import { execFile as execFile10 } from "node:child_process";
|
|
98992
99005
|
import { copyFile as copyFile5, mkdir as mkdir29, readdir as readdir25, rm as rm11, stat as stat16 } from "node:fs/promises";
|
|
98993
99006
|
import { join as join102 } from "node:path";
|
|
99007
|
+
import { promisify as promisify15 } from "node:util";
|
|
99008
|
+
|
|
99009
|
+
// src/domains/installation/extraction/native-zip-commands.ts
|
|
99010
|
+
var NATIVE_EXTRACT_TIMEOUT_MS = 120000;
|
|
99011
|
+
function getNativeZipCommands(archivePath, destDir, platformName = process.platform) {
|
|
99012
|
+
if (platformName === "darwin") {
|
|
99013
|
+
return [
|
|
99014
|
+
{
|
|
99015
|
+
label: "native unzip",
|
|
99016
|
+
command: "unzip",
|
|
99017
|
+
args: ["-o", "-q", archivePath, "-d", destDir]
|
|
99018
|
+
}
|
|
99019
|
+
];
|
|
99020
|
+
}
|
|
99021
|
+
if (platformName === "win32") {
|
|
99022
|
+
return [
|
|
99023
|
+
{
|
|
99024
|
+
label: "Windows tar.exe",
|
|
99025
|
+
command: "tar.exe",
|
|
99026
|
+
args: ["-xf", archivePath, "-C", destDir]
|
|
99027
|
+
},
|
|
99028
|
+
{
|
|
99029
|
+
label: "PowerShell Expand-Archive",
|
|
99030
|
+
command: "powershell.exe",
|
|
99031
|
+
args: [
|
|
99032
|
+
"-NoProfile",
|
|
99033
|
+
"-NonInteractive",
|
|
99034
|
+
"-Command",
|
|
99035
|
+
"Expand-Archive -LiteralPath $args[0] -DestinationPath $args[1] -Force",
|
|
99036
|
+
archivePath,
|
|
99037
|
+
destDir
|
|
99038
|
+
]
|
|
99039
|
+
}
|
|
99040
|
+
];
|
|
99041
|
+
}
|
|
99042
|
+
return [];
|
|
99043
|
+
}
|
|
99044
|
+
|
|
99045
|
+
// src/domains/installation/extraction/zip-extractor.ts
|
|
99046
|
+
var execFileAsync7 = promisify15(execFile10);
|
|
99047
|
+
|
|
98994
99048
|
class ZipExtractor {
|
|
98995
|
-
async
|
|
98996
|
-
|
|
99049
|
+
async tryNativeExtraction(archivePath, destDir) {
|
|
99050
|
+
const commands = getNativeZipCommands(archivePath, destDir);
|
|
99051
|
+
if (commands.length === 0) {
|
|
98997
99052
|
return false;
|
|
98998
99053
|
}
|
|
98999
|
-
|
|
99000
|
-
|
|
99001
|
-
|
|
99002
|
-
|
|
99003
|
-
|
|
99004
|
-
|
|
99005
|
-
|
|
99006
|
-
}
|
|
99007
|
-
logger.debug("Native unzip succeeded");
|
|
99008
|
-
resolve37(true);
|
|
99054
|
+
for (const nativeCommand of commands) {
|
|
99055
|
+
try {
|
|
99056
|
+
await rm11(destDir, { recursive: true, force: true });
|
|
99057
|
+
await mkdir29(destDir, { recursive: true });
|
|
99058
|
+
await execFileAsync7(nativeCommand.command, nativeCommand.args, {
|
|
99059
|
+
timeout: NATIVE_EXTRACT_TIMEOUT_MS,
|
|
99060
|
+
windowsHide: true
|
|
99009
99061
|
});
|
|
99010
|
-
|
|
99011
|
-
|
|
99012
|
-
|
|
99013
|
-
|
|
99014
|
-
|
|
99062
|
+
logger.debug(`${nativeCommand.label} succeeded`);
|
|
99063
|
+
return true;
|
|
99064
|
+
} catch (err) {
|
|
99065
|
+
const error = err;
|
|
99066
|
+
logger.debug(`${nativeCommand.label} failed: ${error.stderr || error.message}`);
|
|
99067
|
+
}
|
|
99068
|
+
}
|
|
99069
|
+
await rm11(destDir, { recursive: true, force: true });
|
|
99070
|
+
await mkdir29(destDir, { recursive: true });
|
|
99071
|
+
return false;
|
|
99015
99072
|
}
|
|
99016
99073
|
async extract(archivePath, destDir, shouldExclude, sizeTracker) {
|
|
99017
99074
|
const tempExtractDir = `${destDir}-temp`;
|
|
99018
99075
|
await mkdir29(tempExtractDir, { recursive: true });
|
|
99019
99076
|
try {
|
|
99020
|
-
const nativeSuccess = await this.
|
|
99077
|
+
const nativeSuccess = await this.tryNativeExtraction(archivePath, tempExtractDir);
|
|
99021
99078
|
if (!nativeSuccess) {
|
|
99022
99079
|
logger.debug("Using extract-zip library");
|
|
99023
99080
|
let extractedCount = 0;
|
|
@@ -99120,9 +99177,11 @@ class DownloadManager {
|
|
|
99120
99177
|
}
|
|
99121
99178
|
const spinner = createSpinner("Extracting files...").start();
|
|
99122
99179
|
const slowExtractionWarning = setTimeout(() => {
|
|
99123
|
-
spinner.text = "Extracting files...
|
|
99180
|
+
spinner.text = "Extracting files... this may take a while";
|
|
99124
99181
|
if (isMacOS()) {
|
|
99125
99182
|
logger.debug("Slow extraction detected on macOS - Spotlight indexing may be interfering");
|
|
99183
|
+
} else if (isWindows()) {
|
|
99184
|
+
logger.debug("Slow extraction detected on Windows - antivirus scanning may be interfering");
|
|
99126
99185
|
}
|
|
99127
99186
|
}, SLOW_EXTRACTION_THRESHOLD_MS);
|
|
99128
99187
|
try {
|
|
@@ -105483,8 +105542,8 @@ async function detectAccessibleKits() {
|
|
|
105483
105542
|
// src/domains/github/preflight-checker.ts
|
|
105484
105543
|
init_logger();
|
|
105485
105544
|
import { exec as exec8 } from "node:child_process";
|
|
105486
|
-
import { promisify as
|
|
105487
|
-
var execAsync8 =
|
|
105545
|
+
import { promisify as promisify16 } from "node:util";
|
|
105546
|
+
var execAsync8 = promisify16(exec8);
|
|
105488
105547
|
function createSuccessfulPreflightResult() {
|
|
105489
105548
|
return {
|
|
105490
105549
|
success: true,
|