promptgraph-mcp 1.5.5 → 1.5.6
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/index.js +15 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -15,8 +15,11 @@ import boxen from 'boxen';
|
|
|
15
15
|
import chalk from 'chalk';
|
|
16
16
|
|
|
17
17
|
const args = process.argv.slice(2);
|
|
18
|
+
const bin = process.argv[1]?.split(/[\\/]/).pop()?.replace(/\.js$/, '') || 'pg';
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
const KNOWN_COMMANDS = new Set(['init', 'reindex', 'import', 'setup', 'help', '--help', '-h']);
|
|
21
|
+
|
|
22
|
+
function showHelp() {
|
|
20
23
|
console.log(
|
|
21
24
|
boxen(
|
|
22
25
|
chalk.hex('#7C3AED').bold('PromptGraph') + '\n' +
|
|
@@ -33,14 +36,23 @@ if (args[0] === 'help' || args[0] === '--help' || args[0] === '-h' || !args[0])
|
|
|
33
36
|
['help', 'Show this help'],
|
|
34
37
|
];
|
|
35
38
|
for (const [cmd, desc] of cmds) {
|
|
36
|
-
console.log(' ' + chalk.hex('#7C3AED')('
|
|
39
|
+
console.log(' ' + chalk.hex('#7C3AED')((bin + ' ' + cmd).padEnd(28)) + chalk.gray(desc));
|
|
37
40
|
}
|
|
38
41
|
console.log(chalk.gray('\nPlatforms: claude-code, claude-desktop, cline, codex, cursor, windsurf'));
|
|
39
42
|
console.log(chalk.gray('\n github.com/NeiP4n/promptgraph · npmjs.com/package/promptgraph-mcp\n'));
|
|
40
|
-
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!args[0] || args[0] === 'help' || args[0] === '--help' || args[0] === '-h') {
|
|
46
|
+
showHelp();
|
|
41
47
|
process.exit(0);
|
|
42
48
|
}
|
|
43
49
|
|
|
50
|
+
if (!KNOWN_COMMANDS.has(args[0])) {
|
|
51
|
+
console.log(chalk.red('✗') + ' Unknown command: ' + chalk.white(args[0]));
|
|
52
|
+
console.log(chalk.gray(' Run `' + bin + ' help` to see available commands.\n'));
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
|
|
44
56
|
if (args[0] === 'import') {
|
|
45
57
|
await importFromGitHub(args[1]);
|
|
46
58
|
process.exit(0);
|