claudepluginhub 0.9.0 → 0.10.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/README.md +6 -5
- package/dist/index.js +2 -2
- package/dist/recommend.js +76 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,12 +55,13 @@ npx claudepluginhub recommend Recommend plugins for the current projec
|
|
|
55
55
|
|
|
56
56
|
## Recommend
|
|
57
57
|
|
|
58
|
-
Run `npx claudepluginhub recommend` from a project root to get
|
|
59
|
-
recommendations
|
|
58
|
+
Run `npx claudepluginhub recommend` from a project root to get plugin
|
|
59
|
+
recommendations grouped by each detected stack ("For Next.js:", "For
|
|
60
|
+
PostgreSQL:", …) — no account, no setup.
|
|
60
61
|
|
|
61
62
|
```bash
|
|
62
|
-
npx claudepluginhub recommend # top
|
|
63
|
-
npx claudepluginhub recommend --limit
|
|
63
|
+
npx claudepluginhub recommend # top picks per detected stack
|
|
64
|
+
npx claudepluginhub recommend --limit 6 # picks per stack (1-50, default 4)
|
|
64
65
|
npx claudepluginhub recommend --json # raw JSON, pipeable
|
|
65
66
|
```
|
|
66
67
|
|
|
@@ -84,7 +85,7 @@ npx claudepluginhub vercel/next.js --plugin cache-components
|
|
|
84
85
|
| `--plugin <name>` | Install a specific plugin from a marketplace repo |
|
|
85
86
|
| `--yes, -y` | Skip prompts (install all, project scope) |
|
|
86
87
|
| `--scope <scope>` | Set scope: `user`, `project` (default), `local` |
|
|
87
|
-
| `--limit <n>` | `recommend` only:
|
|
88
|
+
| `--limit <n>` | `recommend` only: picks per detected stack (1-50, default 4) |
|
|
88
89
|
| `--json` | `recommend` only: raw JSON output |
|
|
89
90
|
| `-h, --help` | Show help |
|
|
90
91
|
|
package/dist/index.js
CHANGED
|
@@ -54,8 +54,8 @@ Notes:
|
|
|
54
54
|
|
|
55
55
|
Recommend (reads local manifest dependency names + config filenames only —
|
|
56
56
|
never file contents):
|
|
57
|
-
recommend
|
|
58
|
-
recommend --limit
|
|
57
|
+
recommend Top plugins grouped by each detected stack
|
|
58
|
+
recommend --limit 6 Results per stack (1-50, default 4)
|
|
59
59
|
recommend --json Raw JSON output
|
|
60
60
|
|
|
61
61
|
Options:
|
package/dist/recommend.js
CHANGED
|
@@ -13,7 +13,12 @@ const RECOMMEND_URL = `${BASE_URL}/api/recommend?source=cli`;
|
|
|
13
13
|
const MAX_DEPENDENCIES = 500;
|
|
14
14
|
const MAX_FILES = 200;
|
|
15
15
|
const MAX_DEP_LENGTH = 128;
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* `--limit` is recommendations PER detected stack: the output is grouped into a
|
|
18
|
+
* "For {Stack}:" section per stack, not one fused list. 4 keeps each section
|
|
19
|
+
* tight while covering the project's main stacks.
|
|
20
|
+
*/
|
|
21
|
+
const DEFAULT_LIMIT = 4;
|
|
17
22
|
const MAX_LIMIT = 50;
|
|
18
23
|
/**
|
|
19
24
|
* Telltale filename prefixes. Privacy allowlist: when a cwd entry matches a
|
|
@@ -262,6 +267,50 @@ function formatCount(n) {
|
|
|
262
267
|
function truncate(text, max) {
|
|
263
268
|
return text.length > max ? `${text.slice(0, max - 1).trimEnd()}…` : text;
|
|
264
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* Prettify a vocabulary stack tag for a section header. This is a curated subset
|
|
272
|
+
* of the site's `formatStackName` special-cases (the CLI can't import site
|
|
273
|
+
* types, so it's hand-kept — not a full mirror, and may lag/drift slightly);
|
|
274
|
+
* anything not listed falls back to title-casing the hyphen/space tokens.
|
|
275
|
+
*/
|
|
276
|
+
const STACK_LABELS = {
|
|
277
|
+
nextjs: 'Next.js',
|
|
278
|
+
nuxt: 'Nuxt',
|
|
279
|
+
nodejs: 'Node.js',
|
|
280
|
+
node: 'Node.js',
|
|
281
|
+
postgresql: 'PostgreSQL',
|
|
282
|
+
mysql: 'MySQL',
|
|
283
|
+
mongodb: 'MongoDB',
|
|
284
|
+
sqlite: 'SQLite',
|
|
285
|
+
graphql: 'GraphQL',
|
|
286
|
+
typescript: 'TypeScript',
|
|
287
|
+
javascript: 'JavaScript',
|
|
288
|
+
tailwind: 'Tailwind',
|
|
289
|
+
'shadcn-ui': 'shadcn/ui',
|
|
290
|
+
'react-native': 'React Native',
|
|
291
|
+
sveltekit: 'SvelteKit',
|
|
292
|
+
nestjs: 'NestJS',
|
|
293
|
+
trpc: 'tRPC',
|
|
294
|
+
fastapi: 'FastAPI',
|
|
295
|
+
eslint: 'ESLint',
|
|
296
|
+
prettier: 'Prettier',
|
|
297
|
+
biome: 'Biome',
|
|
298
|
+
pnpm: 'pnpm',
|
|
299
|
+
'docker-compose': 'Docker Compose',
|
|
300
|
+
dotnet: '.NET',
|
|
301
|
+
github: 'GitHub',
|
|
302
|
+
openai: 'OpenAI',
|
|
303
|
+
aws: 'AWS',
|
|
304
|
+
gcp: 'GCP',
|
|
305
|
+
};
|
|
306
|
+
function formatStackLabel(stack) {
|
|
307
|
+
if (STACK_LABELS[stack])
|
|
308
|
+
return STACK_LABELS[stack];
|
|
309
|
+
return stack
|
|
310
|
+
.split(/[-\s]+/)
|
|
311
|
+
.map((w) => (w ? w[0].toUpperCase() + w.slice(1) : w))
|
|
312
|
+
.join(' ');
|
|
313
|
+
}
|
|
265
314
|
export async function runRecommend(argv) {
|
|
266
315
|
const { limit, json } = parseRecommendFlags(argv);
|
|
267
316
|
if (!json)
|
|
@@ -310,7 +359,18 @@ export async function runRecommend(argv) {
|
|
|
310
359
|
print(JSON.stringify(body, null, 2));
|
|
311
360
|
return;
|
|
312
361
|
}
|
|
313
|
-
|
|
362
|
+
// A well-formed 200 always carries `sections` (the POST contract). A missing
|
|
363
|
+
// array is a server contract break / version skew — NOT "no data" — so surface
|
|
364
|
+
// it rather than masking it as the reassuring empty state below (mirrors the
|
|
365
|
+
// site picker, which lets a missing `results` throw into its error state so a
|
|
366
|
+
// broken response never reads as "your stack is unsupported").
|
|
367
|
+
if (!Array.isArray(body.sections)) {
|
|
368
|
+
printError('Unexpected response from the recommend API (missing sections). Please try again later.');
|
|
369
|
+
process.exit(1);
|
|
370
|
+
}
|
|
371
|
+
const sections = body.sections;
|
|
372
|
+
const total = sections.reduce((sum, s) => sum + s.results.length, 0);
|
|
373
|
+
if (total === 0) {
|
|
314
374
|
print('');
|
|
315
375
|
print(`No recommendations yet for: ${body.stacks.join(', ')}`);
|
|
316
376
|
print(`${DIM}Browse plugins at ${BASE_URL}/plugins${RESET}`);
|
|
@@ -319,17 +379,22 @@ export async function runRecommend(argv) {
|
|
|
319
379
|
print('');
|
|
320
380
|
print(`${BOLD}Recommended for:${RESET} ${CYAN}${body.stacks.join(' + ')}${RESET}`);
|
|
321
381
|
if (body.droppedStacks && body.droppedStacks.length > 0) {
|
|
322
|
-
print(`${DIM}(also detected: ${body.droppedStacks.join(', ')} —
|
|
382
|
+
print(`${DIM}(also detected: ${body.droppedStacks.join(', ')} — showing your ${body.stacks.length} most specific stacks)${RESET}`);
|
|
323
383
|
}
|
|
324
384
|
print('');
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
print(`${BOLD}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
385
|
+
// One "For {Stack}:" group per detected stack — each its own ranking, deduped
|
|
386
|
+
// server-side so a plugin never repeats across sections.
|
|
387
|
+
sections.forEach((section) => {
|
|
388
|
+
print(`${BOLD}For ${formatStackLabel(section.stack)}:${RESET}`);
|
|
389
|
+
section.results.forEach((item, i) => {
|
|
390
|
+
const rank = `${String(i + 1).padStart(2)}.`;
|
|
391
|
+
const stars = item.starCount > 0 ? ` ${YELLOW}★ ${formatCount(item.starCount)}${RESET}` : '';
|
|
392
|
+
print(` ${BOLD}${rank} ${item.name}${RESET}${stars}`);
|
|
393
|
+
if (item.description) {
|
|
394
|
+
print(` ${DIM}${truncate(item.description, 88)}${RESET}`);
|
|
395
|
+
}
|
|
396
|
+
print(` ${CYAN}${item.install.command}${RESET}`);
|
|
397
|
+
});
|
|
333
398
|
print('');
|
|
334
399
|
});
|
|
335
400
|
// Link the always-live picker page, not /for/[stack] — low-coverage stacks
|