MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / Run

Method Run

app/cli/pkg/action/plugin_actions.go:88–105  ·  view source on GitHub ↗

Run executes the PluginList action

(_ context.Context)

Source from the content-addressed store, hash-verified

86
87// Run executes the PluginList action
88func (action *PluginList) Run(_ context.Context) (*PluginListResult, error) {
89 action.cfg.Logger.Debug().Msg("Listing all plugins")
90 plugins := action.manager.GetAllPlugins()
91
92 // Create a map of command names to plugin names
93 commandsMap := make(map[string]string)
94 for pluginName, plugin := range plugins {
95 for _, cmd := range plugin.Metadata.Commands {
96 commandsMap[cmd.Name] = pluginName
97 }
98 }
99
100 action.cfg.Logger.Debug().Int("pluginCount", len(plugins)).Int("commandCount", len(commandsMap)).Msg("Found plugins and commands")
101 return &PluginListResult{
102 Plugins: plugins,
103 CommandsMap: commandsMap,
104 }, nil
105}
106
107// NewPluginDescribe creates a new NewPluginDescribe action
108func NewPluginDescribe(cfg *ActionsOpts, manager *plugins.Manager) *PluginDescribe {

Callers

nothing calls this directly

Calls 3

GetAllPluginsMethod · 0.80
IntMethod · 0.80
DebugMethod · 0.45

Tested by

no test coverage detected