You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used the GitHub search to find a similar issue and didn't find it.
I searched the Typer documentation, with the integrated search.
I already searched in Google "How to X in Typer" and didn't find any information.
I already read and followed all the tutorial in the docs and didn't find an answer.
I already checked if it is not related to Typer but to Click.
Commit to Help
I commit to help with one of those options 👆
Example Code
classMyCustomCommand(click.Command):
defget_help(self, ctx) ->str:
return'Nope!'classMyCustomGroup(click.Group):
command_class=MyCustomCommandgroup_class=typeapp=typer.Typer(name='app', cls=MyCustomGroup)
@app.command()deffoo(help='just some filler text'):
passif__name__=='__main__':
app()
# Expected: app foo -h ==> 'Nope!'# Actual: app foo -h ==> full help text
Description
Since click>=8.0, click.Group may define a class member to designate which Command to default to.
class click.Group(name=None, commands=None, attrs)
... command_class: Optional[Type[click.core.Command]] = None
If set, this is used by the group’s command() decorator as the default Command class. This is useful to make all subcommands use a custom command class.
New in version 8.0.
It appears that this gets swallowed by the current version of Typer.
This discussion was converted from issue #381 on February 22, 2026 11:32.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Since
click>=8.0,click.Groupmay define a class member to designate which Command to default to.It appears that this gets swallowed by the current version of Typer.
Operating System
Windows
Operating System Details
No response
Typer Version
0.4.0
Python Version
Python 3.8.5
Additional Context
https://github.com/tiangolo/typer/blob/d5bc56177edcb14f159743e5eaf52cd448e622dc/typer/main.py#L145-L146
should likely be...
Beta Was this translation helpful? Give feedback.
All reactions