MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / pluginUpdateHandler

Function pluginUpdateHandler

src/cli/handlers/plugins.ts:808–840  ·  view source on GitHub ↗
(
  plugin: string,
  options: { scope?: string; cowork?: boolean },
)

Source from the content-addressed store, hash-verified

806
807// plugin update (lines 5918–5948)
808export async function pluginUpdateHandler(
809 plugin: string,
810 options: { scope?: string; cowork?: boolean },
811): Promise<void> {
812 if (options.cowork) setUseCoworkPlugins(true)
813 const { name, marketplace } = parsePluginIdentifier(plugin)
814 logEvent('tengu_plugin_update_command', {
815 _PROTO_plugin_name: name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
816 ...(marketplace && {
817 _PROTO_marketplace_name:
818 marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
819 }),
820 })
821
822 let scope: (typeof VALID_UPDATE_SCOPES)[number] = 'user'
823 if (options.scope) {
824 if (
825 !VALID_UPDATE_SCOPES.includes(
826 options.scope as (typeof VALID_UPDATE_SCOPES)[number],
827 )
828 ) {
829 cliError(
830 `Invalid scope "${options.scope}". Valid scopes: ${VALID_UPDATE_SCOPES.join(', ')}`,
831 )
832 }
833 scope = options.scope as (typeof VALID_UPDATE_SCOPES)[number]
834 }
835 if (options.cowork && scope !== 'user') {
836 cliError('--cowork can only be used with user scope')
837 }
838
839 await updatePluginCli(plugin, scope)
840}

Callers 1

runFunction · 0.85

Calls 5

setUseCoworkPluginsFunction · 0.85
parsePluginIdentifierFunction · 0.85
logEventFunction · 0.85
cliErrorFunction · 0.85
updatePluginCliFunction · 0.85

Tested by

no test coverage detected