@greennx/sales-mcp 1.3.0 → 1.5.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 +28 -19
- package/package.json +1 -1
package/dist/scripts/cli.js
CHANGED
|
@@ -14,14 +14,15 @@ var BUNDLE_SRC = join(DIST_DIR, "bundle.cjs");
|
|
|
14
14
|
var IS_WIN = platform() === "win32";
|
|
15
15
|
var IS_MAC = platform() === "darwin";
|
|
16
16
|
var CLAUDE_CMD = IS_WIN ? "claude.cmd" : "claude";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
var _rl = createInterface({ input: process.stdin, output: process.stdout, terminal: TTY });
|
|
18
|
+
var _lines = _rl[Symbol.asyncIterator]();
|
|
19
|
+
async function prompt(question) {
|
|
20
|
+
process.stdout.write(question);
|
|
21
|
+
const result = await _lines.next();
|
|
22
|
+
return result.done ? "" : result.value.trim();
|
|
23
|
+
}
|
|
24
|
+
function closeRL() {
|
|
25
|
+
_rl.close();
|
|
25
26
|
}
|
|
26
27
|
function expandTilde(p) {
|
|
27
28
|
if (p === "~") return homedir();
|
|
@@ -70,11 +71,11 @@ function printHelp() {
|
|
|
70
71
|
|
|
71
72
|
${bold("EXAMPLES")}
|
|
72
73
|
|
|
73
|
-
${dim("# Configure all detected tools
|
|
74
|
-
${cyan(`npx @greenn/sales-mcp setup
|
|
74
|
+
${dim("# Configure all detected tools (token will be prompted)")}
|
|
75
|
+
${cyan(`npx @greenn/sales-mcp setup`)}
|
|
75
76
|
|
|
76
77
|
${dim("# Use a custom directory for HTML backups")}
|
|
77
|
-
${cyan(`npx @greenn/sales-mcp setup
|
|
78
|
+
${cyan(`npx @greenn/sales-mcp setup`)} ${cyan("--history-path")} ~/backups/greenn
|
|
78
79
|
|
|
79
80
|
${dim("# Update server to the latest version")}
|
|
80
81
|
${cyan("npx @greenn/sales-mcp update")}
|
|
@@ -95,13 +96,10 @@ function printSetupHelp() {
|
|
|
95
96
|
|
|
96
97
|
${bold("USAGE")}
|
|
97
98
|
|
|
98
|
-
${cyan("sales-mcp setup")}
|
|
99
|
+
${cyan("sales-mcp setup")} [options]
|
|
99
100
|
|
|
100
101
|
${bold("OPTIONS")}
|
|
101
102
|
|
|
102
|
-
${cyan("--token")} ${yellow("<token>")} ${bold("Required.")} Your Greenn API token.
|
|
103
|
-
Obtain it at ${dim("adm.greennsales.com.br")} \u2192 Integrations & Tokens.
|
|
104
|
-
|
|
105
103
|
${cyan("--history-path")} ${yellow("<path>")} Directory where HTML backups are saved before
|
|
106
104
|
each page update. Created automatically if missing.
|
|
107
105
|
${dim(`Default: ${DEFAULT_HISTORY_PATH}`)}
|
|
@@ -110,8 +108,8 @@ function printSetupHelp() {
|
|
|
110
108
|
|
|
111
109
|
${bold("EXAMPLES")}
|
|
112
110
|
|
|
113
|
-
${cyan("npx @greenn/sales-mcp setup
|
|
114
|
-
${cyan("npx @greenn/sales-mcp setup
|
|
111
|
+
${cyan("npx @greenn/sales-mcp setup")}
|
|
112
|
+
${cyan("npx @greenn/sales-mcp setup")} ${cyan("--history-path")} ~/backups/greenn
|
|
115
113
|
`);
|
|
116
114
|
}
|
|
117
115
|
function resolveConfigPath(tool) {
|
|
@@ -136,6 +134,10 @@ function resolveConfigPath(tool) {
|
|
|
136
134
|
case "claude-code-user":
|
|
137
135
|
if (IS_WIN) return join(process.env["USERPROFILE"] ?? home, ".claude.json");
|
|
138
136
|
return join(home, ".claude.json");
|
|
137
|
+
case "vscode":
|
|
138
|
+
if (IS_MAC) return join(home, "Library", "Application Support", "Code", "User", "mcp.json");
|
|
139
|
+
if (IS_WIN) return join(appdata, "Code", "User", "mcp.json");
|
|
140
|
+
return join(home, ".config", "Code", "User", "mcp.json");
|
|
139
141
|
case "gemini-cli":
|
|
140
142
|
if (IS_WIN) return join(process.env["USERPROFILE"] ?? home, ".gemini", "settings.json");
|
|
141
143
|
return join(home, ".gemini", "settings.json");
|
|
@@ -257,7 +259,7 @@ if (command === "setup") {
|
|
|
257
259
|
if (!token) {
|
|
258
260
|
console.log(`
|
|
259
261
|
${dim("Tip: paste your token here to avoid shell escaping issues with special characters.")}`);
|
|
260
|
-
token = await
|
|
262
|
+
token = await prompt(` ${bold("Greenn token:")} `);
|
|
261
263
|
}
|
|
262
264
|
if (!token) {
|
|
263
265
|
console.error(`
|
|
@@ -271,7 +273,12 @@ if (command === "setup") {
|
|
|
271
273
|
`);
|
|
272
274
|
process.exit(1);
|
|
273
275
|
}
|
|
274
|
-
|
|
276
|
+
let historyPath = expandTilde(values["history-path"] ?? "");
|
|
277
|
+
if (!historyPath) {
|
|
278
|
+
const answer = await prompt(` ${bold("Backup directory")} ${dim(`(Enter for default: ${DEFAULT_HISTORY_PATH}):`)} `);
|
|
279
|
+
historyPath = answer ? expandTilde(answer) : DEFAULT_HISTORY_PATH;
|
|
280
|
+
}
|
|
281
|
+
closeRL();
|
|
275
282
|
const serverDest = join(DEFAULT_INSTALL_DIR, "server.cjs");
|
|
276
283
|
mkdirSync(DEFAULT_INSTALL_DIR, { recursive: true });
|
|
277
284
|
mkdirSync(historyPath, { recursive: true });
|
|
@@ -289,6 +296,7 @@ if (command === "setup") {
|
|
|
289
296
|
{ id: "cursor", name: "Cursor", restart: 'Settings > MCP > click "Refresh".' },
|
|
290
297
|
{ id: "antigravity", name: "Antigravity (Windsurf)", restart: 'Manage MCP Servers > click "Refresh".' },
|
|
291
298
|
{ id: "cline", name: "Cline (VS Code)", restart: 'Cline sidebar > MCP Servers > click "Refresh".' },
|
|
299
|
+
{ id: "vscode", name: "VS Code (Copilot)", restart: 'Reload VS Code window (Ctrl+Shift+P \u2192 "Reload Window").' },
|
|
292
300
|
{ id: "gemini-cli", name: "Gemini CLI", restart: "Restart Gemini CLI." },
|
|
293
301
|
{ id: "codex", name: "Codex CLI", restart: "Restart Codex CLI.", toml: true }
|
|
294
302
|
];
|
|
@@ -386,6 +394,7 @@ if (command === "setup") {
|
|
|
386
394
|
{ id: "cursor", name: "Cursor" },
|
|
387
395
|
{ id: "antigravity", name: "Antigravity (Windsurf)" },
|
|
388
396
|
{ id: "cline", name: "Cline (VS Code)" },
|
|
397
|
+
{ id: "vscode", name: "VS Code (Copilot)" },
|
|
389
398
|
{ id: "gemini-cli", name: "Gemini CLI" },
|
|
390
399
|
{ id: "codex", name: "Codex CLI", toml: true }
|
|
391
400
|
];
|