MCPcopy
hub / github.com/codeaashu/claude-code / marketplaceUpdateHandler

Function marketplaceUpdateHandler

src/cli/handlers/plugins.ts:616–665  ·  view source on GitHub ↗
(
  name: string | undefined,
  options: { cowork?: boolean },
)

Source from the content-addressed store, hash-verified

614
615// marketplace update (lines 5609–5672)
616export async function marketplaceUpdateHandler(
617 name: string | undefined,
618 options: { cowork?: boolean },
619): Promise<void> {
620 if (options.cowork) setUseCoworkPlugins(true)
621 try {
622 if (name) {
623 // biome-ignore lint/suspicious/noConsole:: intentional console output
624 console.log(`Updating marketplace: ${name}...`)
625
626 await refreshMarketplace(name, message => {
627 // biome-ignore lint/suspicious/noConsole:: intentional console output
628 console.log(message)
629 })
630
631 clearAllCaches()
632
633 logEvent('tengu_marketplace_updated', {
634 marketplace_name:
635 name as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
636 })
637
638 cliOk(`${figures.tick} Successfully updated marketplace: ${name}`)
639 } else {
640 const config = await loadKnownMarketplacesConfig()
641 const marketplaceNames = Object.keys(config)
642
643 if (marketplaceNames.length === 0) {
644 cliOk('No marketplaces configured')
645 }
646
647 // biome-ignore lint/suspicious/noConsole:: intentional console output
648 console.log(`Updating ${marketplaceNames.length} marketplace(s)...`)
649
650 await refreshAllMarketplaces()
651 clearAllCaches()
652
653 logEvent('tengu_marketplace_updated_all', {
654 count:
655 marketplaceNames.length as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
656 })
657
658 cliOk(
659 `${figures.tick} Successfully updated ${marketplaceNames.length} marketplace(s)`,
660 )
661 }
662 } catch (error) {
663 handleMarketplaceError(error, 'update marketplace(s)')
664 }
665}
666
667// plugin install (lines 5690–5721)
668export async function pluginInstallHandler(

Callers 1

runFunction · 0.85

Calls 9

setUseCoworkPluginsFunction · 0.85
refreshMarketplaceFunction · 0.85
clearAllCachesFunction · 0.85
logEventFunction · 0.85
cliOkFunction · 0.85
refreshAllMarketplacesFunction · 0.85
handleMarketplaceErrorFunction · 0.85
keysMethod · 0.80

Tested by

no test coverage detected