MCPcopy
hub / github.com/claude-code-best/claude-code / updatePluginCli

Function updatePluginCli

src/services/plugins/pluginCliCommands.ts:293–337  ·  view source on GitHub ↗
(
  plugin: string,
  scope: PluginScope,
)

Source from the content-addressed store, hash-verified

291 * @param scope Scope to update
292 */
293export async function updatePluginCli(
294 plugin: string,
295 scope: PluginScope,
296): Promise<void> {
297 try {
298 writeToStdout(
299 `Checking for updates for plugin "${plugin}" at ${scope} scope…\n`,
300 )
301
302 const result = await updatePluginOp(plugin, scope)
303
304 if (!result.success) {
305 throw new Error(result.message)
306 }
307
308 writeToStdout(`${figures.tick} ${result.message}\n`)
309
310 if (!result.alreadyUpToDate) {
311 const { name, marketplace } = parsePluginIdentifier(
312 result.pluginId || plugin,
313 )
314 logEvent('tengu_plugin_updated_cli', {
315 _PROTO_plugin_name:
316 name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
317 ...(marketplace && {
318 _PROTO_marketplace_name:
319 marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
320 }),
321 old_version: (result.oldVersion ||
322 'unknown') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
323 new_version: (result.newVersion ||
324 'unknown') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
325 ...buildPluginTelemetryFields(
326 name,
327 marketplace,
328 getManagedPluginNames(),
329 ),
330 })
331 }
332
333 await gracefulShutdown(0)
334 } catch (error) {
335 handlePluginCommandError(error, 'update', plugin)
336 }
337}

Callers 1

pluginUpdateHandlerFunction · 0.85

Calls 8

updatePluginOpFunction · 0.85
parsePluginIdentifierFunction · 0.85
logEventFunction · 0.85
getManagedPluginNamesFunction · 0.85
handlePluginCommandErrorFunction · 0.85
writeToStdoutFunction · 0.50
gracefulShutdownFunction · 0.50

Tested by

no test coverage detected