MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getCommandList

Function getCommandList

mcp-server/src/server.ts:120–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

118}
119
120async function getCommandList(): Promise<CommandInfo[]> {
121 const cmdsDir = path.join(SRC_ROOT, "commands");
122 const entries = await fs.readdir(cmdsDir, { withFileTypes: true });
123 const commands: CommandInfo[] = [];
124 for (const e of entries) {
125 if (e.isDirectory()) {
126 const files = await listDir(path.join(cmdsDir, e.name));
127 commands.push({
128 name: e.name,
129 path: `commands/${e.name}`,
130 isDirectory: true,
131 files,
132 });
133 } else {
134 commands.push({
135 name: e.name.replace(/\.(ts|tsx)$/, ""),
136 path: `commands/${e.name}`,
137 isDirectory: false,
138 });
139 }
140 }
141 return commands.sort((a, b) => a.name.localeCompare(b.name));
142}
143
144// ---------------------------------------------------------------------------
145// Server Factory

Callers 1

createServerFunction · 0.85

Calls 2

listDirFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected