MCPcopy Create free account
hub / github.com/Noumena-Network/code / uninstallPlugin

Function uninstallPlugin

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

Source from the content-addressed store, hash-verified

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

Callers 1

pluginUninstallHandlerFunction · 0.85

Calls 7

uninstallPluginOpFunction · 0.85
parsePluginIdentifierFunction · 0.85
getManagedPluginNamesFunction · 0.85
cliOkFunction · 0.85
handlePluginCommandErrorFunction · 0.85
logEventFunction · 0.50

Tested by

no test coverage detected