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

Make click optional; support manual definition of schemas. #43

Open
fresh2dev opened this issue Jun 9, 2023 · 5 comments
Open

Make click optional; support manual definition of schemas. #43

fresh2dev opened this issue Jun 9, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@fresh2dev
Copy link

fresh2dev commented Jun 9, 2023

Today, Trogon only supports click, and click-specific code is exists throughout Trogon. Frankly, Trogon is too amazing to be specific to click.

In addition to the reverse-engineering ("introspection") method of building a Trogon TUI from an existing click CLI, Trogon should offer an interface for any library to integrate Trogon by manually building and providing the command-schemas to Trogon. This way, Trogon could function without click, and any CLI app would have the ability to build and display a Trogon TUI. This would also lessen the burden on Trogon development, since it would not be necessary for Trogon devs to build "introspector" logic for each desired library, but would instead give devs of those libraries a path to D.I.Y. Trogon integration.

Instead of Trogon devs working to reverse-engineer and support this library and others, the developers of each library should have a path to integrate Trogon themselves.

Related issue: #5

@royatt
Copy link

royatt commented Jun 9, 2023

It would be fitting IMO to have some kind of a frontend abstraction layer, both for the inbound commands schema and for the outbound command execution. Imagine using the trogon engine to pick and choose different flags from a click CLI program, and to spew out the results back through into a more generic data-form that can (amongst still being totally fit for CLI reconstruction), would also support creating a pythonic function call that can be passed directly to the main function of click. (Interactive click based apps that use a shared state over a global and single python interpreter anyone?)

@fresh2dev
Copy link
Author

That's not relevant to this issue. This issue is about making Trogon work well without click.

@darrenburns darrenburns added the enhancement New feature or request label Jun 26, 2023
@fresh2dev
Copy link
Author

Here is a POC of Trogon working with argparse:

https://asciinema.org/a/VR1nYMQEu0vBGmCm9bZRoDEOc

@mgielda
Copy link

mgielda commented Dec 28, 2023

This would be very interesting and greatly broaden the reach of Trogon, given the popularity of argparse. Of course assuming that the implementation would be a matter of adding a few lines into your code.

@fresh2dev
Copy link
Author

fresh2dev commented Dec 29, 2023

Here's my fork that works with argparse: https://github.com/fresh2dev/argparse-tui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants