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

Support for Click Custom Multi Commands #62

Open
SebastienSyd opened this issue Sep 25, 2023 · 2 comments
Open

Support for Click Custom Multi Commands #62

SebastienSyd opened this issue Sep 25, 2023 · 2 comments

Comments

@SebastienSyd
Copy link

SebastienSyd commented Sep 25, 2023

Hi team! I love your work, really. I discovered this new tool and would like to integrate it in our internal stack. We are using Click for an internal CLI, and we are using it commands and sub-commands with that implementation:
https://click.palletsprojects.com/en/8.1.x/commands/#custom-multi-commands

Basically we have a folder structure:

mycli/
|_ commands/
   |_ cmd1.py
   |_ cmd2.py
   |_ cmd3.py
   |_ ...

Running mycli would list all the commands, and running mycli cmd1 would list all the cmd subcommands

If I implement Trogon from the docs, I would need to do mycli cmd1 tui to have a TUI for the mycli cmd1 subcommands, but I would love having a mycli tui command that would create a TUI for all commands and associated subcommands. Is there a way to do it with the current Trogon code, or this would need extra development?
Let me know if it's unclear

@doronz88
Copy link

doronz88 commented Oct 3, 2023

I'm also encountering the same issue. I would also like to use it with click.CommandCollection. Haven't found a way to implement it.

@boehmseb
Copy link

boehmseb commented Jan 5, 2024

I just opened a PR that adds support for MultiCommands (#71) since I also needed it and it was straight forward enough to implement. It works for my use case but feel free to test if it also works for you.

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

3 participants