promptgraph-mcp 1.5.7 → 1.5.8

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.
Files changed (2) hide show
  1. package/index.js +55 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -15,9 +15,12 @@ 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
+ // argv[1] is the resolved index.js path (esp. on Windows global installs),
19
+ // so derive a friendly name instead of showing "index".
20
+ const rawBin = process.argv[1]?.split(/[\\/]/).pop()?.replace(/\.js$/, '');
21
+ const bin = (rawBin && rawBin !== 'index') ? rawBin : 'pg';
19
22
 
20
- const KNOWN_COMMANDS = new Set(['init', 'reindex', 'import', 'setup', 'validate', 'help', '--help', '-h']);
23
+ const KNOWN_COMMANDS = new Set(['init', 'reindex', 'import', 'setup', 'validate', 'marketplace', 'help', '--help', '-h']);
21
24
 
22
25
  function showHelp() {
23
26
  console.log(
@@ -32,6 +35,7 @@ function showHelp() {
32
35
  ['init', 'First-time setup + index all skills'],
33
36
  ['reindex', 'Re-index all skills'],
34
37
  ['import <owner/repo>', 'Import skills from GitHub'],
38
+ ['marketplace [page]', 'Browse the community skill registry'],
35
39
  ['validate <file.md>', 'Validate a skill before publishing'],
36
40
  ['setup <platform>', 'Register MCP in platform config'],
37
41
  ['help', 'Show this help'],
@@ -54,6 +58,55 @@ if (!KNOWN_COMMANDS.has(args[0])) {
54
58
  process.exit(1);
55
59
  }
56
60
 
61
+ if (args[0] === 'marketplace') {
62
+ const { browseMarketplace } = await import('./marketplace.js');
63
+ const PER_PAGE = 10;
64
+ const page = Math.max(1, parseInt(args[1]) || 1);
65
+
66
+ const spin = (await import('./cli.js')).spinner('Fetching registry...');
67
+ spin.start();
68
+ const all = await browseMarketplace(1000);
69
+ spin.stop();
70
+
71
+ if (all?.error) {
72
+ error(all.error);
73
+ process.exit(1);
74
+ }
75
+ if (!all.length) {
76
+ info('Registry is empty. Be the first to contribute!');
77
+ console.log(chalk.gray(' github.com/NeiP4n/promptgraph-registry\n'));
78
+ process.exit(0);
79
+ }
80
+
81
+ const totalPages = Math.ceil(all.length / PER_PAGE);
82
+ const slice = all.slice((page - 1) * PER_PAGE, page * PER_PAGE);
83
+
84
+ console.log(
85
+ boxen(
86
+ chalk.hex('#7C3AED').bold('Marketplace') + ' ' +
87
+ chalk.gray(`page ${page}/${totalPages} · ${all.length} skills`),
88
+ { padding: { top: 0, bottom: 0, left: 2, right: 2 }, borderStyle: 'round', borderColor: '#7C3AED', dimBorder: true }
89
+ )
90
+ );
91
+ console.log();
92
+ for (const s of slice) {
93
+ const stars = s.stars ? chalk.yellow('★ ' + s.stars) : chalk.gray('★ 0');
94
+ console.log(' ' + chalk.white.bold(s.id) + ' ' + stars);
95
+ console.log(' ' + chalk.gray((s.description || '').slice(0, 80)));
96
+ if (s.tags?.length) console.log(' ' + chalk.hex('#7C3AED')(s.tags.map(t => '#' + t).join(' ')));
97
+ console.log();
98
+ }
99
+
100
+ if (totalPages > 1) {
101
+ const nav = [];
102
+ if (page > 1) nav.push(`${bin} marketplace ${page - 1}`);
103
+ if (page < totalPages) nav.push(`${bin} marketplace ${page + 1}`);
104
+ console.log(chalk.gray(' ' + nav.join(' · ')));
105
+ }
106
+ console.log(chalk.gray('\n To install or publish, ask your AI assistant — it uses the pg_marketplace_* tools.\n'));
107
+ process.exit(0);
108
+ }
109
+
57
110
  if (args[0] === 'validate') {
58
111
  const { validateSkill } = await import('./validator.js');
59
112
  const file = args[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptgraph-mcp",
3
- "version": "1.5.7",
3
+ "version": "1.5.8",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "bin": {