ApeWorX / apegenius

Telegram bot that answers questions by sourcing answers from docs and codebases
https://docs.apeworx.io/apegenius/
4 stars 2 forks source link

refactor ape gpt cli by using click #5

Open MarcoWorms opened 11 months ago

MarcoWorms commented 11 months ago

Doggie B:

oh sick, we actually have a way to integrate ape plugins into our CLI if they are made with Click click is great the typical structure is to have a _cli.py module underneath the package you have to register the plugin for it to show up as a command can show you that and then organizationally, just decorate a function def cli() with @click.group() and then you can use @cli.command() to add subcommands

an example: https://github.com/ApeWorX/ape-safe/blob/main/ape_safe/_cli.py

and to register the command with ape, do this: https://github.com/ApeWorX/ape-safe/blob/main/setup.py#L61-L65

MarcoWorms commented 11 months ago

gpt can do this one btw, just need to run the prompt and test if new script using click works