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

Function disablePlugin

src/services/plugins/pluginCliCommands.ts:236–270  ·  view source on GitHub ↗
(
  plugin: string,
  scope?: InstallableScope,
)

Source from the content-addressed store, hash-verified

234 * @param scope Optional scope. If not provided, finds the most specific scope for the current project.
235 */
236export async function disablePlugin(
237 plugin: string,
238 scope?: InstallableScope,
239): Promise<void> {
240 try {
241 const result = await disablePluginOp(plugin, scope)
242
243 if (!result.success) {
244 throw new Error(result.message)
245 }
246
247 // biome-ignore lint/suspicious/noConsole:: intentional console output
248 console.log(`${figures.tick} ${result.message}`)
249
250 const { name, marketplace } = parsePluginIdentifier(
251 result.pluginId || plugin,
252 )
253 logEvent('tengu_plugin_disabled_cli', {
254 _PROTO_plugin_name:
255 name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
256 ...(marketplace && {
257 _PROTO_marketplace_name:
258 marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
259 }),
260 scope:
261 result.scope as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
262 ...buildPluginTelemetryFields(name, marketplace, getManagedPluginNames()),
263 })
264
265 // eslint-disable-next-line custom-rules/no-process-exit
266 process.exit(0)
267 } catch (error) {
268 handlePluginCommandError(error, 'disable', plugin)
269 }
270}
271
272/**
273 * CLI command: Disable all enabled plugins non-interactively

Callers 1

pluginDisableHandlerFunction · 0.85

Calls 6

disablePluginOpFunction · 0.85
parsePluginIdentifierFunction · 0.85
logEventFunction · 0.85
getManagedPluginNamesFunction · 0.85
handlePluginCommandErrorFunction · 0.85

Tested by

no test coverage detected