claudeinone-cli 1.0.0 → 1.0.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/1.0.1 +0 -0
- package/dist/index.js +16 -1
- package/package.json +1 -1
package/1.0.1
ADDED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
3
6
|
import { runInit } from "./commands/init.js";
|
|
4
7
|
import { runNew } from "./commands/new.js";
|
|
5
8
|
import { runDoctor } from "./commands/doctor.js";
|
|
@@ -7,7 +10,19 @@ import { runVersions } from "./commands/versions.js";
|
|
|
7
10
|
import { runUpdate } from "./commands/update.js";
|
|
8
11
|
import { runUninstall } from "./commands/uninstall.js";
|
|
9
12
|
const program = new Command();
|
|
10
|
-
|
|
13
|
+
function resolveCliVersion() {
|
|
14
|
+
try {
|
|
15
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
16
|
+
const packageJsonPath = path.join(path.dirname(thisFile), "..", "package.json");
|
|
17
|
+
const raw = fs.readFileSync(packageJsonPath, "utf8");
|
|
18
|
+
const parsed = JSON.parse(raw);
|
|
19
|
+
return parsed.version ?? "0.0.0";
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return "0.0.0";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
program.name("co").description("ClaudeInOne CLI").version(resolveCliVersion());
|
|
11
26
|
program
|
|
12
27
|
.command("init")
|
|
13
28
|
.option("--kit <kit>", "kit name", "claudeinone")
|