claudekit-cli 1.5.0 → 1.5.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/bin/ck-darwin-arm64 +0 -0
- package/bin/ck-darwin-x64 +0 -0
- package/bin/ck-linux-x64 +0 -0
- package/bin/ck-win32-x64.exe +0 -0
- package/bin/ck.js +62 -0
- package/package.json +3 -5
- package/scripts/postinstall.js +0 -74
package/bin/ck-darwin-arm64
CHANGED
|
Binary file
|
package/bin/ck-darwin-x64
CHANGED
|
Binary file
|
package/bin/ck-linux-x64
CHANGED
|
Binary file
|
package/bin/ck-win32-x64.exe
CHANGED
|
Binary file
|
package/bin/ck.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Wrapper script that detects platform and executes the correct binary
|
|
5
|
+
* This is the entry point that NPM symlinks to when installing globally
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { spawn } from "node:child_process";
|
|
9
|
+
import { existsSync } from "node:fs";
|
|
10
|
+
import { dirname, join } from "node:path";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
12
|
+
|
|
13
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
|
|
15
|
+
// Detect platform and architecture
|
|
16
|
+
const platform = process.platform;
|
|
17
|
+
const arch = process.arch;
|
|
18
|
+
|
|
19
|
+
// Map to binary filename
|
|
20
|
+
const getBinaryPath = () => {
|
|
21
|
+
const ext = platform === "win32" ? ".exe" : "";
|
|
22
|
+
|
|
23
|
+
const binaryMap = {
|
|
24
|
+
"darwin-arm64": `ck-darwin-arm64${ext}`,
|
|
25
|
+
"darwin-x64": `ck-darwin-x64${ext}`,
|
|
26
|
+
"linux-x64": `ck-linux-x64${ext}`,
|
|
27
|
+
"win32-x64": `ck-win32-x64${ext}`,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const key = `${platform}-${arch}`;
|
|
31
|
+
const binaryName = binaryMap[key];
|
|
32
|
+
|
|
33
|
+
if (!binaryName) {
|
|
34
|
+
console.error(`❌ Unsupported platform: ${platform}-${arch}`);
|
|
35
|
+
console.error("Supported platforms: macOS (arm64, x64), Linux (x64), Windows (x64)");
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return join(__dirname, binaryName);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const binaryPath = getBinaryPath();
|
|
43
|
+
|
|
44
|
+
// Check if binary exists
|
|
45
|
+
if (!existsSync(binaryPath)) {
|
|
46
|
+
console.error(`❌ Binary not found: ${binaryPath}`);
|
|
47
|
+
console.error("Please report this issue at: https://github.com/claudekit/claudekit-cli/issues");
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Execute the binary with all arguments
|
|
52
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
53
|
+
stdio: "inherit",
|
|
54
|
+
windowsHide: true,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
child.on("exit", (code, signal) => {
|
|
58
|
+
if (signal) {
|
|
59
|
+
process.kill(process.pid, signal);
|
|
60
|
+
}
|
|
61
|
+
process.exit(code || 0);
|
|
62
|
+
});
|
package/package.json
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudekit-cli",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"ck": "./bin/ck"
|
|
7
|
+
"ck": "./bin/ck.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"bin"
|
|
11
|
-
"scripts/postinstall.js"
|
|
10
|
+
"bin"
|
|
12
11
|
],
|
|
13
12
|
"scripts": {
|
|
14
|
-
"postinstall": "node scripts/postinstall.js",
|
|
15
13
|
"dev": "bun run src/index.ts >> logs.txt 2>&1",
|
|
16
14
|
"build": "bun build src/index.ts --outdir dist --target node --external keytar --external @octokit/rest >> logs.txt 2>&1",
|
|
17
15
|
"compile": "bun build src/index.ts --compile --outfile ck >> logs.txt 2>&1",
|
package/scripts/postinstall.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Post-install script to copy the correct platform-specific binary
|
|
5
|
-
* This runs after `npm install` to set up the executable
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { chmodSync, copyFileSync, existsSync } from "node:fs";
|
|
9
|
-
import { dirname, join } from "node:path";
|
|
10
|
-
import { fileURLToPath } from "node:url";
|
|
11
|
-
|
|
12
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const binDir = join(__dirname, "..", "bin");
|
|
14
|
-
|
|
15
|
-
if (!existsSync(binDir)) {
|
|
16
|
-
console.warn(`⚠️ Skipping binary setup: missing directory at ${binDir}`);
|
|
17
|
-
process.exit(0);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Detect platform and architecture
|
|
21
|
-
const platform = process.platform; // darwin, linux, win32
|
|
22
|
-
const arch = process.arch; // arm64, x64
|
|
23
|
-
|
|
24
|
-
// Map to binary filename
|
|
25
|
-
const getBinaryName = () => {
|
|
26
|
-
const ext = platform === "win32" ? ".exe" : "";
|
|
27
|
-
|
|
28
|
-
// Map platform-arch combinations to binary names
|
|
29
|
-
const binaryMap = {
|
|
30
|
-
"darwin-arm64": `ck-darwin-arm64${ext}`,
|
|
31
|
-
"darwin-x64": `ck-darwin-x64${ext}`,
|
|
32
|
-
"linux-x64": `ck-linux-x64${ext}`,
|
|
33
|
-
// 'linux-arm64': `ck-linux-arm64${ext}`, // Not yet supported
|
|
34
|
-
"win32-x64": `ck-win32-x64${ext}`,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const key = `${platform}-${arch}`;
|
|
38
|
-
return binaryMap[key];
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const binaryName = getBinaryName();
|
|
42
|
-
|
|
43
|
-
if (!binaryName) {
|
|
44
|
-
console.error(`❌ Unsupported platform: ${platform}-${arch}`);
|
|
45
|
-
console.error("Supported platforms: macOS (arm64, x64), Linux (x64, arm64), Windows (x64)");
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const sourceBinary = join(binDir, binaryName);
|
|
50
|
-
const targetBinary = join(binDir, platform === "win32" ? "ck.exe" : "ck");
|
|
51
|
-
|
|
52
|
-
// Check if platform-specific binary exists
|
|
53
|
-
if (!existsSync(sourceBinary)) {
|
|
54
|
-
console.warn(`⚠️ Binary not found at ${sourceBinary}. Skipping postinstall step.`);
|
|
55
|
-
console.warn(
|
|
56
|
-
"If you are developing locally, run `bun run compile:binary` to create a platform binary.",
|
|
57
|
-
);
|
|
58
|
-
process.exit(0);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
try {
|
|
62
|
-
// Copy the binary
|
|
63
|
-
copyFileSync(sourceBinary, targetBinary);
|
|
64
|
-
|
|
65
|
-
// Make it executable (Unix-like systems)
|
|
66
|
-
if (platform !== "win32") {
|
|
67
|
-
chmodSync(targetBinary, 0o755);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
console.log(`✅ claudekit-cli installed for ${platform}-${arch}`);
|
|
71
|
-
} catch (error) {
|
|
72
|
-
console.error(`❌ Failed to install binary: ${error.message}`);
|
|
73
|
-
process.exit(1);
|
|
74
|
-
}
|