Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor ape gpt cli by using click #5

Open
MarcoWorms opened this issue Nov 14, 2023 · 1 comment
Open

refactor ape gpt cli by using click #5

MarcoWorms opened this issue Nov 14, 2023 · 1 comment

Comments

@MarcoWorms
Copy link
Contributor

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
Copy link
Contributor Author

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

@MarcoWorms MarcoWorms changed the title refactor ape gpt cli using click refactor ape gpt cli using click Nov 14, 2023
@MarcoWorms MarcoWorms changed the title refactor ape gpt cli using click improve ape gpt cli by using click Nov 14, 2023
@MarcoWorms MarcoWorms changed the title improve ape gpt cli by using click refactor ape gpt cli by using click Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant