MCPcopy Create free account
hub / github.com/langgenius/dify / describeCommand

Function describeCommand

cli/src/framework/help.ts:77–101  ·  view source on GitHub ↗
(ctor: CommandConstructor, path: string)

Source from the content-addressed store, hash-verified

75}
76
77export function describeCommand(ctor: CommandConstructor, path: string): CommandDescriptor {
78 const guide = agentGuideOf(ctor)
79
80 return {
81 command: path,
82 description: ctor.description ?? null,
83 effect: ctor.effect ?? 'read',
84 args: Object.entries(ctor.args ?? {}).map(([name, def]) => ({
85 name,
86 required: def.required ?? false,
87 description: def.description,
88 })),
89 flags: Object.entries(ctor.flags ?? {}).map(([name, def]) => ({
90 name,
91 char: def.char ?? null,
92 type: def.type,
93 default: def.default ?? null,
94 multiple: def.multiple ?? false,
95 options: def.options ?? null,
96 description: def.description,
97 })),
98 examples: renderExamples(ctor),
99 agentGuide: guide.length > 0 ? guide : null,
100 }
101}
102
103function formatHelpText(ctor: CommandConstructor, path: string): string {
104 const lines: string[] = []

Callers 3

formatHelpFunction · 0.85
formatCommandListFunction · 0.85
formatTopLevelHelpFunction · 0.85

Calls 4

agentGuideOfFunction · 0.85
renderExamplesFunction · 0.85
mapMethod · 0.45
entriesMethod · 0.45

Tested by

no test coverage detected