@zhing2026/krew 0.1.0

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.
Files changed (2) hide show
  1. package/bin/krew +47 -0
  2. package/package.json +27 -0
package/bin/krew ADDED
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execFileSync } = require("child_process");
4
+ const path = require("path");
5
+
6
+ const PLATFORMS = {
7
+ "win32-x64": { pkg: "@zhing2026/krew-win32-x64", bin: "krew.exe" },
8
+ "linux-x64": { pkg: "@zhing2026/krew-linux-x64", bin: "krew" },
9
+ "linux-arm64": { pkg: "@zhing2026/krew-linux-arm64", bin: "krew" },
10
+ "darwin-x64": { pkg: "@zhing2026/krew-darwin-x64", bin: "krew" },
11
+ "darwin-arm64": { pkg: "@zhing2026/krew-darwin-arm64", bin: "krew" },
12
+ };
13
+
14
+ const platformKey = `${process.platform}-${process.arch}`;
15
+ const info = PLATFORMS[platformKey];
16
+
17
+ if (!info) {
18
+ console.error(
19
+ `Error: Unsupported platform ${process.platform}-${process.arch}.\n` +
20
+ `krew currently supports: ${Object.keys(PLATFORMS).join(", ")}`
21
+ );
22
+ process.exit(1);
23
+ }
24
+
25
+ let binaryPath;
26
+ try {
27
+ binaryPath = path.join(
28
+ path.dirname(require.resolve(`${info.pkg}/package.json`)),
29
+ info.bin
30
+ );
31
+ } catch {
32
+ console.error(
33
+ `Error: Could not find the binary for ${platformKey}.\n` +
34
+ `The platform package ${info.pkg} does not appear to be installed.\n` +
35
+ `Try reinstalling: npm install -g @zhing2026/krew`
36
+ );
37
+ process.exit(1);
38
+ }
39
+
40
+ try {
41
+ execFileSync(binaryPath, process.argv.slice(2), { stdio: "inherit" });
42
+ } catch (e) {
43
+ if (e.status !== null) {
44
+ process.exit(e.status);
45
+ }
46
+ throw e;
47
+ }
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@zhing2026/krew",
3
+ "version": "0.1.0",
4
+ "description": "Multi-AI-Agent collaborative CLI tool",
5
+ "bin": {
6
+ "krew": "bin/krew"
7
+ },
8
+ "optionalDependencies": {
9
+ "@zhing2026/krew-win32-x64": "0.1.0",
10
+ "@zhing2026/krew-linux-x64": "0.1.0",
11
+ "@zhing2026/krew-linux-arm64": "0.1.0",
12
+ "@zhing2026/krew-darwin-x64": "0.1.0",
13
+ "@zhing2026/krew-darwin-arm64": "0.1.0"
14
+ },
15
+ "license": "MIT",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/zhing2006/krew-cli"
19
+ },
20
+ "keywords": [
21
+ "cli",
22
+ "ai",
23
+ "agent",
24
+ "llm",
25
+ "multi-agent"
26
+ ]
27
+ }