Skip to content
Discussion options

You must be logged in to vote

The same with pure Click app:

See in the details
import click

@click.group(subcommand_metavar="ACTION")
def cli():
    pass

@cli.command()
def start():
    click.echo("Starting...")

@cli.command()
def stop():
    click.echo("Stopping...")

if __name__ == "__main__":
    cli()
$ python main.py --help
Usage: main.py [OPTIONS] ACTION

Options:
  --help  Show this message and exit.

Commands:
  start
  stop

And, I'm not sure it would be correct to use the same value for the title of "Commands" section as is. By default it's plural form.

I think there should be separate parameter to specify this.
I would start from asking how it's supposed to be done with Click.

Replies: 2 comments

This comment was marked as off-topic.

Comment options

You must be logged in to vote
0 replies
Answer selected by tiangolo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
3 participants
Converted from issue

This discussion was converted from issue #343 on February 22, 2026 10:22.