MCPcopy Create free account
hub / github.com/anomalyco/opencode / getCommand

Function getCommand

packages/opencode/src/format/index.ts:43–50  ·  view source on GitHub ↗
(item: Formatter.Info)

Source from the content-addressed store, hash-verified

41 const formatters: Record<string, Formatter.Info> = {}
42
43 async function getCommand(item: Formatter.Info) {
44 let cmd = commands[item.name]
45 if (cmd === false || cmd === undefined) {
46 cmd = await item.enabled({ ...ctx, experimentalOxfmt: flags.experimentalOxfmt })
47 commands[item.name] = cmd
48 }
49 return cmd
50 }
51
52 async function isEnabled(item: Formatter.Info) {
53 const cmd = await getCommand(item)

Callers 2

isEnabledFunction · 0.85
getFormatterFunction · 0.85

Calls 1

enabledMethod · 0.80

Tested by

no test coverage detected