(options: {
json?: boolean
cowork?: boolean
})
| 525 | |
| 526 | // marketplace list (lines 5497–5565) |
| 527 | export async function marketplaceListHandler(options: { |
| 528 | json?: boolean |
| 529 | cowork?: boolean |
| 530 | }): Promise<void> { |
| 531 | if (options.cowork) setUseCoworkPlugins(true) |
| 532 | try { |
| 533 | const config = await loadKnownMarketplacesConfig() |
| 534 | const names = Object.keys(config) |
| 535 | |
| 536 | if (options.json) { |
| 537 | const marketplaces = names.sort().map(name => { |
| 538 | const marketplace = config[name] |
| 539 | const source = marketplace?.source |
| 540 | return { |
| 541 | name, |
| 542 | source: source?.source, |
| 543 | ...(source?.source === 'github' && { repo: source.repo }), |
| 544 | ...(source?.source === 'git' && { url: source.url }), |
| 545 | ...(source?.source === 'url' && { url: source.url }), |
| 546 | ...(source?.source === 'directory' && { path: source.path }), |
| 547 | ...(source?.source === 'file' && { path: source.path }), |
| 548 | installLocation: marketplace?.installLocation, |
| 549 | } |
| 550 | }) |
| 551 | cliOk(jsonStringify(marketplaces, null, 2)) |
| 552 | } |
| 553 | |
| 554 | if (names.length === 0) { |
| 555 | cliOk('No marketplaces configured') |
| 556 | } |
| 557 | |
| 558 | // biome-ignore lint/suspicious/noConsole:: intentional console output |
| 559 | console.log('Configured marketplaces:\n') |
| 560 | names.forEach(name => { |
| 561 | const marketplace = config[name] |
| 562 | // biome-ignore lint/suspicious/noConsole:: intentional console output |
| 563 | console.log(` ${figures.pointer} ${name}`) |
| 564 | |
| 565 | if (marketplace?.source) { |
| 566 | const src = marketplace.source |
| 567 | if (src.source === 'github') { |
| 568 | // biome-ignore lint/suspicious/noConsole:: intentional console output |
| 569 | console.log(` Source: GitHub (${src.repo})`) |
| 570 | } else if (src.source === 'git') { |
| 571 | // biome-ignore lint/suspicious/noConsole:: intentional console output |
| 572 | console.log(` Source: Git (${src.url})`) |
| 573 | } else if (src.source === 'url') { |
| 574 | // biome-ignore lint/suspicious/noConsole:: intentional console output |
| 575 | console.log(` Source: URL (${src.url})`) |
| 576 | } else if (src.source === 'directory') { |
| 577 | // biome-ignore lint/suspicious/noConsole:: intentional console output |
| 578 | console.log(` Source: Directory (${src.path})`) |
| 579 | } else if (src.source === 'file') { |
| 580 | // biome-ignore lint/suspicious/noConsole:: intentional console output |
| 581 | console.log(` Source: File (${src.path})`) |
| 582 | } |
| 583 | } |
| 584 | // biome-ignore lint/suspicious/noConsole:: intentional console output |
no test coverage detected