Repository navigation
feat(cli): expose json aliases on action commands - #2368
Conversation
Problem: The query-action parser accepted post-verb --json, but shell completion and Click help still advertised only --format on several action and analysis commands. That made the accepted grammar harder to discover and left the completion surface behind the parser contract. What changed: Added local --json aliases backed by the existing output_format parameter for query actions, candidate-review commands, provider usage diagnostics, and insight analysis commands. Updated the generated CLI reference and added parser and per-shell completion coverage so --json is owned by the same commands that own --format json. Verification: devtools test tests/unit/cli/test_cli_action_contracts.py -k 'post_verb_json_alias' devtools test tests/unit/cli/test_completion_matrix.py -k 'json_alias_completion or mutating_guard_completion' devtools verify --quick Ref #1844 Ref #2006 Ref #2317
|
Warning Review limit reached
More reviews will be available in 36 minutes and 36 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0f7bf54785
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @click.option( | ||
| "--json", | ||
| "output_format", | ||
| flag_value="json", | ||
| default=None, | ||
| help="Shortcut for --format json.", | ||
| ) |
There was a problem hiding this comment.
Honor --json in machine-error detection
When this new alias is used and the command fails before emitting its payload (for example, an invalid read --json --view ... value or analyze usage --json --limit nope), the top-level run_machine_entry path will still render Click’s plain-text error because wants_json() only pre-scans raw argv for --format json, --format=json, or -f json. The same invocations with --format json get machine-error envelopes, so the advertised shortcut is not equivalent on error paths; please make the pre-scan recognize --json as JSON intent too.
Useful? React with 👍 / 👎.
Summary
Promotes
--jsonfrom a parser-only convenience into a local Click option on the action and analysis commands that already own--format json, and updates shell-completion coverage plus the generated CLI reference.Problem
polylogue read <session> --jsonwas accepted after the previous dogfood fix, but completions and command help still advertised only--formatfor many verbs. That made the accepted grammar less discoverable and kept the completion surface behind parser behavior.Solution
Added local
--jsonaliases backed by the existingoutput_formatparameter for query actions, candidate assertion review commands, provider usage diagnostics, and insight analysis commands. The parser tests now assert the alias is owned locally rather than rewritten before Click dispatch. Completion tests verify bash, zsh, and fish expose--jsonalongside--formatfor the covered action paths.Verification
devtools test tests/unit/cli/test_cli_action_contracts.py -k 'post_verb_json_alias'-> 8 passed, 29 deselected.devtools test tests/unit/cli/test_completion_matrix.py -k 'json_alias_completion or mutating_guard_completion'-> 24 passed, 148 deselected.devtools verify --quick-> passed, run20260624T130051Z-quick-2590871-05f3c605.devtools verify --quick-> passed, run20260624T130135Z-quick-2591533-8ce195c6.Ref #1844
Ref #2006
Ref #2317