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

Function loadFigSpec

src/utils/bash/registry.ts:30–43  ·  view source on GitHub ↗
(
  command: string,
)

Source from the content-addressed store, hash-verified

28}
29
30export async function loadFigSpec(
31 command: string,
32): Promise<CommandSpec | null> {
33 if (!command || command.includes('/') || command.includes('\\')) return null
34 if (command.includes('..')) return null
35 if (command.startsWith('-') && command !== '-') return null
36
37 try {
38 const module = await import(`@withfig/autocomplete/build/${command}.js`)
39 return module.default || module
40 } catch {
41 return null
42 }
43}
44export const getCommandSpec = memoizeWithLRU(
45 async (command: string): Promise<CommandSpec | null> => {
46 const spec =

Callers 1

registry.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected