claudekit-cli 3.40.0 → 3.40.1-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/README.md +3 -1
- package/bin/ck.js +17 -128
- package/dist/index.js +85 -78
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Command-line tool and web dashboard for managing ClaudeKit projects.
|
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
ClaudeKit Config UI (`ck`) provides both CLI and web dashboard for managing ClaudeKit projects.
|
|
9
|
+
ClaudeKit Config UI (`ck`) provides both CLI and web dashboard for managing ClaudeKit projects. It is built with Bun, TypeScript, and React for development, while the published CLI runs on plain Node.js so end users do not need Bun installed.
|
|
10
10
|
|
|
11
11
|
**Key Features:**
|
|
12
12
|
- **CLI Commands (16)**: new, init, config, projects, setup, skills, agents, commands, migrate, doctor, versions, update, uninstall, watch, content, easter-egg
|
|
@@ -50,6 +50,8 @@ Without a purchased kit and repository access, the CLI will not be able to downl
|
|
|
50
50
|
|
|
51
51
|
The ClaudeKit CLI is published on npm at [npmjs.com/package/claudekit-cli](https://www.npmjs.com/package/claudekit-cli).
|
|
52
52
|
|
|
53
|
+
End-user runtime note: global installs from `npm`, `pnpm`, `yarn`, or `bun` all execute the packaged Node.js CLI. Bun is optional for users and only needed for local ClaudeKit CLI development workflows.
|
|
54
|
+
|
|
53
55
|
### Using npm (Recommended)
|
|
54
56
|
|
|
55
57
|
```bash
|
package/bin/ck.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* CLI entry point
|
|
5
|
-
*
|
|
4
|
+
* CLI entry point for npm-installed ClaudeKit CLI.
|
|
5
|
+
* Runs the packaged Node-targeted bundle without requiring Bun on user machines.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
10
9
|
import { dirname, join } from "node:path";
|
|
11
10
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
12
11
|
|
|
13
|
-
// Minimum required Node.js version (major.minor)
|
|
14
12
|
const MIN_NODE_VERSION = [18, 0];
|
|
13
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
|
|
15
|
+
const getErrorMessage = (err) => {
|
|
16
|
+
return err instanceof Error ? err.message : String(err);
|
|
17
|
+
};
|
|
15
18
|
|
|
16
|
-
/**
|
|
17
|
-
* Check if the current Node.js version meets minimum requirements.
|
|
18
|
-
* Required because dependencies like ora@8 use ES2022+ features.
|
|
19
|
-
*/
|
|
20
19
|
const checkNodeVersion = () => {
|
|
21
20
|
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
22
21
|
const [minMajor, minMinor] = MIN_NODE_VERSION;
|
|
@@ -30,136 +29,26 @@ const checkNodeVersion = () => {
|
|
|
30
29
|
}
|
|
31
30
|
};
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
checkNodeVersion();
|
|
35
|
-
|
|
36
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Extract error message safely with type guard
|
|
40
|
-
*/
|
|
41
|
-
const getErrorMessage = (err) => {
|
|
42
|
-
return err instanceof Error ? err.message : String(err);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Check if bun runtime is available on the system.
|
|
47
|
-
* dist/index.js may contain bun-specific imports (bun:sqlite) that Node.js can't handle.
|
|
48
|
-
* Result is cached to avoid repeated execSync calls.
|
|
49
|
-
*/
|
|
50
|
-
let _bunAvailable = undefined;
|
|
51
|
-
const hasBun = () => {
|
|
52
|
-
if (_bunAvailable !== undefined) return _bunAvailable;
|
|
53
|
-
try {
|
|
54
|
-
execSync("bun --version", { stdio: "ignore", timeout: 3000 });
|
|
55
|
-
_bunAvailable = true;
|
|
56
|
-
} catch {
|
|
57
|
-
_bunAvailable = false;
|
|
58
|
-
}
|
|
59
|
-
return _bunAvailable;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
let _installedVersion = undefined;
|
|
63
|
-
const readInstalledPackageVersion = () => {
|
|
64
|
-
if (_installedVersion !== undefined) return _installedVersion;
|
|
65
|
-
try {
|
|
66
|
-
const packageJsonPath = join(__dirname, "..", "package.json");
|
|
67
|
-
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
68
|
-
_installedVersion = typeof packageJson.version === "string" ? packageJson.version : null;
|
|
69
|
-
} catch {
|
|
70
|
-
_installedVersion = null;
|
|
71
|
-
}
|
|
72
|
-
return _installedVersion;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const isDevPrerelease = () => {
|
|
76
|
-
const version = readInstalledPackageVersion();
|
|
77
|
-
return typeof version === "string" && /-dev\.\d+$/i.test(version);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const shouldWarnForBunFallback = () => !isDevPrerelease();
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Run CLI via bun runtime. Preferred over Node.js when dist/index.js contains
|
|
84
|
-
* bun-specific imports (e.g., bun:sqlite) that the Node.js ESM loader rejects.
|
|
85
|
-
* Uses spawnSync to hand full terminal control to bun — this prevents Unicode
|
|
86
|
-
* rendering issues (garbled @clack/prompts box-drawing chars) that occur when
|
|
87
|
-
* bun runs as an async child of a Node.js parent process.
|
|
88
|
-
* @param {boolean} showWarning - Whether to show runtime info message
|
|
89
|
-
* @returns {boolean} true if bun ran successfully, false if spawn failed
|
|
90
|
-
*/
|
|
91
|
-
const runWithBun = (showWarning = false) => {
|
|
32
|
+
const runWithNode = async () => {
|
|
92
33
|
const distPath = join(__dirname, "..", "dist", "index.js");
|
|
93
34
|
if (!existsSync(distPath)) {
|
|
94
|
-
throw new Error(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
console.error("[i] Using bun runtime");
|
|
98
|
-
}
|
|
99
|
-
const result = spawnSync("bun", [distPath, ...process.argv.slice(2)], {
|
|
100
|
-
stdio: "inherit",
|
|
101
|
-
windowsHide: true,
|
|
102
|
-
});
|
|
103
|
-
if (result.error) {
|
|
104
|
-
// bun spawn failed (e.g., ENOENT) — caller handles fallback
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
if (result.signal) {
|
|
108
|
-
process.kill(process.pid, result.signal);
|
|
35
|
+
throw new Error(
|
|
36
|
+
"Compiled distribution not found. Reinstall ClaudeKit CLI or report a packaging issue.",
|
|
37
|
+
);
|
|
109
38
|
}
|
|
110
|
-
process.exit(result.status || 0);
|
|
111
|
-
};
|
|
112
39
|
|
|
113
|
-
/**
|
|
114
|
-
* Run CLI via Node.js as last-resort fallback (slower, no bun: protocol support).
|
|
115
|
-
* @param {boolean} showWarning - Whether to show fallback warning message
|
|
116
|
-
*/
|
|
117
|
-
const runWithNode = async (showWarning = false) => {
|
|
118
|
-
const distPath = join(__dirname, "..", "dist", "index.js");
|
|
119
|
-
if (!existsSync(distPath)) {
|
|
120
|
-
throw new Error("Compiled distribution not found. This may indicate a packaging issue.");
|
|
121
|
-
}
|
|
122
|
-
if (showWarning) {
|
|
123
|
-
console.error("[i] Using Node.js runtime (slower startup)");
|
|
124
|
-
}
|
|
125
40
|
const distUrl = pathToFileURL(distPath).href;
|
|
126
|
-
|
|
127
|
-
await import(distUrl);
|
|
128
|
-
} catch (importErr) {
|
|
129
|
-
throw new Error(`Failed to load CLI module: ${getErrorMessage(importErr)}`);
|
|
130
|
-
}
|
|
41
|
+
await import(distUrl);
|
|
131
42
|
};
|
|
132
43
|
|
|
133
|
-
/**
|
|
134
|
-
* Main execution — try Bun first, fall back to Node.js
|
|
135
|
-
*/
|
|
136
44
|
const main = async () => {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
// Prefer bun — dist/index.js may contain bun-specific imports (bun:sqlite)
|
|
140
|
-
if (hasBun()) {
|
|
141
|
-
const bunOk = runWithBun(false);
|
|
142
|
-
if (!bunOk && showBunWarning) {
|
|
143
|
-
console.error("[i] Bun spawn failed, falling back to Node.js");
|
|
144
|
-
}
|
|
145
|
-
}
|
|
45
|
+
checkNodeVersion();
|
|
146
46
|
|
|
147
|
-
// Last resort: Node.js (works for stable builds without bun: imports)
|
|
148
47
|
try {
|
|
149
|
-
await runWithNode(
|
|
48
|
+
await runWithNode();
|
|
150
49
|
} catch (err) {
|
|
151
|
-
|
|
152
|
-
console.error(
|
|
153
|
-
if (errMsg.includes("bun:") || errMsg.includes("Received protocol")) {
|
|
154
|
-
console.error("");
|
|
155
|
-
console.error("This version of ClaudeKit CLI requires the bun runtime.");
|
|
156
|
-
console.error("Install bun: curl -fsSL https://bun.sh/install | bash");
|
|
157
|
-
console.error("Or switch to stable: npm install -g claudekit-cli@latest");
|
|
158
|
-
} else {
|
|
159
|
-
console.error(
|
|
160
|
-
"Please report this issue at: https://github.com/mrgoonie/claudekit-cli/issues",
|
|
161
|
-
);
|
|
162
|
-
}
|
|
50
|
+
console.error(`[X] Failed to run CLI: ${getErrorMessage(err)}`);
|
|
51
|
+
console.error("Please report this issue at: https://github.com/mrgoonie/claudekit-cli/issues");
|
|
163
52
|
process.exit(1);
|
|
164
53
|
}
|
|
165
54
|
};
|
package/dist/index.js
CHANGED
|
@@ -49974,13 +49974,14 @@ var init_config_discovery = __esm(() => {
|
|
|
49974
49974
|
|
|
49975
49975
|
// src/commands/portable/hooks-settings-merger.ts
|
|
49976
49976
|
import { existsSync as existsSync22, mkdirSync, renameSync, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
49977
|
+
import { readFile as readFile17 } from "node:fs/promises";
|
|
49977
49978
|
import { basename as basename8, dirname as dirname9, join as join32 } from "node:path";
|
|
49978
49979
|
async function inspectHooksSettings(settingsPath) {
|
|
49979
49980
|
try {
|
|
49980
49981
|
if (!existsSync22(settingsPath)) {
|
|
49981
49982
|
return { status: "missing-file" };
|
|
49982
49983
|
}
|
|
49983
|
-
const raw = await
|
|
49984
|
+
const raw = await readFile17(settingsPath, "utf8");
|
|
49984
49985
|
const parsed = JSON.parse(raw);
|
|
49985
49986
|
if (!parsed.hooks || typeof parsed.hooks !== "object") {
|
|
49986
49987
|
return { status: "missing-hooks" };
|
|
@@ -50052,7 +50053,7 @@ async function mergeHooksIntoSettings(targetSettingsPath, newHooks) {
|
|
|
50052
50053
|
if (existsSync22(targetSettingsPath)) {
|
|
50053
50054
|
let raw;
|
|
50054
50055
|
try {
|
|
50055
|
-
raw = await
|
|
50056
|
+
raw = await readFile17(targetSettingsPath, "utf8");
|
|
50056
50057
|
existingSettings = JSON.parse(raw);
|
|
50057
50058
|
} catch {
|
|
50058
50059
|
existingSettings = {};
|
|
@@ -52035,7 +52036,7 @@ var require_semver2 = __commonJS((exports, module) => {
|
|
|
52035
52036
|
|
|
52036
52037
|
// src/commands/portable/portable-manifest.ts
|
|
52037
52038
|
import { existsSync as existsSync23 } from "node:fs";
|
|
52038
|
-
import { readFile as
|
|
52039
|
+
import { readFile as readFile18 } from "node:fs/promises";
|
|
52039
52040
|
import path2 from "node:path";
|
|
52040
52041
|
async function loadPortableManifest(kitPath) {
|
|
52041
52042
|
const manifestPath = path2.join(kitPath, "portable-manifest.json");
|
|
@@ -52044,7 +52045,7 @@ async function loadPortableManifest(kitPath) {
|
|
|
52044
52045
|
logger.verbose("No portable-manifest.json found — no evolution tracking");
|
|
52045
52046
|
return null;
|
|
52046
52047
|
}
|
|
52047
|
-
const raw = await
|
|
52048
|
+
const raw = await readFile18(manifestPath, "utf-8");
|
|
52048
52049
|
let parsed;
|
|
52049
52050
|
try {
|
|
52050
52051
|
parsed = JSON.parse(raw);
|
|
@@ -52155,7 +52156,7 @@ var init_reconcile_registry_backfill = __esm(() => {
|
|
|
52155
52156
|
|
|
52156
52157
|
// src/commands/portable/reconcile-state-builders.ts
|
|
52157
52158
|
import { existsSync as existsSync24 } from "node:fs";
|
|
52158
|
-
import { readFile as
|
|
52159
|
+
import { readFile as readFile19 } from "node:fs/promises";
|
|
52159
52160
|
function getProviderPathKeyForPortableType2(type) {
|
|
52160
52161
|
switch (type) {
|
|
52161
52162
|
case "agent":
|
|
@@ -52265,7 +52266,7 @@ async function buildTargetStates(entries, options2) {
|
|
|
52265
52266
|
const state = { path: entryPath, exists };
|
|
52266
52267
|
if (exists) {
|
|
52267
52268
|
try {
|
|
52268
|
-
const content = await
|
|
52269
|
+
const content = await readFile19(entryPath, "utf-8");
|
|
52269
52270
|
state.currentChecksum = computeContentChecksum(content);
|
|
52270
52271
|
if (groupedEntries.some((entry) => usesMergeSingleChecksums(entry))) {
|
|
52271
52272
|
state.sectionChecksums = computeManagedSectionChecksums(content);
|
|
@@ -52752,7 +52753,7 @@ var init_reconciler = __esm(() => {
|
|
|
52752
52753
|
|
|
52753
52754
|
// src/commands/skills/skills-discovery.ts
|
|
52754
52755
|
import { existsSync as existsSync25 } from "node:fs";
|
|
52755
|
-
import { readFile as
|
|
52756
|
+
import { readFile as readFile20, readdir as readdir8, stat as stat6 } from "node:fs/promises";
|
|
52756
52757
|
import { homedir as homedir20 } from "node:os";
|
|
52757
52758
|
import { dirname as dirname10, join as join33 } from "node:path";
|
|
52758
52759
|
function getSkillSourcePath() {
|
|
@@ -52782,7 +52783,7 @@ async function hasSkillMd(dir) {
|
|
|
52782
52783
|
}
|
|
52783
52784
|
async function parseSkillMd(skillMdPath) {
|
|
52784
52785
|
try {
|
|
52785
|
-
const content = await
|
|
52786
|
+
const content = await readFile20(skillMdPath, "utf-8");
|
|
52786
52787
|
const { data } = import_gray_matter5.default(content);
|
|
52787
52788
|
const skillDir = dirname10(skillMdPath);
|
|
52788
52789
|
const dirName = skillDir.split(/[/\\]/).pop() || "";
|
|
@@ -52943,7 +52944,7 @@ var init_migration_result_utils = __esm(() => {
|
|
|
52943
52944
|
|
|
52944
52945
|
// src/domains/web-server/routes/migration-routes.ts
|
|
52945
52946
|
import { existsSync as existsSync26 } from "node:fs";
|
|
52946
|
-
import { readFile as
|
|
52947
|
+
import { readFile as readFile21, rm as rm6 } from "node:fs/promises";
|
|
52947
52948
|
import { homedir as homedir21 } from "node:os";
|
|
52948
52949
|
import { basename as basename9, join as join34, resolve as resolve8 } from "node:path";
|
|
52949
52950
|
function isDisallowedControlCode(codePoint) {
|
|
@@ -53608,9 +53609,9 @@ function registerMigrationRoutes(app) {
|
|
|
53608
53609
|
const readmePath = `${skill.path}/README.md`;
|
|
53609
53610
|
let content;
|
|
53610
53611
|
if (existsSync26(skillMdPath)) {
|
|
53611
|
-
content = await
|
|
53612
|
+
content = await readFile21(skillMdPath, "utf-8");
|
|
53612
53613
|
} else if (existsSync26(readmePath)) {
|
|
53613
|
-
content = await
|
|
53614
|
+
content = await readFile21(readmePath, "utf-8");
|
|
53614
53615
|
} else {
|
|
53615
53616
|
console.warn(`[migrate] Skill "${sanitizeUntrusted(skill.name, 80)}" has neither SKILL.md nor README.md, skipping`);
|
|
53616
53617
|
continue;
|
|
@@ -55063,7 +55064,7 @@ var init_plan_routes = __esm(() => {
|
|
|
55063
55064
|
|
|
55064
55065
|
// src/domains/web-server/routes/project-routes.ts
|
|
55065
55066
|
import { existsSync as existsSync31 } from "node:fs";
|
|
55066
|
-
import { readFile as
|
|
55067
|
+
import { readFile as readFile22 } from "node:fs/promises";
|
|
55067
55068
|
import { homedir as homedir22 } from "node:os";
|
|
55068
55069
|
import { basename as basename13, join as join37, resolve as resolve11 } from "node:path";
|
|
55069
55070
|
function registerProjectRoutes(app) {
|
|
@@ -55305,7 +55306,7 @@ async function buildProjectInfoFromRegistry(registered) {
|
|
|
55305
55306
|
let metadata = {};
|
|
55306
55307
|
try {
|
|
55307
55308
|
if (hasClaudeDir && existsSync31(metadataPath)) {
|
|
55308
|
-
const content = await
|
|
55309
|
+
const content = await readFile22(metadataPath, "utf-8");
|
|
55309
55310
|
try {
|
|
55310
55311
|
metadata = JSON.parse(content);
|
|
55311
55312
|
} catch {}
|
|
@@ -55347,7 +55348,7 @@ async function detectAndBuildProjectInfo(path4, id) {
|
|
|
55347
55348
|
let metadata = {};
|
|
55348
55349
|
try {
|
|
55349
55350
|
if (existsSync31(metadataPath)) {
|
|
55350
|
-
const content = await
|
|
55351
|
+
const content = await readFile22(metadataPath, "utf-8");
|
|
55351
55352
|
try {
|
|
55352
55353
|
metadata = JSON.parse(content);
|
|
55353
55354
|
} catch {}
|
|
@@ -55681,7 +55682,7 @@ var init_agents = __esm(() => {
|
|
|
55681
55682
|
|
|
55682
55683
|
// src/commands/skills/skills-registry.ts
|
|
55683
55684
|
import { existsSync as existsSync33 } from "node:fs";
|
|
55684
|
-
import { mkdir as mkdir9, readFile as
|
|
55685
|
+
import { mkdir as mkdir9, readFile as readFile23, writeFile as writeFile11 } from "node:fs/promises";
|
|
55685
55686
|
import { homedir as homedir26 } from "node:os";
|
|
55686
55687
|
import { dirname as dirname16, join as join40, sep as sep5 } from "node:path";
|
|
55687
55688
|
function getCliVersion3() {
|
|
@@ -55718,7 +55719,7 @@ async function readRegistry() {
|
|
|
55718
55719
|
if (!existsSync33(REGISTRY_PATH2)) {
|
|
55719
55720
|
return { version: "1.0", installations: [] };
|
|
55720
55721
|
}
|
|
55721
|
-
const content = await
|
|
55722
|
+
const content = await readFile23(REGISTRY_PATH2, "utf-8");
|
|
55722
55723
|
const data = JSON.parse(content);
|
|
55723
55724
|
const registry = SkillRegistrySchema.parse(data);
|
|
55724
55725
|
if (migrateRegistryPaths(registry)) {
|
|
@@ -56555,7 +56556,7 @@ var init_pnpm_detector = __esm(() => {
|
|
|
56555
56556
|
|
|
56556
56557
|
// src/domains/installation/package-managers/detection-core.ts
|
|
56557
56558
|
import { existsSync as existsSync36, realpathSync as realpathSync2 } from "node:fs";
|
|
56558
|
-
import { chmod as chmod2, mkdir as mkdir11, readFile as
|
|
56559
|
+
import { chmod as chmod2, mkdir as mkdir11, readFile as readFile24, writeFile as writeFile12 } from "node:fs/promises";
|
|
56559
56560
|
import { platform as platform4 } from "node:os";
|
|
56560
56561
|
import { join as join43 } from "node:path";
|
|
56561
56562
|
function detectFromBinaryPath() {
|
|
@@ -56638,7 +56639,7 @@ async function readCachedPm() {
|
|
|
56638
56639
|
if (!existsSync36(cacheFile)) {
|
|
56639
56640
|
return null;
|
|
56640
56641
|
}
|
|
56641
|
-
const content = await
|
|
56642
|
+
const content = await readFile24(cacheFile, "utf-8");
|
|
56642
56643
|
const data = JSON.parse(content);
|
|
56643
56644
|
if (!data.packageManager || !data.detectedAt) {
|
|
56644
56645
|
logger.debug("Invalid cache structure, ignoring");
|
|
@@ -57328,7 +57329,7 @@ var package_default;
|
|
|
57328
57329
|
var init_package = __esm(() => {
|
|
57329
57330
|
package_default = {
|
|
57330
57331
|
name: "claudekit-cli",
|
|
57331
|
-
version: "3.
|
|
57332
|
+
version: "3.40.1-dev.1",
|
|
57332
57333
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
57333
57334
|
type: "module",
|
|
57334
57335
|
repository: {
|
|
@@ -57352,7 +57353,7 @@ var init_package = __esm(() => {
|
|
|
57352
57353
|
"dashboard:dev": "cd src/ui && bun install --silent && cd ../.. && bun run src/index.ts config ui --dev",
|
|
57353
57354
|
"ui:build": "cd src/ui && bun install --silent && bun run build",
|
|
57354
57355
|
"ui:dev": "cd src/ui && bun run dev",
|
|
57355
|
-
build: `bun build src/index.ts --outdir dist --target node --external @octokit/rest && node -e "const fs=require('fs'),f='dist/index.js',c=fs.readFileSync(f,'utf-8');fs.writeFileSync(f,c.replace(/^#!.*\\n\\/\\/ @bun\\n/,''))"`,
|
|
57356
|
+
build: `bun build src/index.ts --outdir dist --target node --external @octokit/rest --external better-sqlite3 && node -e "const fs=require('fs'),f='dist/index.js',c=fs.readFileSync(f,'utf-8');fs.writeFileSync(f,c.replace(/^#!.*\\n\\/\\/ @bun\\n/,''))"`,
|
|
57356
57357
|
"verify:package": "node scripts/prepublish-check.js",
|
|
57357
57358
|
test: "bun test",
|
|
57358
57359
|
"test:integration": "CK_RUN_CLI_INTEGRATION=1 bun test tests/integration/cli.test.ts",
|
|
@@ -57380,7 +57381,6 @@ var init_package = __esm(() => {
|
|
|
57380
57381
|
author: "ClaudeKit",
|
|
57381
57382
|
license: "MIT",
|
|
57382
57383
|
engines: {
|
|
57383
|
-
bun: ">=1.3.2",
|
|
57384
57384
|
node: ">=18.0.0"
|
|
57385
57385
|
},
|
|
57386
57386
|
dependencies: {
|
|
@@ -57880,7 +57880,7 @@ var init_error_handler2 = __esm(() => {
|
|
|
57880
57880
|
|
|
57881
57881
|
// src/domains/versioning/release-cache.ts
|
|
57882
57882
|
import { existsSync as existsSync37 } from "node:fs";
|
|
57883
|
-
import { mkdir as mkdir12, readFile as
|
|
57883
|
+
import { mkdir as mkdir12, readFile as readFile27, unlink as unlink6, writeFile as writeFile14 } from "node:fs/promises";
|
|
57884
57884
|
import { join as join46 } from "node:path";
|
|
57885
57885
|
var ReleaseCacheEntrySchema, ReleaseCache;
|
|
57886
57886
|
var init_release_cache = __esm(() => {
|
|
@@ -57905,7 +57905,7 @@ var init_release_cache = __esm(() => {
|
|
|
57905
57905
|
logger.debug(`Release cache not found for key: ${key}`);
|
|
57906
57906
|
return null;
|
|
57907
57907
|
}
|
|
57908
|
-
const content = await
|
|
57908
|
+
const content = await readFile27(cacheFile, "utf-8");
|
|
57909
57909
|
const parsed = JSON.parse(content);
|
|
57910
57910
|
const cacheEntry = ReleaseCacheEntrySchema.parse(parsed);
|
|
57911
57911
|
if (this.isExpired(cacheEntry.timestamp)) {
|
|
@@ -58931,8 +58931,7 @@ async function updateCliCommand(options2, deps = getDefaultUpdateCliCommandDeps(
|
|
|
58931
58931
|
}
|
|
58932
58932
|
s.start("Checking for updates...");
|
|
58933
58933
|
let targetVersion = null;
|
|
58934
|
-
const
|
|
58935
|
-
const usePrereleaseChannel = opts.dev || opts.beta || preferInstalledPrereleaseChannel;
|
|
58934
|
+
const usePrereleaseChannel = opts.dev || opts.beta;
|
|
58936
58935
|
if (opts.release && opts.release !== "latest") {
|
|
58937
58936
|
try {
|
|
58938
58937
|
const exists = await npmRegistryClient.versionExists(CLAUDEKIT_CLI_NPM_PACKAGE_NAME, opts.release, registryUrl);
|
|
@@ -59108,7 +59107,7 @@ var init_update_cli = __esm(() => {
|
|
|
59108
59107
|
|
|
59109
59108
|
// src/domains/versioning/version-cache.ts
|
|
59110
59109
|
import { existsSync as existsSync38 } from "node:fs";
|
|
59111
|
-
import { mkdir as mkdir13, readFile as
|
|
59110
|
+
import { mkdir as mkdir13, readFile as readFile29, writeFile as writeFile15 } from "node:fs/promises";
|
|
59112
59111
|
import { join as join48 } from "node:path";
|
|
59113
59112
|
var VersionCacheManager;
|
|
59114
59113
|
var init_version_cache = __esm(() => {
|
|
@@ -59128,7 +59127,7 @@ var init_version_cache = __esm(() => {
|
|
|
59128
59127
|
logger.debug("Version check cache not found");
|
|
59129
59128
|
return null;
|
|
59130
59129
|
}
|
|
59131
|
-
const content = await
|
|
59130
|
+
const content = await readFile29(cacheFile, "utf-8");
|
|
59132
59131
|
const cache3 = JSON.parse(content);
|
|
59133
59132
|
if (!cache3.lastCheck || !cache3.currentVersion || !cache3.latestVersion) {
|
|
59134
59133
|
logger.debug("Invalid cache structure, ignoring");
|
|
@@ -59249,7 +59248,7 @@ class CliVersionChecker {
|
|
|
59249
59248
|
return null;
|
|
59250
59249
|
}
|
|
59251
59250
|
try {
|
|
59252
|
-
const latestVersion =
|
|
59251
|
+
const latestVersion = await NpmRegistryClient.getLatestVersion(CLAUDEKIT_CLI_NPM_PACKAGE_NAME);
|
|
59253
59252
|
if (!latestVersion) {
|
|
59254
59253
|
logger.debug("Failed to fetch latest CLI version from npm");
|
|
59255
59254
|
return null;
|
|
@@ -59387,7 +59386,7 @@ var init_version_checker = __esm(() => {
|
|
|
59387
59386
|
// src/domains/web-server/routes/system-routes.ts
|
|
59388
59387
|
import { spawn as spawn3 } from "node:child_process";
|
|
59389
59388
|
import { existsSync as existsSync39 } from "node:fs";
|
|
59390
|
-
import { readFile as
|
|
59389
|
+
import { readFile as readFile30 } from "node:fs/promises";
|
|
59391
59390
|
import { join as join49 } from "node:path";
|
|
59392
59391
|
function hasCliUpdate(currentVersion, latestVersion) {
|
|
59393
59392
|
if (!latestVersion) {
|
|
@@ -59634,7 +59633,7 @@ async function getKitMetadata2(kitName) {
|
|
|
59634
59633
|
const metadataPath = join49(PathResolver.getGlobalKitDir(), "metadata.json");
|
|
59635
59634
|
if (!existsSync39(metadataPath))
|
|
59636
59635
|
return null;
|
|
59637
|
-
const content = await
|
|
59636
|
+
const content = await readFile30(metadataPath, "utf-8");
|
|
59638
59637
|
const metadata = JSON.parse(content);
|
|
59639
59638
|
if (metadata.kits?.[kitName]) {
|
|
59640
59639
|
return { version: metadata.kits[kitName].version };
|
|
@@ -65088,8 +65087,8 @@ async function installSkillsDependencies(skillsDir2, options2 = {}) {
|
|
|
65088
65087
|
logger.info(` Platform: ${platform7 === "win32" ? "Windows (PowerShell)" : "Unix (bash)"}`);
|
|
65089
65088
|
if (logger.isVerbose()) {
|
|
65090
65089
|
try {
|
|
65091
|
-
const { readFile:
|
|
65092
|
-
const scriptContent = await
|
|
65090
|
+
const { readFile: readFile37 } = await import("node:fs/promises");
|
|
65091
|
+
const scriptContent = await readFile37(scriptPath, "utf-8");
|
|
65093
65092
|
const previewLines = scriptContent.split(`
|
|
65094
65093
|
`).slice(0, 20);
|
|
65095
65094
|
logger.verbose("Script preview (first 20 lines):");
|
|
@@ -65285,11 +65284,11 @@ var init_skills_installer2 = __esm(() => {
|
|
|
65285
65284
|
|
|
65286
65285
|
// src/services/package-installer/gemini-mcp/config-manager.ts
|
|
65287
65286
|
import { existsSync as existsSync52 } from "node:fs";
|
|
65288
|
-
import { mkdir as mkdir17, readFile as
|
|
65287
|
+
import { mkdir as mkdir17, readFile as readFile37, writeFile as writeFile20 } from "node:fs/promises";
|
|
65289
65288
|
import { dirname as dirname21, join as join71 } from "node:path";
|
|
65290
65289
|
async function readJsonFile(filePath) {
|
|
65291
65290
|
try {
|
|
65292
|
-
const content = await
|
|
65291
|
+
const content = await readFile37(filePath, "utf-8");
|
|
65293
65292
|
return JSON.parse(content);
|
|
65294
65293
|
} catch (error) {
|
|
65295
65294
|
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
@@ -65303,7 +65302,7 @@ async function addGeminiToGitignore(projectDir) {
|
|
|
65303
65302
|
try {
|
|
65304
65303
|
let content = "";
|
|
65305
65304
|
if (existsSync52(gitignorePath)) {
|
|
65306
|
-
content = await
|
|
65305
|
+
content = await readFile37(gitignorePath, "utf-8");
|
|
65307
65306
|
const lines = content.split(`
|
|
65308
65307
|
`).map((line) => line.trim()).filter((line) => !line.startsWith("#"));
|
|
65309
65308
|
const geminiPatterns = [".gemini/", ".gemini", "/.gemini/", "/.gemini"];
|
|
@@ -67872,7 +67871,7 @@ __export(exports_worktree_manager, {
|
|
|
67872
67871
|
cleanupAllWorktrees: () => cleanupAllWorktrees
|
|
67873
67872
|
});
|
|
67874
67873
|
import { existsSync as existsSync62 } from "node:fs";
|
|
67875
|
-
import { readFile as
|
|
67874
|
+
import { readFile as readFile54, writeFile as writeFile33 } from "node:fs/promises";
|
|
67876
67875
|
import { join as join124 } from "node:path";
|
|
67877
67876
|
async function createWorktree(projectDir, issueNumber, baseBranch) {
|
|
67878
67877
|
const worktreePath = join124(projectDir, WORKTREE_DIR, `issue-${issueNumber}`);
|
|
@@ -67937,7 +67936,7 @@ async function cleanupAllWorktrees(projectDir) {
|
|
|
67937
67936
|
async function ensureGitignore(projectDir) {
|
|
67938
67937
|
const gitignorePath = join124(projectDir, ".gitignore");
|
|
67939
67938
|
try {
|
|
67940
|
-
const content = existsSync62(gitignorePath) ? await
|
|
67939
|
+
const content = existsSync62(gitignorePath) ? await readFile54(gitignorePath, "utf-8") : "";
|
|
67941
67940
|
if (!content.includes(".worktrees")) {
|
|
67942
67941
|
const newContent = content.endsWith(`
|
|
67943
67942
|
`) ? `${content}.worktrees/
|
|
@@ -68785,13 +68784,19 @@ var init_content_logger = __esm(() => {
|
|
|
68785
68784
|
];
|
|
68786
68785
|
});
|
|
68787
68786
|
|
|
68787
|
+
// src/commands/content/phases/sqlite-client.ts
|
|
68788
|
+
import BetterSqlite3 from "better-sqlite3";
|
|
68789
|
+
function openDatabase(dbPath) {
|
|
68790
|
+
return new BetterSqlite3(dbPath);
|
|
68791
|
+
}
|
|
68792
|
+
var init_sqlite_client = () => {};
|
|
68793
|
+
|
|
68788
68794
|
// src/commands/content/phases/db-manager.ts
|
|
68789
|
-
import { Database } from "bun:sqlite";
|
|
68790
68795
|
import { existsSync as existsSync72, mkdirSync as mkdirSync7 } from "node:fs";
|
|
68791
68796
|
import { dirname as dirname33 } from "node:path";
|
|
68792
68797
|
function initDatabase(dbPath) {
|
|
68793
68798
|
ensureParentDir(dbPath);
|
|
68794
|
-
const db =
|
|
68799
|
+
const db = openDatabase(dbPath);
|
|
68795
68800
|
db.exec("PRAGMA journal_mode = WAL");
|
|
68796
68801
|
db.exec("PRAGMA busy_timeout = 5000");
|
|
68797
68802
|
runMigrations(db);
|
|
@@ -68919,7 +68924,9 @@ var SCHEMA_V1 = `
|
|
|
68919
68924
|
`, SCHEMA_V2_RETRY_COUNT = `
|
|
68920
68925
|
ALTER TABLE git_events ADD COLUMN retry_count INTEGER NOT NULL DEFAULT 0;
|
|
68921
68926
|
`;
|
|
68922
|
-
var init_db_manager = () => {
|
|
68927
|
+
var init_db_manager = __esm(() => {
|
|
68928
|
+
init_sqlite_client();
|
|
68929
|
+
});
|
|
68923
68930
|
|
|
68924
68931
|
// src/commands/content/phases/engagement-tracker.ts
|
|
68925
68932
|
async function trackEngagement(db, adapters, config, contentLogger) {
|
|
@@ -69839,12 +69846,12 @@ var init_types6 = __esm(() => {
|
|
|
69839
69846
|
});
|
|
69840
69847
|
|
|
69841
69848
|
// src/commands/content/phases/state-manager.ts
|
|
69842
|
-
import { readFile as
|
|
69849
|
+
import { readFile as readFile56, rename as rename10, writeFile as writeFile36 } from "node:fs/promises";
|
|
69843
69850
|
import { join as join137 } from "node:path";
|
|
69844
69851
|
async function loadContentConfig(projectDir) {
|
|
69845
69852
|
const configPath = join137(projectDir, CK_CONFIG_FILE2);
|
|
69846
69853
|
try {
|
|
69847
|
-
const raw2 = await
|
|
69854
|
+
const raw2 = await readFile56(configPath, "utf-8");
|
|
69848
69855
|
const json = JSON.parse(raw2);
|
|
69849
69856
|
return ContentConfigSchema.parse(json.content ?? {});
|
|
69850
69857
|
} catch {
|
|
@@ -69860,7 +69867,7 @@ async function saveContentConfig(projectDir, config) {
|
|
|
69860
69867
|
async function loadContentState(projectDir) {
|
|
69861
69868
|
const configPath = join137(projectDir, CK_CONFIG_FILE2);
|
|
69862
69869
|
try {
|
|
69863
|
-
const raw2 = await
|
|
69870
|
+
const raw2 = await readFile56(configPath, "utf-8");
|
|
69864
69871
|
const json = JSON.parse(raw2);
|
|
69865
69872
|
const contentBlock = json.content ?? {};
|
|
69866
69873
|
return ContentStateSchema.parse(contentBlock.state ?? {});
|
|
@@ -69887,7 +69894,7 @@ async function saveContentState(projectDir, state) {
|
|
|
69887
69894
|
}
|
|
69888
69895
|
async function readJsonSafe(filePath) {
|
|
69889
69896
|
try {
|
|
69890
|
-
const raw2 = await
|
|
69897
|
+
const raw2 = await readFile56(filePath, "utf-8");
|
|
69891
69898
|
return JSON.parse(raw2);
|
|
69892
69899
|
} catch {
|
|
69893
69900
|
return {};
|
|
@@ -71107,7 +71114,7 @@ var init_update_command_help = __esm(() => {
|
|
|
71107
71114
|
sections: [
|
|
71108
71115
|
{
|
|
71109
71116
|
title: "Note",
|
|
71110
|
-
content: "'ck update' updates the CLI tool only. To update kit content (skills, commands, rules), use 'ck init' for local or 'ck init -g' for global. Use --yes to skip all prompts (both CLI and kit content update) for non-interactive/CI usage."
|
|
71117
|
+
content: "'ck update' updates the CLI tool only and defaults to the latest stable release. Use '--beta' to opt into prerelease CLI builds. To update kit content (skills, commands, rules), use 'ck init' for local or 'ck init -g' for global. Use --yes to skip all prompts (both CLI and kit content update) for non-interactive/CI usage."
|
|
71111
71118
|
}
|
|
71112
71119
|
]
|
|
71113
71120
|
};
|
|
@@ -76959,7 +76966,7 @@ async function checkHooksExist(projectDir) {
|
|
|
76959
76966
|
init_logger();
|
|
76960
76967
|
init_path_resolver();
|
|
76961
76968
|
import { existsSync as existsSync46 } from "node:fs";
|
|
76962
|
-
import { readFile as
|
|
76969
|
+
import { readFile as readFile31 } from "node:fs/promises";
|
|
76963
76970
|
import { join as join56 } from "node:path";
|
|
76964
76971
|
async function checkSettingsValid(projectDir) {
|
|
76965
76972
|
const globalSettings = join56(PathResolver.getGlobalKitDir(), "settings.json");
|
|
@@ -76977,7 +76984,7 @@ async function checkSettingsValid(projectDir) {
|
|
|
76977
76984
|
};
|
|
76978
76985
|
}
|
|
76979
76986
|
try {
|
|
76980
|
-
const content = await
|
|
76987
|
+
const content = await readFile31(settingsPath, "utf-8");
|
|
76981
76988
|
JSON.parse(content);
|
|
76982
76989
|
return {
|
|
76983
76990
|
id: "ck-settings-valid",
|
|
@@ -77034,7 +77041,7 @@ async function checkSettingsValid(projectDir) {
|
|
|
77034
77041
|
init_logger();
|
|
77035
77042
|
init_path_resolver();
|
|
77036
77043
|
import { existsSync as existsSync47 } from "node:fs";
|
|
77037
|
-
import { readFile as
|
|
77044
|
+
import { readFile as readFile32 } from "node:fs/promises";
|
|
77038
77045
|
import { homedir as homedir28 } from "node:os";
|
|
77039
77046
|
import { dirname as dirname19, join as join57, normalize as normalize5, resolve as resolve14 } from "node:path";
|
|
77040
77047
|
async function checkPathRefsValid(projectDir) {
|
|
@@ -77053,7 +77060,7 @@ async function checkPathRefsValid(projectDir) {
|
|
|
77053
77060
|
};
|
|
77054
77061
|
}
|
|
77055
77062
|
try {
|
|
77056
|
-
const content = await
|
|
77063
|
+
const content = await readFile32(claudeMdPath, "utf-8");
|
|
77057
77064
|
const refPattern = /@([^\s\)]+)/g;
|
|
77058
77065
|
const refs = [...content.matchAll(refPattern)].map((m2) => m2[1]);
|
|
77059
77066
|
if (refs.length === 0) {
|
|
@@ -78696,7 +78703,7 @@ import { platform as platform6 } from "node:os";
|
|
|
78696
78703
|
// src/domains/health-checks/platform/environment-checker.ts
|
|
78697
78704
|
init_environment();
|
|
78698
78705
|
init_path_resolver();
|
|
78699
|
-
import { constants as constants3, access as access3, mkdir as mkdir14, readFile as
|
|
78706
|
+
import { constants as constants3, access as access3, mkdir as mkdir14, readFile as readFile34, unlink as unlink8, writeFile as writeFile17 } from "node:fs/promises";
|
|
78700
78707
|
import { arch as arch2, homedir as homedir29, platform as platform5 } from "node:os";
|
|
78701
78708
|
import { join as join63, normalize as normalize6 } from "node:path";
|
|
78702
78709
|
function shouldSkipExpensiveOperations4() {
|
|
@@ -78793,7 +78800,7 @@ async function checkGlobalDirAccess() {
|
|
|
78793
78800
|
try {
|
|
78794
78801
|
await mkdir14(globalDir, { recursive: true });
|
|
78795
78802
|
await writeFile17(testFile, "test", "utf-8");
|
|
78796
|
-
const content = await
|
|
78803
|
+
const content = await readFile34(testFile, "utf-8");
|
|
78797
78804
|
await unlink8(testFile);
|
|
78798
78805
|
if (content !== "test")
|
|
78799
78806
|
throw new Error("Read mismatch");
|
|
@@ -79686,7 +79693,7 @@ init_version_utils();
|
|
|
79686
79693
|
init_claudekit_constants();
|
|
79687
79694
|
init_logger();
|
|
79688
79695
|
init_path_resolver();
|
|
79689
|
-
import { mkdir as mkdir16, readFile as
|
|
79696
|
+
import { mkdir as mkdir16, readFile as readFile35, unlink as unlink10, writeFile as writeFile19 } from "node:fs/promises";
|
|
79690
79697
|
import { join as join66 } from "node:path";
|
|
79691
79698
|
var CACHE_TTL_HOURS = 24;
|
|
79692
79699
|
var DEFAULT_CACHE_TTL_MS = CACHE_TTL_HOURS * 60 * 60 * 1000;
|
|
@@ -79729,7 +79736,7 @@ class ConfigVersionChecker {
|
|
|
79729
79736
|
static async loadCache(kitType, global3) {
|
|
79730
79737
|
try {
|
|
79731
79738
|
const cachePath = ConfigVersionChecker.getCacheFilePath(kitType, global3);
|
|
79732
|
-
const data = await
|
|
79739
|
+
const data = await readFile35(cachePath, "utf8");
|
|
79733
79740
|
const parsed = JSON.parse(data);
|
|
79734
79741
|
if (typeof parsed !== "object" || parsed === null || typeof parsed.lastCheck !== "number" || typeof parsed.latestVersion !== "string" || !parsed.latestVersion || parsed.lastCheck < 0 || parsed.lastCheck > Date.now() + 7 * 24 * 60 * 60 * 1000) {
|
|
79735
79742
|
logger.debug("Invalid cache structure, ignoring");
|
|
@@ -79886,7 +79893,7 @@ class ConfigVersionChecker {
|
|
|
79886
79893
|
}
|
|
79887
79894
|
}
|
|
79888
79895
|
// src/domains/sync/sync-engine.ts
|
|
79889
|
-
import { lstat as lstat3, readFile as
|
|
79896
|
+
import { lstat as lstat3, readFile as readFile36, readlink, realpath as realpath3, stat as stat9 } from "node:fs/promises";
|
|
79890
79897
|
import { isAbsolute as isAbsolute3, join as join67, normalize as normalize7, relative as relative8 } from "node:path";
|
|
79891
79898
|
|
|
79892
79899
|
// src/services/file-operations/ownership-checker.ts
|
|
@@ -81470,7 +81477,7 @@ class SyncEngine {
|
|
|
81470
81477
|
if (lstats.size > MAX_SYNC_FILE_SIZE) {
|
|
81471
81478
|
throw new Error(`File too large for sync (${Math.round(lstats.size / 1024 / 1024)}MB > ${MAX_SYNC_FILE_SIZE / 1024 / 1024}MB limit)`);
|
|
81472
81479
|
}
|
|
81473
|
-
const buffer = await
|
|
81480
|
+
const buffer = await readFile36(filePath);
|
|
81474
81481
|
if (buffer.includes(0)) {
|
|
81475
81482
|
return { content: "", isBinary: true };
|
|
81476
81483
|
}
|
|
@@ -92668,7 +92675,7 @@ import { execSync as execSync4 } from "node:child_process";
|
|
|
92668
92675
|
// src/domains/config/installed-settings-tracker.ts
|
|
92669
92676
|
init_shared();
|
|
92670
92677
|
import { existsSync as existsSync56 } from "node:fs";
|
|
92671
|
-
import { mkdir as mkdir26, readFile as
|
|
92678
|
+
import { mkdir as mkdir26, readFile as readFile40, writeFile as writeFile22 } from "node:fs/promises";
|
|
92672
92679
|
import { dirname as dirname25, join as join87 } from "node:path";
|
|
92673
92680
|
var CK_JSON_FILE = ".ck.json";
|
|
92674
92681
|
|
|
@@ -92693,7 +92700,7 @@ class InstalledSettingsTracker {
|
|
|
92693
92700
|
return { hooks: [], mcpServers: [] };
|
|
92694
92701
|
}
|
|
92695
92702
|
try {
|
|
92696
|
-
const content = await
|
|
92703
|
+
const content = await readFile40(ckJsonPath, "utf-8");
|
|
92697
92704
|
const data = JSON.parse(content);
|
|
92698
92705
|
const installed = data.kits?.[this.kitName]?.installedSettings;
|
|
92699
92706
|
if (installed) {
|
|
@@ -92710,7 +92717,7 @@ class InstalledSettingsTracker {
|
|
|
92710
92717
|
try {
|
|
92711
92718
|
let data = {};
|
|
92712
92719
|
if (existsSync56(ckJsonPath)) {
|
|
92713
|
-
const content = await
|
|
92720
|
+
const content = await readFile40(ckJsonPath, "utf-8");
|
|
92714
92721
|
data = JSON.parse(content);
|
|
92715
92722
|
}
|
|
92716
92723
|
if (!data.kits) {
|
|
@@ -94172,7 +94179,7 @@ import { join as join95 } from "node:path";
|
|
|
94172
94179
|
|
|
94173
94180
|
// src/services/transformers/commands-prefix/content-transformer.ts
|
|
94174
94181
|
init_logger();
|
|
94175
|
-
import { readFile as
|
|
94182
|
+
import { readFile as readFile44, readdir as readdir20, writeFile as writeFile26 } from "node:fs/promises";
|
|
94176
94183
|
import { join as join94 } from "node:path";
|
|
94177
94184
|
var TRANSFORMABLE_EXTENSIONS = new Set([
|
|
94178
94185
|
".md",
|
|
@@ -94242,7 +94249,7 @@ async function transformCommandReferences(directory, options2 = {}) {
|
|
|
94242
94249
|
await processDirectory(fullPath);
|
|
94243
94250
|
} else if (entry.isFile() && shouldTransformFile(entry.name)) {
|
|
94244
94251
|
try {
|
|
94245
|
-
const content = await
|
|
94252
|
+
const content = await readFile44(fullPath, "utf-8");
|
|
94246
94253
|
const { transformed, changes } = transformCommandContent(content);
|
|
94247
94254
|
if (changes > 0) {
|
|
94248
94255
|
if (options2.dryRun) {
|
|
@@ -94779,7 +94786,7 @@ init_skip_directories();
|
|
|
94779
94786
|
init_types3();
|
|
94780
94787
|
var import_fs_extra21 = __toESM(require_lib3(), 1);
|
|
94781
94788
|
import { createHash as createHash4 } from "node:crypto";
|
|
94782
|
-
import { readFile as
|
|
94789
|
+
import { readFile as readFile46, readdir as readdir24, writeFile as writeFile27 } from "node:fs/promises";
|
|
94783
94790
|
import { join as join99, relative as relative16 } from "node:path";
|
|
94784
94791
|
|
|
94785
94792
|
class SkillsManifestManager {
|
|
@@ -94813,7 +94820,7 @@ class SkillsManifestManager {
|
|
|
94813
94820
|
return null;
|
|
94814
94821
|
}
|
|
94815
94822
|
try {
|
|
94816
|
-
const content = await
|
|
94823
|
+
const content = await readFile46(manifestPath, "utf-8");
|
|
94817
94824
|
const data = JSON.parse(content);
|
|
94818
94825
|
const manifest = SkillsManifestSchema.parse(data);
|
|
94819
94826
|
logger.debug(`Read manifest from: ${manifestPath}`);
|
|
@@ -94885,7 +94892,7 @@ class SkillsManifestManager {
|
|
|
94885
94892
|
files.sort();
|
|
94886
94893
|
for (const file of files) {
|
|
94887
94894
|
const relativePath = relative16(dirPath, file);
|
|
94888
|
-
const content = await
|
|
94895
|
+
const content = await readFile46(file);
|
|
94889
94896
|
hash.update(relativePath);
|
|
94890
94897
|
hash.update(content);
|
|
94891
94898
|
}
|
|
@@ -95625,7 +95632,7 @@ import { relative as relative18 } from "node:path";
|
|
|
95625
95632
|
init_skip_directories();
|
|
95626
95633
|
import { createHash as createHash5 } from "node:crypto";
|
|
95627
95634
|
import { createReadStream as createReadStream3 } from "node:fs";
|
|
95628
|
-
import { readFile as
|
|
95635
|
+
import { readFile as readFile47, readdir as readdir28 } from "node:fs/promises";
|
|
95629
95636
|
import { join as join103, relative as relative17 } from "node:path";
|
|
95630
95637
|
async function getAllFiles(dirPath) {
|
|
95631
95638
|
const files = [];
|
|
@@ -95664,7 +95671,7 @@ async function hashDirectory(dirPath) {
|
|
|
95664
95671
|
files.sort();
|
|
95665
95672
|
for (const file of files) {
|
|
95666
95673
|
const relativePath = relative17(dirPath, file);
|
|
95667
|
-
const content = await
|
|
95674
|
+
const content = await readFile47(file);
|
|
95668
95675
|
hash.update(relativePath);
|
|
95669
95676
|
hash.update(content);
|
|
95670
95677
|
}
|
|
@@ -95998,7 +96005,7 @@ import { join as join108 } from "node:path";
|
|
|
95998
96005
|
|
|
95999
96006
|
// src/services/transformers/opencode-path-transformer.ts
|
|
96000
96007
|
init_logger();
|
|
96001
|
-
import { readFile as
|
|
96008
|
+
import { readFile as readFile48, readdir as readdir30, writeFile as writeFile28 } from "node:fs/promises";
|
|
96002
96009
|
import { platform as platform12 } from "node:os";
|
|
96003
96010
|
import { extname as extname5, join as join107 } from "node:path";
|
|
96004
96011
|
var IS_WINDOWS2 = platform12() === "win32";
|
|
@@ -96069,7 +96076,7 @@ async function transformPathsForGlobalOpenCode(directory, options2 = {}) {
|
|
|
96069
96076
|
await processDirectory2(fullPath);
|
|
96070
96077
|
} else if (entry.isFile() && shouldTransformFile2(entry.name)) {
|
|
96071
96078
|
try {
|
|
96072
|
-
const content = await
|
|
96079
|
+
const content = await readFile48(fullPath, "utf-8");
|
|
96073
96080
|
const { transformed, changes } = transformOpenCodeContent(content);
|
|
96074
96081
|
if (changes > 0) {
|
|
96075
96082
|
await writeFile28(fullPath, transformed, "utf-8");
|
|
@@ -96975,7 +96982,7 @@ async function handleSelection(ctx) {
|
|
|
96975
96982
|
};
|
|
96976
96983
|
}
|
|
96977
96984
|
// src/commands/init/phases/sync-handler.ts
|
|
96978
|
-
import { copyFile as copyFile8, mkdir as mkdir31, open as open5, readFile as
|
|
96985
|
+
import { copyFile as copyFile8, mkdir as mkdir31, open as open5, readFile as readFile50, rename as rename6, stat as stat17, unlink as unlink11, writeFile as writeFile30 } from "node:fs/promises";
|
|
96979
96986
|
import { dirname as dirname28, join as join112, resolve as resolve24 } from "node:path";
|
|
96980
96987
|
init_logger();
|
|
96981
96988
|
init_path_resolver();
|
|
@@ -97143,7 +97150,7 @@ async function executeSyncMerge(ctx) {
|
|
|
97143
97150
|
try {
|
|
97144
97151
|
const sourceMetadataPath = join112(upstreamDir, "metadata.json");
|
|
97145
97152
|
if (await import_fs_extra33.pathExists(sourceMetadataPath)) {
|
|
97146
|
-
const content = await
|
|
97153
|
+
const content = await readFile50(sourceMetadataPath, "utf-8");
|
|
97147
97154
|
const sourceMetadata = JSON.parse(content);
|
|
97148
97155
|
deletions = sourceMetadata.deletions || [];
|
|
97149
97156
|
}
|
|
@@ -97441,7 +97448,7 @@ async function renameFolders(dirsToRename, extractDir, options2) {
|
|
|
97441
97448
|
// src/services/transformers/folder-transform/path-replacer.ts
|
|
97442
97449
|
init_logger();
|
|
97443
97450
|
init_types3();
|
|
97444
|
-
import { readFile as
|
|
97451
|
+
import { readFile as readFile51, readdir as readdir32, writeFile as writeFile31 } from "node:fs/promises";
|
|
97445
97452
|
import { join as join114, relative as relative20 } from "node:path";
|
|
97446
97453
|
var TRANSFORMABLE_FILE_PATTERNS = [
|
|
97447
97454
|
".md",
|
|
@@ -97508,7 +97515,7 @@ async function transformFileContents(dir, compiledReplacements, options2) {
|
|
|
97508
97515
|
if (!shouldTransform)
|
|
97509
97516
|
continue;
|
|
97510
97517
|
try {
|
|
97511
|
-
const content = await
|
|
97518
|
+
const content = await readFile51(fullPath, "utf-8");
|
|
97512
97519
|
let newContent = content;
|
|
97513
97520
|
let changeCount = 0;
|
|
97514
97521
|
for (const { regex: regex2, replacement } of compiledReplacements) {
|
|
@@ -97630,7 +97637,7 @@ async function transformFolderPaths(extractDir, folders, options2 = {}) {
|
|
|
97630
97637
|
|
|
97631
97638
|
// src/services/transformers/global-path-transformer.ts
|
|
97632
97639
|
init_logger();
|
|
97633
|
-
import { readFile as
|
|
97640
|
+
import { readFile as readFile52, readdir as readdir33, writeFile as writeFile32 } from "node:fs/promises";
|
|
97634
97641
|
import { platform as platform13 } from "node:os";
|
|
97635
97642
|
import { extname as extname6, join as join115 } from "node:path";
|
|
97636
97643
|
var IS_WINDOWS3 = platform13() === "win32";
|
|
@@ -97752,7 +97759,7 @@ async function transformPathsForGlobalInstall(directory, options2 = {}) {
|
|
|
97752
97759
|
await processDirectory2(fullPath);
|
|
97753
97760
|
} else if (entry.isFile() && shouldTransformFile3(entry.name)) {
|
|
97754
97761
|
try {
|
|
97755
|
-
const content = await
|
|
97762
|
+
const content = await readFile52(fullPath, "utf-8");
|
|
97756
97763
|
const { transformed, changes } = transformContent(content);
|
|
97757
97764
|
if (changes > 0) {
|
|
97758
97765
|
await writeFile32(fullPath, transformed, "utf-8");
|
|
@@ -98010,7 +98017,7 @@ async function initCommand(options2) {
|
|
|
98010
98017
|
init_dist2();
|
|
98011
98018
|
var import_picocolors28 = __toESM(require_picocolors(), 1);
|
|
98012
98019
|
import { existsSync as existsSync58 } from "node:fs";
|
|
98013
|
-
import { readFile as
|
|
98020
|
+
import { readFile as readFile53, rm as rm15, unlink as unlink12 } from "node:fs/promises";
|
|
98014
98021
|
import { homedir as homedir31 } from "node:os";
|
|
98015
98022
|
import { basename as basename16, join as join117, resolve as resolve25 } from "node:path";
|
|
98016
98023
|
init_logger();
|
|
@@ -98442,7 +98449,7 @@ async function processMetadataDeletions(skillSourcePath, installGlobally) {
|
|
|
98442
98449
|
return;
|
|
98443
98450
|
let sourceMetadata;
|
|
98444
98451
|
try {
|
|
98445
|
-
const content = await
|
|
98452
|
+
const content = await readFile53(sourceMetadataPath, "utf-8");
|
|
98446
98453
|
sourceMetadata = JSON.parse(content);
|
|
98447
98454
|
} catch (error) {
|
|
98448
98455
|
logger.debug(`[migrate] Failed to parse source metadata.json: ${error}`);
|
|
@@ -98702,7 +98709,7 @@ async function migrateCommand(options2) {
|
|
|
98702
98709
|
for (const action of conflictActions) {
|
|
98703
98710
|
if (!action.diff && action.targetPath && existsSync58(action.targetPath)) {
|
|
98704
98711
|
try {
|
|
98705
|
-
const targetContent = await
|
|
98712
|
+
const targetContent = await readFile53(action.targetPath, "utf-8");
|
|
98706
98713
|
const sourceItem = agents2.find((a3) => a3.name === action.item) || commands.find((c2) => c2.name === action.item) || (configItem?.name === action.item ? configItem : null) || ruleItems.find((r2) => r2.name === action.item) || hookItems.find((h2) => h2.name === action.item);
|
|
98707
98714
|
if (sourceItem) {
|
|
98708
98715
|
const providerConfig = providers[action.provider];
|
|
@@ -102599,7 +102606,7 @@ init_ck_config_manager();
|
|
|
102599
102606
|
init_file_io();
|
|
102600
102607
|
init_logger();
|
|
102601
102608
|
import { existsSync as existsSync63 } from "node:fs";
|
|
102602
|
-
import { mkdir as mkdir33, readFile as
|
|
102609
|
+
import { mkdir as mkdir33, readFile as readFile55 } from "node:fs/promises";
|
|
102603
102610
|
import { dirname as dirname32 } from "node:path";
|
|
102604
102611
|
var PROCESSED_ISSUES_CAP = 500;
|
|
102605
102612
|
async function readCkJson(projectDir) {
|
|
@@ -102607,7 +102614,7 @@ async function readCkJson(projectDir) {
|
|
|
102607
102614
|
try {
|
|
102608
102615
|
if (!existsSync63(configPath))
|
|
102609
102616
|
return {};
|
|
102610
|
-
const content = await
|
|
102617
|
+
const content = await readFile55(configPath, "utf-8");
|
|
102611
102618
|
return JSON.parse(content);
|
|
102612
102619
|
} catch (error) {
|
|
102613
102620
|
logger.warning(`Failed to parse .ck.json: ${error instanceof Error ? error.message : "Unknown"}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudekit-cli",
|
|
3
|
-
"version": "3.40.
|
|
3
|
+
"version": "3.40.1-dev.1",
|
|
4
4
|
"description": "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dashboard:dev": "cd src/ui && bun install --silent && cd ../.. && bun run src/index.ts config ui --dev",
|
|
25
25
|
"ui:build": "cd src/ui && bun install --silent && bun run build",
|
|
26
26
|
"ui:dev": "cd src/ui && bun run dev",
|
|
27
|
-
"build": "bun build src/index.ts --outdir dist --target node --external @octokit/rest && node -e \"const fs=require('fs'),f='dist/index.js',c=fs.readFileSync(f,'utf-8');fs.writeFileSync(f,c.replace(/^#!.*\\n\\/\\/ @bun\\n/,''))\"",
|
|
27
|
+
"build": "bun build src/index.ts --outdir dist --target node --external @octokit/rest --external better-sqlite3 && node -e \"const fs=require('fs'),f='dist/index.js',c=fs.readFileSync(f,'utf-8');fs.writeFileSync(f,c.replace(/^#!.*\\n\\/\\/ @bun\\n/,''))\"",
|
|
28
28
|
"verify:package": "node scripts/prepublish-check.js",
|
|
29
29
|
"test": "bun test",
|
|
30
30
|
"test:integration": "CK_RUN_CLI_INTEGRATION=1 bun test tests/integration/cli.test.ts",
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
"author": "ClaudeKit",
|
|
53
53
|
"license": "MIT",
|
|
54
54
|
"engines": {
|
|
55
|
-
"bun": ">=1.3.2",
|
|
56
55
|
"node": ">=18.0.0"
|
|
57
56
|
},
|
|
58
57
|
"dependencies": {
|