Skip to content

Customizing --help behavior #242

@fengb3

Description

@fengb3

I'm developing a CLI tool using ConsoleAppFramework. This tool is designed to be called by LLMs, and I need to provide a customized help message when --help is invoked, rather than the default one.

My tool has over 1000 commands, which I've distributed across dozens of classes using a command hierarchy to organize them. Each class represents a functional module containing related commands.

The Problem:
When invoking --help at the root level, the framework lists all 1000+ commands by default. This quickly fills up my LLM's context window.

Desired Behavior:

  • At the root level, --help should only display the names and brief descriptions of the functional modules
  • Only when the user navigates into a specific module, should the detailed command list and help information for that module be shown

What I've Tried:
I attempted to use a Filter to achieve this, but it seems filters do not work for --help in root level.

Question:
Aside from intercepting the arguments before app.Run(args), are there any other ways to customize the --help behavior? If so, could you provide some example code demonstrating how to implement this?
If there is currently no way to achieve this, would it be possible to add such functionality to the framework? This would greatly benefit developers building large-scale CLI tools for AI consumption.


Thank you for this excellent framework! I believe this is an incredibly valuable console library in the AI era, where LLM-powered CLI interactions are becoming increasingly common.

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