Skip to content

feat: --help-json flag for structured CLI discovery#43

Draft
Andarius wants to merge 1 commit intomasterfrom
feat/help-json
Draft

feat: --help-json flag for structured CLI discovery#43
Andarius wants to merge 1 commit intomasterfrom
feat/help-json

Conversation

@Andarius
Copy link
Owner

@Andarius Andarius commented Mar 8, 2026

  • 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

- 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
@Andarius Andarius self-assigned this Mar 8, 2026
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

Successfully merging this pull request may close these issues.

1 participant