fix: passthrough --json/--jq/--template flags in all gh subcommands#196
Open
shadowofdoom wants to merge 1 commit intortk-ai:masterfrom
Open
fix: passthrough --json/--jq/--template flags in all gh subcommands#196shadowofdoom wants to merge 1 commit intortk-ai:masterfrom
shadowofdoom wants to merge 1 commit intortk-ai:masterfrom
Conversation
view_pr() assumed args[0] was always a PR number, so `gh pr view --json fields` treated "--json" as the PR identifier and appended its own --json, causing `Unknown JSON field: "--json"`. The v0.21.1 fix (should_passthrough_run_view) only covered `gh run view`. This generalizes it with has_output_format_flags() and applies it to all handlers that hardcode --json fields: list_prs, view_pr, pr_status, list_issues, view_issue, list_runs, and run_repo. Also fixes view_pr to handle omitted PR number (gh defaults to current branch). Closes rtk-ai#159 (broader fix) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Tested locally on the branch — LGTM, approve. All 383 tests pass. Manual testing confirms:
Minor nits (non-blocking):
|
Collaborator
|
please review conflict to merge |
6 tasks
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.
Summary
gh pr view --json fieldsfailed withUnknown JSON field: "--json"becauseview_pr()treated--jsonas the PR identifiergh run viewviashould_passthrough_run_view()has_output_format_flags()and applies it to all handlers that hardcode--json:list_prs,view_pr,pr_status,list_issues,view_issue,list_runs, andrun_repoview_prto handle omitted PR number (gh defaults to current branch)Reproduction
Test plan
has_output_format_flags)rtk gh pr view --json number,title,statepasses through correctlyrtk gh pr liststill uses RTK's compressed outputrtk gh pr view <number>still uses RTK's compressed output🤖 Generated with Claude Code