Repository navigation
Feature request: allow selecting fields for human-readable list output #14413
Agent suggestions
Public previewDescription
Activity
This looks like a clear, well-scoped feature request rather than a bug: today's human-readable table columns for commands like
gh pr listare indeed hardcoded (e.g. number/title/branch/state are added via fixedtable.AddFieldcalls inpkg/cmd/pr/list/list.golines 245-252), with no way to customize which fields appear without falling back to--json/--template. I found no existing open or closed issue proposing this--fields-style option, so it doesn't appear to be a duplicate. I'm suggesting theenhancementlabel along withgh-prsince the example centers ongh pr list, though the author notes this could extend to other list commands.Generated by Issue Triage (skills-driven) for #14413 · copilot · auto · 47.4 AIC · ⌖ 2.12 AIC · ⊞ 10K · ◷
Hey thanks for raising this, @ItsSidhartha. Some quick thoughts:
Is there a specific reason this functionality does not currently exist?
No, in fact I think I explored something 2 years ago very similar to this through the lens of accessibility, allowing screenreader users to reorder information in the easiest to consume manner: 327cb83
I'll try and update the branch today and and maybe we can start playing around with it and seeing how different UX feels because while all your other questions are great for design discussion, I'm just not sure I can answer them off hand. Probably requires some focused design work (though we are pretty hammered with work right now).
Was there some work that you were doing where you found this would be really useful? Just looking for motivation for prioritising this feature with a jillion other things.
github-actions commented
on Sep 10, 2026 on Sep 10, 2026 – with GitHub ActionsContributorMore actionsThank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wanted
Contributions welcome label, we are not currently looking for external contributions for this feature.If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
Thanks @williammartin, for the consideration,
Was there some work that you were doing where you found this would be really useful? Just looking for motivation for prioritising this feature with a jillion other things.
Actually No, I was just playing around with the tool, and I tried to see the all the PR with author, then I felt it would be nice and helpfull if I can customise the fields I want.
What would you like to be added?
Add a
--fieldsoption to list commands such asgh pr listto allow users to select which fields are displayed in the human-readable table.For example:
could produce:
The order of the fields would determine the order of the columns.
Motivation
Today,
gh pr listprovides a predefined human-readable table, while--jsonprovides field selection for structured output.If a user wants a slightly different human-readable table, they currently need to move to
--jsonand then use--jqor--templateto construct the output.For example, selecting a few fields is straightforward:
but turning those fields back into a table requires additional formatting:
gh pr list \ --json number,title,author,state \ --template '{{range .}}{{tablerow .number .title .author.login .state}}{{end}}'There seems to be a useful middle ground between the fixed default table and fully programmable output:
The intention is to make common table customization simple without introducing another query or formatting language.
Proposed behavior
--fieldswould select fields that have a defined, human-readable representation suitable for a single table cell.Scalar fields would be supported directly, for example:
Some non-scalar fields also have an obvious single-value representation and could potentially be supported. For example:
The exact set of supported fields and their representations would be part of the design.
Fields representing collections such as
labels,assignees,comments,commits,files,reviews, etc. could initially be excluded rather than introducing arbitrary serialization rules.For structured or custom transformations, users would continue to use
--json,--jq, or--template.Why not make this a general JSON/field-path selector?
The goal would intentionally be to keep
--fieldssimple.For example, this proposal is not intended to introduce expressions such as:
gh pr list --fields 'labels[].name'or arbitrary JSON traversal/transformation.
That functionality is already better served by
--jsontogether with--jqor--template.Instead,
--fieldswould expose a curated set of fields thatghknows how to render naturally in a table.Open questions
I'd be interested in maintainer/community feedback on:
--fieldsa suitable name, or would another name be preferable?author,milestone, andheadRepositoryhave predefined representations as proposed above?labelsandassigneesbe excluded, or should they have a simple representation such as comma-separated values?gh issue list,gh run list, etc.), or should it initially be specific togh pr list?--fieldsvalues exactly match the fields available to--json, or should the two have separate field sets?Alternatives
The existing
--json,--jq, and--templateoptions can accomplish this today, so this proposal is primarily about making the common case more discoverable and concise.The proposed feature would not replace those options; it would provide a simpler interface for selecting predefined human-readable fields.
Example
Instead of:
gh pr list \ --json number,title,author,state \ --template '{{range .}}{{tablerow .number .title .author.login .state}}{{end}}'allow:
while retaining the existing structured-output options for users who need more control.