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

Function pluginUninstallHandler

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

Source from the content-addressed store, hash-verified

664
665// plugin uninstall (lines 5738–5769)
666export async function pluginUninstallHandler(
667 plugin: string,
668 options: { scope?: string; cowork?: boolean; keepData?: boolean },
669): Promise<void> {
670 if (options.cowork) setUseCoworkPlugins(true)
671 const scope = options.scope || 'user'
672 if (options.cowork && scope !== 'user') {
673 cliError('--cowork can only be used with user scope')
674 }
675 if (
676 !VALID_INSTALLABLE_SCOPES.includes(
677 scope as (typeof VALID_INSTALLABLE_SCOPES)[number],
678 )
679 ) {
680 cliError(
681 `Invalid scope: ${scope}. Must be one of: ${VALID_INSTALLABLE_SCOPES.join(', ')}.`,
682 )
683 }
684 const { name, marketplace } = parsePluginIdentifier(plugin)
685 logEvent('tengu_plugin_uninstall_command', {
686 _PROTO_plugin_name: name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
687 ...(marketplace && {
688 _PROTO_marketplace_name:
689 marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
690 }),
691 scope: scope as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
692 })
693
694 await uninstallPlugin(
695 plugin,
696 scope as 'user' | 'project' | 'local',
697 options.keepData,
698 )
699}
700
701// plugin enable (lines 5783–5818)
702export async function pluginEnableHandler(

Callers 1

runFunction · 0.85

Calls 5

setUseCoworkPluginsFunction · 0.85
cliErrorFunction · 0.85
parsePluginIdentifierFunction · 0.85
logEventFunction · 0.85
uninstallPluginFunction · 0.85

Tested by

no test coverage detected