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

Function formatTopLevelHelpText

cli/src/framework/help.ts:222–236  ·  view source on GitHub ↗
(tree: CommandTree)

Source from the content-addressed store, hash-verified

220}
221
222function formatTopLevelHelpText(tree: CommandTree): string {
223 const sections = [
224 `${BIN} — Dify command-line interface`,
225 `USAGE\n ${BIN} <command> <subcommand> [flags]`,
226 `COMMANDS\n${renderCommandRows(collectCommands(tree))}`,
227 `EXAMPLES\n${ROOT_EXAMPLES.map(ex => ` $ ${ex}`).join('\n')}`,
228 `GLOBAL FLAGS\n${renderGlobalFlagRows()}`,
229 `GUIDES\n${renderTopicRows()}`,
230 `LEARN MORE\n`
231 + ` Use \`${BIN} <command> --help\` for details on a command.\n`
232 + ` New here? Run \`${BIN} help account\`. Agents: \`${BIN} help agent\` or \`${BIN} --help -o json\`.`,
233 ]
234
235 return `${sections.join('\n\n')}\n`
236}
237
238export function formatTopLevelHelp(tree: CommandTree, format: string): string {
239 if (isStructured(format)) {

Callers 1

formatTopLevelHelpFunction · 0.85

Calls 6

collectCommandsFunction · 0.90
renderCommandRowsFunction · 0.85
renderGlobalFlagRowsFunction · 0.85
renderTopicRowsFunction · 0.85
joinMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected