feat: --help-json flag for structured CLI discovery#43
Draft
feat: --help-json flag for structured CLI discovery#43
--help-json flag for structured CLI discovery#43Conversation
- Add `ShowHelpJsonError` exception and detection in `CommandGroup.run_with_args()` - Add `piou/help_json.py` module with JSON serialization of the full command tree - `--help-json` outputs structured JSON with callable choices shown as `"<dynamic>"` - `--help-json=full` resolves callable choices (including async) via `run_function()` - Subcommand targeting: `cli foo --help-json` outputs just the `foo` command schema - `__main__` commands are excluded from group output, secrets hide their defaults
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ShowHelpJsonErrorexception and detection inCommandGroup.run_with_args()piou/help_json.pymodule with JSON serialization of the full command tree--help-jsonoutputs structured JSON with callable choices shown as"<dynamic>"--help-json=fullresolves callable choices (including async) viarun_function()cli foo --help-jsonoutputs just thefoocommand schema__main__commands are excluded from group output, secrets hide their defaults