(tree: CommandTree)
| 220 | } |
| 221 | |
| 222 | function 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 | |
| 238 | export function formatTopLevelHelp(tree: CommandTree, format: string): string { |
| 239 | if (isStructured(format)) { |
no test coverage detected