@retasc/cli 1.1.2 → 1.1.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/index.js +9 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { dirname, join } from "node:path";
|
|
3
6
|
import { loadConfig, patchConfig, saveConfig, configPath, isLoggedIn } from "./config.js";
|
|
4
7
|
import { installMcp, normalizeScope } from "./commands/mcp.js";
|
|
5
8
|
import { installGate } from "./commands/gate.js";
|
|
@@ -11,11 +14,16 @@ import { tidyAction, doneAction } from "./commands/tidy.js";
|
|
|
11
14
|
import { runProxy } from "./proxy.js";
|
|
12
15
|
import { deviceLogin } from "./auth.js";
|
|
13
16
|
import { api } from "./api.js";
|
|
17
|
+
// Single source of truth for the version: read package.json at runtime from the
|
|
18
|
+
// compiled file's location (dist/index.js -> ../package.json). A JSON import won't
|
|
19
|
+
// work here — tsconfig has rootDir "src", so importing ../package.json is outside
|
|
20
|
+
// rootDir and fails tsc.
|
|
21
|
+
const pkg = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), "..", "package.json"), "utf8"));
|
|
14
22
|
const program = new Command();
|
|
15
23
|
program
|
|
16
24
|
.name("retasc")
|
|
17
25
|
.description("Retasc — sign in, create projects, mint agent API keys, and wire your agent to the MCP server.")
|
|
18
|
-
.version(
|
|
26
|
+
.version(pkg.version);
|
|
19
27
|
function requireLogin() {
|
|
20
28
|
if (!isLoggedIn()) {
|
|
21
29
|
console.error("Not signed in. Run `retasc login` first.");
|
package/package.json
CHANGED