Allow adding click commands to typer apps for unified UX #920
Replies: 1 comment
-
I'm interested in something I feel is related to this: My use case is building a Typer-based CLI that composes a multitude of different tools, including a plugin-based architecture so that different teams can have different features. One thing I've wanted to be able to do is compose in a third-party existing Click app dynamically so that I can offer an easy way for folks to find useful tools and use them within the same CLI ecosystem, instead of directing them to install them as separate standalone tools. The existing approach in the docs doesn't quite work for this, because the Click app isn't composed up at the root It would be great to have a way to "upgrade" a Click app into a Typer app, even if it doesn't have all the same niceties (e.g. because the Click app isn't type hinted inherently, I imagine some kinds of things would be difficult or impossible to infer). I wanted to do this with an existing Click app I had, but ultimately went the route of converting it to Typer instead, which allowed me to integrate it into this central CLI project. |
Beta Was this translation helpful? Give feedback.
-
First Check
Commit to Help
Example Code
Description
I am using click to define some commands dynamically at runtime and would like to add them to typer in a way that provides a uniform UX across the app.
The above code works fine but leads to differently formatted help messages for typer vs. click commands:
Is there any way to achieve this?
Operating System
macOS
Operating System Details
No response
Typer Version
0.12.3
Python Version
Python 3.10.13
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions