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

Function enablePlugin

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

Source from the content-addressed store, hash-verified

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

Callers 1

pluginEnableHandlerFunction · 0.85

Calls 7

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

Tested by

no test coverage detected