MCPcopy Create free account
hub / github.com/WJX20/claude-code / disableAllPluginsOp

Function disableAllPluginsOp

src/services/plugins/pluginOperations.ts:783–813  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

781 * @returns Result indicating success/failure with count of disabled plugins
782 */
783export async function disableAllPluginsOp(): Promise<PluginOperationResult> {
784 const enabledPlugins = getPluginEditableScopes()
785
786 if (enabledPlugins.size === 0) {
787 return { success: true, message: 'No enabled plugins to disable' }
788 }
789
790 const disabled: string[] = []
791 const errors: string[] = []
792
793 for (const [pluginId] of enabledPlugins) {
794 const result = await setPluginEnabledOp(pluginId, false)
795 if (result.success) {
796 disabled.push(pluginId)
797 } else {
798 errors.push(`${pluginId}: ${result.message}`)
799 }
800 }
801
802 if (errors.length > 0) {
803 return {
804 success: false,
805 message: `Disabled ${disabled.length} ${plural(disabled.length, 'plugin')}, ${errors.length} failed:\n${errors.join('\n')}`,
806 }
807 }
808
809 return {
810 success: true,
811 message: `Disabled ${disabled.length} ${plural(disabled.length, 'plugin')}`,
812 }
813}
814
815/**
816 * Update a plugin to the latest version.

Callers 1

disableAllPluginsFunction · 0.85

Calls 3

getPluginEditableScopesFunction · 0.85
setPluginEnabledOpFunction · 0.85
pluralFunction · 0.85

Tested by

no test coverage detected