What is the best way to wrap an existing CLI tool using Typer? #577
Unanswered
sidekick-eimantas
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
The example code above is the best way I could figure out to wrap an existing CLI tool with Typer.
Effectively, if a command that the wrapper is implementing is called, we define the command at runtime and use Typer as normal. If any other command is called, we proxy it through to the original CLI tool, maybe doing some work inbetween.
Is there a better way of achieving this? Does Typer have any 1st class support for implementing wrappers?
Operating System
macOS
Operating System Details
No response
Typer Version
0.7.0
Python Version
Python 3.10.7
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions