MCPcopy
hub / github.com/EveryInc/compound-engineering-plugin / run

Function run

src/commands/list.ts:11–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9 description: "List available Claude plugins in this repository",
10 },
11 async run() {
12 const root = process.cwd()
13 const plugins: string[] = []
14
15 const rootManifestPath = path.join(root, ".claude-plugin", "plugin.json")
16 if (await pathExists(rootManifestPath)) {
17 const manifest = JSON.parse(await fs.readFile(rootManifestPath, "utf8")) as { name?: string }
18 plugins.push(manifest.name ?? path.basename(root))
19 }
20
21 const pluginsDir = path.join(root, "plugins")
22 if (await pathExists(pluginsDir)) {
23 const entries = await fs.readdir(pluginsDir, { withFileTypes: true })
24 for (const entry of entries) {
25 if (!entry.isDirectory()) continue
26 const manifestPath = path.join(pluginsDir, entry.name, ".claude-plugin", "plugin.json")
27 if (await pathExists(manifestPath)) {
28 plugins.push(entry.name)
29 }
30 }
31 }
32
33 if (plugins.length === 0) {
34 console.log("No Claude plugins found.")
35 return
36 }
37
38 const uniquePlugins = [...new Set(plugins)]
39 console.log(uniquePlugins.sort().join("\n"))
40 },
41})

Callers

nothing calls this directly

Calls 1

pathExistsFunction · 0.90

Tested by

no test coverage detected