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

Function uninstallPlugin

src/services/plugins/pluginCliCommands.ts:150–184  ·  view source on GitHub ↗
(
  plugin: string,
  scope: InstallableScope = 'user',
  keepData = false,
)

Source from the content-addressed store, hash-verified

148 * @param scope Uninstall from scope: user, project, or local (defaults to 'user')
149 */
150export async function uninstallPlugin(
151 plugin: string,
152 scope: InstallableScope = 'user',
153 keepData = false,
154): Promise<void> {
155 try {
156 const result = await uninstallPluginOp(plugin, scope, !keepData)
157
158 if (!result.success) {
159 throw new Error(result.message)
160 }
161
162 console.log(`${figures.tick} ${result.message}`)
163
164 const { name, marketplace } = parsePluginIdentifier(
165 result.pluginId || plugin,
166 )
167 logEvent('tengu_plugin_uninstalled_cli', {
168 _PROTO_plugin_name:
169 name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
170 ...(marketplace && {
171 _PROTO_marketplace_name:
172 marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
173 }),
174 scope: (result.scope ||
175 scope) as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
176 ...buildPluginTelemetryFields(name, marketplace, getManagedPluginNames()),
177 })
178
179 // eslint-disable-next-line custom-rules/no-process-exit
180 process.exit(0)
181 } catch (error) {
182 handlePluginCommandError(error, 'uninstall', plugin)
183 }
184}
185
186/**
187 * CLI command: Enable a plugin non-interactively

Callers 1

pluginUninstallHandlerFunction · 0.85

Calls 6

uninstallPluginOpFunction · 0.85
parsePluginIdentifierFunction · 0.85
logEventFunction · 0.85
getManagedPluginNamesFunction · 0.85
handlePluginCommandErrorFunction · 0.85

Tested by

no test coverage detected