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

Function makeCmd

cli/src/framework/help.test.ts:7–30  ·  view source on GitHub ↗
(opts: {
  description?: string
  flags?: CommandConstructor['flags']
  args?: CommandConstructor['args']
  examples?: string[]
  agentGuide?: string
  effect?: CommandConstructor['effect']
})

Source from the content-addressed store, hash-verified

5import { formatHelp, formatTopLevelHelp } from './help'
6
7function makeCmd(opts: {
8 description?: string
9 flags?: CommandConstructor['flags']
10 args?: CommandConstructor['args']
11 examples?: string[]
12 agentGuide?: string
13 effect?: CommandConstructor['effect']
14}): CommandConstructor {
15 class Cmd {
16 static description = opts.description
17 static flags = opts.flags ?? {}
18 static args = opts.args ?? {}
19 static examples = opts.examples ?? []
20 static effect = opts.effect
21 static agentGuide = opts.agentGuide
22
23 async run(_argv: string[]) {}
24
25 agentGuide(): string {
26 return opts.agentGuide ?? ''
27 }
28 }
29 return Cmd as unknown as CommandConstructor
30}
31
32describe('formatHelp', () => {
33 it('includes description when present', () => {

Callers 1

help.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected