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

Function enablePlugin

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

Source from the content-addressed store, hash-verified

189 * @param scope Optional scope. If not provided, finds the most specific scope for the current project.
190 */
191export async function enablePlugin(
192 plugin: string,
193 scope?: InstallableScope,
194): Promise<void> {
195 try {
196 const result = await enablePluginOp(plugin, scope)
197
198 if (!result.success) {
199 throw new Error(result.message)
200 }
201
202 console.log(`${figures.tick} ${result.message}`)
203
204 const { name, marketplace } = parsePluginIdentifier(
205 result.pluginId || plugin,
206 )
207 logEvent('tengu_plugin_enabled_cli', {
208 _PROTO_plugin_name:
209 name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
210 ...(marketplace && {
211 _PROTO_marketplace_name:
212 marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
213 }),
214 scope:
215 result.scope as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
216 ...buildPluginTelemetryFields(name, marketplace, getManagedPluginNames()),
217 })
218
219 // eslint-disable-next-line custom-rules/no-process-exit
220 process.exit(0)
221 } catch (error) {
222 handlePluginCommandError(error, 'enable', plugin)
223 }
224}
225
226/**
227 * CLI command: Disable a plugin non-interactively

Callers 1

pluginEnableHandlerFunction · 0.85

Calls 6

enablePluginOpFunction · 0.85
parsePluginIdentifierFunction · 0.85
logEventFunction · 0.85
getManagedPluginNamesFunction · 0.85
handlePluginCommandErrorFunction · 0.85

Tested by

no test coverage detected