copillm 0.2.2 → 0.2.3
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/dist/cli.js +8 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { spawn } from "node:child_process";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
4
5
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
5
6
|
import { Command } from "commander";
|
|
6
7
|
import { clearStoredCredential, inspectStoredCredential, loadStoredCredential, saveStoredCredential } from "./auth/credentials.js";
|
|
@@ -29,7 +30,13 @@ import { registerConfigCommands } from "./cli/configCommands.js";
|
|
|
29
30
|
import { installProcessSafetyNet } from "./cli/processSafetyNet.js";
|
|
30
31
|
const logger = createLogger();
|
|
31
32
|
const program = new Command();
|
|
32
|
-
|
|
33
|
+
// Resolve the package version from package.json at runtime so `--version` stays
|
|
34
|
+
// in sync with whatever was published. Using createRequire keeps this working
|
|
35
|
+
// under NodeNext ESM without needing an import-assertion syntax flag, and
|
|
36
|
+
// resolves the same file in both `dist/cli.js` (one level deep) and `src/cli.ts`
|
|
37
|
+
// when invoked via tsx.
|
|
38
|
+
const pkgVersion = createRequire(import.meta.url)("../package.json").version;
|
|
39
|
+
program.name("copillm").description("Local Copilot proxy").version(pkgVersion);
|
|
33
40
|
program.enablePositionalOptions();
|
|
34
41
|
program.option("--debug", "Enable copillm debug mode (debug endpoint plus verbose daemon diagnostics)");
|
|
35
42
|
program
|