@greennx/sales-mcp 1.2.0 → 1.3.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.
- package/dist/scripts/cli.js +17 -4
- package/package.json +1 -1
package/dist/scripts/cli.js
CHANGED
|
@@ -7,12 +7,22 @@ import { mkdirSync, copyFileSync, existsSync, readFileSync, writeFileSync } from
|
|
|
7
7
|
import { join, dirname } from "node:path";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { homedir, platform } from "node:os";
|
|
10
|
+
import { createInterface } from "node:readline";
|
|
10
11
|
var here = dirname(fileURLToPath(import.meta.url));
|
|
11
12
|
var DIST_DIR = join(here, "..");
|
|
12
13
|
var BUNDLE_SRC = join(DIST_DIR, "bundle.cjs");
|
|
13
14
|
var IS_WIN = platform() === "win32";
|
|
14
15
|
var IS_MAC = platform() === "darwin";
|
|
15
16
|
var CLAUDE_CMD = IS_WIN ? "claude.cmd" : "claude";
|
|
17
|
+
function promptToken() {
|
|
18
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
19
|
+
return new Promise((resolve) => {
|
|
20
|
+
rl.question(` ${bold("Greenn token:")} `, (answer) => {
|
|
21
|
+
rl.close();
|
|
22
|
+
resolve(answer.trim());
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
16
26
|
function expandTilde(p) {
|
|
17
27
|
if (p === "~") return homedir();
|
|
18
28
|
if (p.startsWith("~/") || p.startsWith("~\\")) return join(homedir(), p.slice(2));
|
|
@@ -243,12 +253,15 @@ if (command === "setup") {
|
|
|
243
253
|
},
|
|
244
254
|
strict: false
|
|
245
255
|
});
|
|
246
|
-
|
|
256
|
+
let token = values["token"];
|
|
257
|
+
if (!token) {
|
|
258
|
+
console.log(`
|
|
259
|
+
${dim("Tip: paste your token here to avoid shell escaping issues with special characters.")}`);
|
|
260
|
+
token = await promptToken();
|
|
261
|
+
}
|
|
247
262
|
if (!token) {
|
|
248
263
|
console.error(`
|
|
249
|
-
${red("error")}
|
|
250
|
-
`);
|
|
251
|
-
console.error(` Run ${cyan('"sales-mcp setup --help"')} for more information.
|
|
264
|
+
${red("error")} token is required
|
|
252
265
|
`);
|
|
253
266
|
process.exit(1);
|
|
254
267
|
}
|