Open vikigenius opened 2 weeks ago
Hey @vikigenius, thanks for checking out the package.
This should be possible by using Group.compile
(or feud.build
) to compile the group into a Click object.
You can then add it to an existing CLI.
import feud
# your existing Litestar CLI (a click.Group object)
type(existing_cli)
# <class 'click.Group'>
# your defined feud.Group
class Blog(feud.Group):
...
# compile the feud.Group into a click.Group instance
blog = Blog.compile() # or feud.build(Blog)
type(blog)
# <class 'click.Group'>
# add the compiled group as a sub-command to the existing CLI
existing_cli.add_command(blog)
Does this suggestion already exist?
Feature description
Take for instance I am using the Litestar framework that already has an extensive CLI implemented on top of click.
I want to extend it by adding additional commands instead of rewriting the entire CLI myself (maybe in the future).
Is there an easy way I can simply do something like