@cogitator-ai/cli 0.13.2 → 0.15.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.
@@ -0,0 +1,600 @@
1
+ /**
2
+ * cogitator plugin - install, update and manage plugins and their marketplaces, in the formats of
3
+ * Claude Code's plugins, and run their eval suites
4
+ */
5
+ import { Command, InvalidArgumentError } from 'commander';
6
+ import chalk from 'chalk';
7
+ import { password, isCancel } from '@clack/prompts';
8
+ import { createInterface } from 'node:readline/promises';
9
+ import { resolve } from 'node:path';
10
+ import { experimental_PluginInstaller, experimental_validatePlugin, loadPluginSettings, readPluginLayout, } from '@cogitator-ai/core';
11
+ import { CommandError, examplesHelp, printJson, reportFailure, UsageError } from '../utils/cli.js';
12
+ import { pluginEvalCommand } from './plugin-eval.js';
13
+ /** Talks on the terminal: prompts only when stdin is one */
14
+ export function terminalPluginIo() {
15
+ return {
16
+ print: (line) => console.log(line),
17
+ confirm: async (question) => {
18
+ if (!process.stdin.isTTY)
19
+ return undefined;
20
+ const prompt = createInterface({ input: process.stdin, output: process.stdout });
21
+ try {
22
+ const answer = await prompt.question(`${question} [y/N] `);
23
+ return /^y(es)?$/i.test(answer.trim());
24
+ }
25
+ finally {
26
+ prompt.close();
27
+ }
28
+ },
29
+ secret: async (question) => {
30
+ if (!process.stdin.isTTY)
31
+ return undefined;
32
+ const answer = await password({ message: question });
33
+ return isCancel(answer) ? undefined : answer;
34
+ },
35
+ };
36
+ }
37
+ const defaultContext = () => ({
38
+ io: terminalPluginIo(),
39
+ installer: (options) => new experimental_PluginInstaller(options),
40
+ cwd: process.cwd(),
41
+ });
42
+ function parseScope(value) {
43
+ if (value === 'user' || value === 'project' || value === 'local')
44
+ return value;
45
+ throw new InvalidArgumentError('Expected user, project or local.');
46
+ }
47
+ function collect(value, previous = []) {
48
+ return [...previous, value];
49
+ }
50
+ /** `key=value` pairs as option values: `true`, `false` and numbers read as such */
51
+ export function parseOptionPairs(pairs) {
52
+ const values = {};
53
+ for (const pair of pairs) {
54
+ const at = pair.indexOf('=');
55
+ if (at <= 0)
56
+ throw new UsageError(`--config takes key=value, got ${pair}`);
57
+ const key = pair.slice(0, at);
58
+ const raw = pair.slice(at + 1);
59
+ values[key] =
60
+ raw === 'true'
61
+ ? true
62
+ : raw === 'false'
63
+ ? false
64
+ : raw.trim() !== '' && !Number.isNaN(Number(raw))
65
+ ? Number(raw)
66
+ : raw;
67
+ }
68
+ return values;
69
+ }
70
+ /** Answers what an install asks: `yes` agrees to all, otherwise the person is asked */
71
+ function confirmer(io, yes) {
72
+ return async (question) => {
73
+ if (question.kind === 'permissions') {
74
+ io.print(chalk.bold(`${question.plugin} asks for these permissions:`));
75
+ for (const rule of question.allow)
76
+ io.print(` allow ${rule}`);
77
+ for (const rule of question.deny)
78
+ io.print(chalk.dim(` deny ${rule}`));
79
+ if (yes)
80
+ return true;
81
+ const answer = await io.confirm(question.update ? 'Grant the new permissions?' : 'Grant them and install?');
82
+ if (answer === undefined) {
83
+ throw new CommandError('The permissions need an answer and this is not a terminal', {
84
+ hints: ['Pass --yes to grant them'],
85
+ });
86
+ }
87
+ return answer;
88
+ }
89
+ io.print(chalk.bold(`${question.plugin} is installed by running this command on your machine:`));
90
+ io.print(` ${question.command}`);
91
+ io.print(chalk.dim(` sha256 ${question.sha256}`));
92
+ if (yes)
93
+ return true;
94
+ const answer = await io.confirm('Run this command now?');
95
+ if (answer === undefined) {
96
+ throw new CommandError('The command was only displayed: this is not a terminal', {
97
+ hints: ['Pass --yes to run it'],
98
+ });
99
+ }
100
+ return answer;
101
+ };
102
+ }
103
+ async function readSecrets(io, keys) {
104
+ const secrets = {};
105
+ for (const key of keys) {
106
+ const value = await io.secret(`Value of the secret option ${key}`);
107
+ if (value === undefined) {
108
+ throw new CommandError(`The secret ${key} is read from the terminal, and this is not one`, {
109
+ hints: [
110
+ 'Run the command in a terminal, so the secret never reaches the command line or the shell history',
111
+ ],
112
+ });
113
+ }
114
+ secrets[key] = value;
115
+ }
116
+ return secrets;
117
+ }
118
+ function installerOf(context, flags) {
119
+ return context.installer({
120
+ projectRoot: context.cwd,
121
+ settings: { root: context.cwd, ...(context.userDirs && { userDirs: context.userDirs }) },
122
+ ...(context.userDirs && { userDirs: context.userDirs }),
123
+ confirm: confirmer(context.io, flags.yes === true),
124
+ ...(!flags.json && { onProgress: (message) => context.io.print(chalk.dim(message)) }),
125
+ });
126
+ }
127
+ /** Runs `work` and prints its result: a line, or with `--json` one object with `outcome` */
128
+ async function respond(command, flags, context, work) {
129
+ try {
130
+ const result = await work();
131
+ if (flags.json) {
132
+ printJson({ command, outcome: 'ok', message: result.message, ...result.details });
133
+ }
134
+ else {
135
+ for (const line of result.lines ?? [])
136
+ context.io.print(line);
137
+ context.io.print(`${chalk.green('✓')} ${result.message}`);
138
+ }
139
+ return 0;
140
+ }
141
+ catch (error) {
142
+ if (flags.json) {
143
+ const code = error.code;
144
+ printJson({
145
+ command,
146
+ outcome: 'failed',
147
+ message: error instanceof Error ? error.message : String(error),
148
+ ...(typeof code === 'string' && { failureCode: code }),
149
+ });
150
+ return 1;
151
+ }
152
+ return reportFailure(error, { json: false });
153
+ }
154
+ }
155
+ /** `cogitator plugin install` */
156
+ export async function runInstall(spec, flags, context = defaultContext()) {
157
+ return respond('install', flags, context, async () => {
158
+ const installer = installerOf(context, flags);
159
+ let target = spec;
160
+ if (flags.marketplace) {
161
+ const added = await installer.addMarketplace(flags.marketplace);
162
+ target = spec.includes('@') ? spec : `${spec}@${added.marketplace.name}`;
163
+ }
164
+ const secrets = await readSecrets(context.io, flags.secret ?? []);
165
+ const result = await installer.install(target, {
166
+ scope: flags.scope ?? 'user',
167
+ yes: flags.yes === true,
168
+ options: parseOptionPairs(flags.config ?? []),
169
+ secrets,
170
+ });
171
+ const message = result.alreadyInstalled
172
+ ? `Plugin "${result.id}" is already installed (scope: ${flags.scope ?? 'user'})`
173
+ : `Successfully installed plugin: ${result.id} ${result.version} (scope: ${flags.scope ?? 'user'})`;
174
+ return {
175
+ message,
176
+ lines: [
177
+ ...result.installed
178
+ .slice(1)
179
+ .map((record) => chalk.dim(` + dependency ${record.id} ${record.version}`)),
180
+ ...result.notes.map((note) => chalk.yellow(` ${note}`)),
181
+ ],
182
+ details: {
183
+ pluginId: result.id,
184
+ version: result.version,
185
+ installPath: result.installPath,
186
+ scope: flags.scope ?? 'user',
187
+ alreadyInstalled: result.alreadyInstalled,
188
+ dependencies: result.installed.slice(1).map((record) => record.id),
189
+ notes: result.notes,
190
+ },
191
+ };
192
+ });
193
+ }
194
+ /** `cogitator plugin uninstall` */
195
+ export async function runUninstall(spec, flags, context = defaultContext()) {
196
+ return respond('uninstall', flags, context, async () => {
197
+ if (flags.prune && !flags.yes) {
198
+ const answer = await context.io.confirm('Also remove the dependencies nothing else needs?');
199
+ if (answer !== true)
200
+ throw new CommandError('Aborted', {
201
+ hints: ['Pass --yes with --prune when not in a terminal'],
202
+ });
203
+ }
204
+ const result = await installerOf(context, flags).uninstall(spec, {
205
+ ...(flags.keepData !== undefined && { keepData: flags.keepData }),
206
+ ...(flags.prune !== undefined && { prune: flags.prune }),
207
+ });
208
+ return {
209
+ message: `Successfully uninstalled plugin: ${result.removed.join(', ')}`,
210
+ details: { removed: result.removed, keptData: result.keptData },
211
+ };
212
+ });
213
+ }
214
+ /** `cogitator plugin enable` and `disable` */
215
+ export async function runSetEnabled(spec, enabled, flags, context = defaultContext()) {
216
+ return respond(enabled ? 'enable' : 'disable', flags, context, async () => {
217
+ const { file, scope, overriddenBy } = await installerOf(context, flags).setEnabled(spec, enabled, flags.scope);
218
+ const state = enabled ? 'enabled' : 'disabled';
219
+ return {
220
+ message: `Successfully ${state} plugin: ${spec} (scope: ${scope})` +
221
+ (overriddenBy
222
+ ? `\nWarning: the ${overriddenBy} settings still have it ${enabled ? 'disabled' : 'enabled'}, which takes precedence`
223
+ : ''),
224
+ details: { pluginId: spec, scope, file, ...(overriddenBy && { overriddenBy }) },
225
+ };
226
+ });
227
+ }
228
+ /** `cogitator plugin update` */
229
+ export async function runUpdate(spec, flags, context = defaultContext()) {
230
+ return respond('update', flags, context, async () => {
231
+ const results = await installerOf(context, flags).update(spec, { yes: flags.yes === true });
232
+ const updated = results.filter((result) => result.updated);
233
+ return {
234
+ message: results.length === 1 && !updated.length
235
+ ? (results[0]?.notes.at(-1) ?? 'Nothing to update')
236
+ : `Updated ${updated.length} of ${results.length} plugins`,
237
+ lines: results.flatMap((result) => [
238
+ ...(result.updated ? [` ${result.id} ${result.from} -> ${result.to}`] : []),
239
+ ...result.notes
240
+ .filter((note) => !note.includes('already at the latest'))
241
+ .map((note) => chalk.yellow(` ${note}`)),
242
+ ]),
243
+ details: { results },
244
+ };
245
+ });
246
+ }
247
+ /** `cogitator plugin list`: the install records, what the settings enable, what is wrong with each */
248
+ export async function runList(flags, context = defaultContext()) {
249
+ try {
250
+ const installer = installerOf(context, flags);
251
+ const records = await installer.list();
252
+ const settings = await loadPluginSettings(context.cwd, {
253
+ root: context.cwd,
254
+ trusted: true,
255
+ ...(context.userDirs && { userDirs: context.userDirs }),
256
+ });
257
+ const rows = [];
258
+ for (const record of records) {
259
+ const layout = await readPluginLayout(record.installPath, {
260
+ ...(record.entry && { entry: record.entry }),
261
+ fallbackName: record.name,
262
+ id: record.id,
263
+ }).catch((error) => error);
264
+ const errors = layout instanceof Error
265
+ ? [layout.message]
266
+ : layout.diagnostics
267
+ .filter((entry) => entry.level === 'error')
268
+ .map((entry) => entry.message);
269
+ const manifest = layout instanceof Error
270
+ ? undefined
271
+ : layout.manifest;
272
+ const entry = settings.enabled.get(record.id);
273
+ rows.push({
274
+ id: record.id,
275
+ version: record.version,
276
+ enabled: entry?.value ?? (record.dependency === true || manifest?.defaultEnabled !== false),
277
+ ...(entry && { enabledBy: entry.layer }),
278
+ installPath: record.installPath,
279
+ installedAt: record.installedAt,
280
+ lastUpdated: record.lastUpdated,
281
+ ...(record.dependency && { dependency: true }),
282
+ ...(errors.length > 0 && { errors }),
283
+ ...(manifest?.userConfig && { hasUserConfig: true }),
284
+ });
285
+ }
286
+ const available = [];
287
+ if (flags.available) {
288
+ for (const marketplace of await installer.listMarketplaces()) {
289
+ if (marketplace.declared !== undefined)
290
+ continue;
291
+ const read = await installer.readMarketplace(marketplace.name).catch(() => undefined);
292
+ for (const entry of read?.manifest.plugins ?? []) {
293
+ const pluginId = `${entry.name}@${marketplace.name}`;
294
+ if (records.some((record) => record.id === pluginId))
295
+ continue;
296
+ available.push({
297
+ pluginId,
298
+ name: entry.name,
299
+ marketplaceName: marketplace.name,
300
+ source: entry.source,
301
+ ...(entry.description !== undefined && { description: entry.description }),
302
+ ...(entry.version !== undefined && { version: entry.version }),
303
+ });
304
+ }
305
+ }
306
+ }
307
+ if (flags.json) {
308
+ printJson(flags.available ? { installed: rows, available } : rows);
309
+ return 0;
310
+ }
311
+ if (rows.length === 0) {
312
+ context.io.print('No plugins installed. Use `cogitator plugin install` to install a plugin.');
313
+ return 0;
314
+ }
315
+ context.io.print(chalk.bold('Installed plugins:'));
316
+ for (const row of rows) {
317
+ const state = row.errors
318
+ ? chalk.red('failed to load')
319
+ : row.enabled
320
+ ? chalk.green('enabled')
321
+ : chalk.dim('disabled');
322
+ context.io.print(` ${row.id} ${chalk.dim(row.version)} ${state}${row.dependency ? chalk.dim(' (dependency)') : ''}`);
323
+ for (const error of row.errors ?? [])
324
+ context.io.print(chalk.red(` ${error}`));
325
+ }
326
+ return 0;
327
+ }
328
+ catch (error) {
329
+ return reportFailure(error, { json: flags.json === true });
330
+ }
331
+ }
332
+ /** `cogitator plugin configure` */
333
+ export async function runConfigure(spec, flags, context = defaultContext()) {
334
+ return respond('configure', flags, context, async () => {
335
+ const secrets = await readSecrets(context.io, flags.secret ?? []);
336
+ const notes = await installerOf(context, flags).configure(spec, {
337
+ options: parseOptionPairs(flags.set ?? []),
338
+ secrets,
339
+ ...(flags.unset && { unset: flags.unset }),
340
+ });
341
+ return {
342
+ message: `Saved the options of ${spec}`,
343
+ lines: notes.map((note) => chalk.yellow(` ${note}`)),
344
+ details: { pluginId: spec, notes },
345
+ };
346
+ });
347
+ }
348
+ /** `cogitator plugin validate`: 0 passed, 1 failed, 2 when the validator itself failed */
349
+ export async function runValidate(path, flags, context = defaultContext()) {
350
+ let result;
351
+ try {
352
+ result = await experimental_validatePlugin(resolve(context.cwd, path), {
353
+ strict: flags.strict === true,
354
+ });
355
+ }
356
+ catch (error) {
357
+ console.error(`Unexpected error during validation: ${error instanceof Error ? error.message : String(error)}`);
358
+ return 2;
359
+ }
360
+ if (flags.json) {
361
+ printJson({
362
+ success: result.ok,
363
+ strict: result.strict,
364
+ target: result.target,
365
+ manifest: result.manifest ?? null,
366
+ errors: result.errors,
367
+ warnings: result.warnings,
368
+ });
369
+ return result.ok ? 0 : 1;
370
+ }
371
+ context.io.print(`Validating ${result.target}`);
372
+ for (const error of result.errors)
373
+ context.io.print(chalk.red(` error ${error.message}${error.path ? chalk.dim(` (${error.path})`) : ''}`));
374
+ for (const warning of result.warnings) {
375
+ context.io.print(chalk.yellow(` warning ${warning.message}${warning.path ? chalk.dim(` (${warning.path})`) : ''}`));
376
+ }
377
+ const verdict = result.ok
378
+ ? result.warnings.length > 0
379
+ ? 'Validation passed with warnings'
380
+ : 'Validation passed'
381
+ : result.strict && result.errors.length === 0
382
+ ? 'Validation failed (--strict treats warnings as errors)'
383
+ : 'Validation failed';
384
+ context.io.print(result.ok ? chalk.green(verdict) : chalk.red(verdict));
385
+ return result.ok ? 0 : 1;
386
+ }
387
+ /** `cogitator plugin marketplace add|list|remove|update` */
388
+ export async function runMarketplace(action, argument, flags, context = defaultContext()) {
389
+ const installer = installerOf(context, flags);
390
+ if (action === 'list') {
391
+ try {
392
+ const marketplaces = await installer.listMarketplaces();
393
+ if (flags.json) {
394
+ printJson(marketplaces.map((entry) => ({
395
+ name: entry.name,
396
+ source: entry.source.source,
397
+ ...('repo' in entry.source && { repo: entry.source.repo }),
398
+ ...('url' in entry.source && { url: entry.source.url }),
399
+ ...('path' in entry.source &&
400
+ entry.source.source !== 'github' &&
401
+ entry.source.source !== 'git' && { path: entry.source.path }),
402
+ ...('ref' in entry.source &&
403
+ entry.source.ref !== undefined && { ref: entry.source.ref }),
404
+ installLocation: entry.installLocation,
405
+ ...(entry.declared !== undefined && { declaredIn: entry.declared }),
406
+ })));
407
+ return 0;
408
+ }
409
+ if (marketplaces.length === 0) {
410
+ context.io.print('No marketplaces configured');
411
+ return 0;
412
+ }
413
+ context.io.print(chalk.bold('Configured marketplaces:'));
414
+ for (const entry of marketplaces) {
415
+ context.io.print(` ${entry.name}${entry.declared !== undefined ? chalk.dim(' (declared in settings, not fetched yet)') : ''}`);
416
+ context.io.print(chalk.dim(` Source: ${JSON.stringify(entry.source)}`));
417
+ }
418
+ return 0;
419
+ }
420
+ catch (error) {
421
+ return reportFailure(error, { json: flags.json === true });
422
+ }
423
+ }
424
+ return respond(`marketplace-${action}`, flags, context, async () => {
425
+ if (action === 'add') {
426
+ if (!argument)
427
+ throw new UsageError('marketplace add needs a source: owner/repo, https://..., or ./path');
428
+ const { marketplace, read, alreadyAdded } = await installer.addMarketplace(argument);
429
+ return {
430
+ message: alreadyAdded
431
+ ? `Marketplace '${marketplace.name}' already added, fetched again`
432
+ : `Successfully added marketplace: ${marketplace.name}`,
433
+ lines: read.diagnostics.map((entry) => entry.level === 'error'
434
+ ? chalk.red(` ${entry.message}`)
435
+ : chalk.yellow(` ${entry.message}`)),
436
+ details: {
437
+ marketplace: marketplace.name,
438
+ plugins: read.manifest.plugins.map((entry) => entry.name),
439
+ },
440
+ };
441
+ }
442
+ if (action === 'remove') {
443
+ if (!argument)
444
+ throw new UsageError('marketplace remove needs the marketplace name');
445
+ const { uninstalled } = await installer.removeMarketplace(argument);
446
+ return {
447
+ message: `Successfully removed marketplace: ${argument}`,
448
+ lines: uninstalled.length > 0
449
+ ? [
450
+ `Also uninstalled ${uninstalled.length} plugins from this marketplace:`,
451
+ ...uninstalled.map((id) => ` ${id}`),
452
+ ]
453
+ : [],
454
+ details: { marketplace: argument, uninstalled },
455
+ };
456
+ }
457
+ const updated = await installer.updateMarketplace(argument);
458
+ return {
459
+ message: argument
460
+ ? `Successfully updated marketplace: ${argument}`
461
+ : `Successfully updated ${updated.length} marketplaces`,
462
+ details: { marketplaces: updated.map((entry) => entry.name) },
463
+ };
464
+ });
465
+ }
466
+ const json = ['--json', 'print the result as one JSON object'];
467
+ const install = new Command('install')
468
+ .alias('i')
469
+ .description('Install a plugin from a marketplace (name@marketplace), npm (npm:<package>) or git (git+<url>, github:<owner>/<repo>)')
470
+ .argument('<plugin>', 'name@marketplace, name, npm:<package>[@version], github:<owner>/<repo>[#ref] or git+<url>[#ref]')
471
+ .option('-s, --scope <scope>', 'the settings file that enables it: user, project or local', parseScope, 'user')
472
+ .option('--config <key=value>', 'set an option the plugin declares, repeat for several', collect)
473
+ .option('--secret <key>', 'set a sensitive option, read from the terminal, repeat for several', collect)
474
+ .option('--marketplace <source>', 'add this marketplace first and install the plugin from it')
475
+ .option('-y, --yes', 'grant the permissions the plugin asks for and run a command source without asking')
476
+ .option(...json)
477
+ .addHelpText('after', examplesHelp([
478
+ ['cogitator plugin install formatter@team-tools', 'from an added marketplace'],
479
+ [
480
+ 'cogitator plugin install npm:@acme/review-kit@^2.0.0',
481
+ 'straight from npm, pinned to the version found',
482
+ ],
483
+ ['cogitator plugin install git+https://git.example.com/tools.git#v1.2.0', 'from a git tag'],
484
+ ]))
485
+ .action(async (spec, flags) => {
486
+ process.exitCode = await runInstall(spec, flags);
487
+ });
488
+ const uninstall = new Command('uninstall')
489
+ .aliases(['remove', 'rm'])
490
+ .description('Remove an installed plugin, its files, options, secrets and data')
491
+ .argument('<plugin>', 'name@marketplace')
492
+ .option('--keep-data', 'keep its data folder')
493
+ .option('--prune', 'also remove the dependencies nothing else needs')
494
+ .option('-y, --yes', 'do not ask before pruning')
495
+ .option(...json)
496
+ .action(async (spec, flags) => {
497
+ process.exitCode = await runUninstall(spec, flags);
498
+ });
499
+ const enable = new Command('enable')
500
+ .description('Enable an installed plugin')
501
+ .argument('<plugin>', 'name@marketplace')
502
+ .option('-s, --scope <scope>', 'user, project or local (default: the one that enables or disables it now, else user)', parseScope)
503
+ .option(...json)
504
+ .action(async (spec, flags) => {
505
+ process.exitCode = await runSetEnabled(spec, true, flags);
506
+ });
507
+ const disable = new Command('disable')
508
+ .description('Disable an installed plugin without removing it')
509
+ .argument('<plugin>', 'name@marketplace')
510
+ .option('-s, --scope <scope>', 'user, project or local (default: the one that enables or disables it now, else user)', parseScope)
511
+ .option(...json)
512
+ .action(async (spec, flags) => {
513
+ process.exitCode = await runSetEnabled(spec, false, flags);
514
+ });
515
+ const update = new Command('update')
516
+ .description('Fetch an installed plugin (every one without a name) again and install its new version')
517
+ .argument('[plugin]', 'name@marketplace')
518
+ .option('-y, --yes', 'grant new permissions without asking')
519
+ .option(...json)
520
+ .action(async (spec, flags) => {
521
+ process.exitCode = await runUpdate(spec, flags);
522
+ });
523
+ const list = new Command('list')
524
+ .description('List the installed plugins with their version and status')
525
+ .option('--available', 'with --json, also the plugins the marketplaces offer')
526
+ .option(...json)
527
+ .action(async (flags) => {
528
+ process.exitCode = await runList(flags);
529
+ });
530
+ const configure = new Command('configure')
531
+ .description("Set the options a plugin declares (its userConfig): secrets go to the system's credential store")
532
+ .argument('<plugin>', 'name@marketplace')
533
+ .option('--set <key=value>', 'an option that is not a secret, repeat for several', collect)
534
+ .option('--secret <key>', 'a sensitive option, read from the terminal, repeat for several', collect)
535
+ .option('--unset <key>', 'clear an option, repeat for several', collect)
536
+ .option(...json)
537
+ .action(async (spec, flags) => {
538
+ process.exitCode = await runConfigure(spec, flags);
539
+ });
540
+ const validate = new Command('validate')
541
+ .description('Check a plugin folder as claude plugin validate does: 0 passed, 1 failed, 2 when the check itself failed')
542
+ .argument('<path>', 'the plugin folder')
543
+ .option('--strict', 'treat warnings as errors')
544
+ .option(...json)
545
+ .action(async (path, flags) => {
546
+ process.exitCode = await runValidate(path, flags);
547
+ });
548
+ const marketplace = new Command('marketplace').description('Add, list, update and remove plugin marketplaces');
549
+ marketplace
550
+ .command('add')
551
+ .description('Add a marketplace: owner/repo, a git URL, an https link to a marketplace.json, or a local folder or file')
552
+ .argument('<source>', 'where the marketplace is')
553
+ .option(...json)
554
+ .action(async (source, flags) => {
555
+ process.exitCode = await runMarketplace('add', source, flags);
556
+ });
557
+ marketplace
558
+ .command('list')
559
+ .description('List the marketplaces added and the ones settings declare')
560
+ .option(...json)
561
+ .action(async (flags) => {
562
+ process.exitCode = await runMarketplace('list', undefined, flags);
563
+ });
564
+ marketplace
565
+ .command('remove')
566
+ .alias('rm')
567
+ .description('Remove a marketplace and every plugin installed from it')
568
+ .argument('<name>', 'the marketplace name')
569
+ .option(...json)
570
+ .action(async (name, flags) => {
571
+ process.exitCode = await runMarketplace('remove', name, flags);
572
+ });
573
+ marketplace
574
+ .command('update')
575
+ .description('Fetch a marketplace (every one without a name) again')
576
+ .argument('[name]', 'the marketplace name')
577
+ .option(...json)
578
+ .action(async (name, flags) => {
579
+ process.exitCode = await runMarketplace('update', name, flags);
580
+ });
581
+ export const pluginCommand = new Command('plugin')
582
+ .alias('plugins')
583
+ .description('Install and manage plugins (Claude Code plugin format) and run their evals')
584
+ .addCommand(install)
585
+ .addCommand(uninstall)
586
+ .addCommand(enable)
587
+ .addCommand(disable)
588
+ .addCommand(update)
589
+ .addCommand(list)
590
+ .addCommand(configure)
591
+ .addCommand(validate)
592
+ .addCommand(marketplace)
593
+ .addCommand(pluginEvalCommand)
594
+ .addHelpText('after', examplesHelp([
595
+ ['cogitator plugin marketplace add your-org/plugins', 'add a marketplace from GitHub'],
596
+ ['cogitator plugin install review@your-org', 'install a plugin from it'],
597
+ ['cogitator plugin validate ./my-plugin --strict', 'check a plugin before publishing'],
598
+ ['cogitator plugin eval ./my-plugin', 'score its eval suite with and without it'],
599
+ ]));
600
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","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