Skip to content

help command and --help flag should render markdown like clet #5

@tig

Description

@tig

Problem

The help command and --help root flag do not behave like clet:

  1. example-app help should launch the Terminal.Gui markdown viewer (like clet help does), rendering rich markdown content in the TUI. Currently, HelpCommand.RunAsync returns markdown text as a CommandResult but does not actually display it in a viewer -- it relies on the host to render it, and the host just writes the string to stdout after RunAsync returns.

  2. example-app --help should render the help content as ANSI-styled markdown to stdout (like clet --help does). Currently, MetadataHelpProvider.GetRootHelp generates plain text (not markdown), and CliHost.WriteRootFlag writes it directly with stdout.WriteLine -- no markdown rendering pass.

Expected behavior

  • help (the command): launches a TUI markdown viewer displaying the help content.
  • --help (the root flag): renders help content as markdown to stdout via MarkdownRenderer.RenderToAnsi.
  • Both paths should start from the same markdown source (either auto-generated from metadata or provided via EmbeddedMarkdownHelpProvider).

Current behavior

  • help command: returns markdown string in CommandResult, host writes it as-is to stdout (no TUI viewer).
  • --help flag: MetadataHelpProvider produces plain text, written directly to stdout without markdown rendering.

Suggested approach

  1. MetadataHelpProvider should generate markdown (not plain text).
  2. CliHost.WriteRootFlag for Help should pass the markdown through MarkdownRenderer.RenderToAnsi before writing to stdout.
  3. HelpCommand.RunAsync should launch a Terminal.Gui markdown viewer (similar to how clet help works) rather than just returning the markdown string as a result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions