You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh api: warn when -f value starts with @ and names an existing file #14199
gh api ... -f [email protected] sends the literal string @draft.md as the value and exits 0. The file is not read.
$ printf 'hello' > draft.md
$ gh api repos/o/r/issues/1/comments -f [email protected] # creates a comment whose body is literally "@draft.md"
-F/--field reads the file (help: "use @<path> or @- to read value from file or stdin"), and --body-file reads files explicitly for PR/issue bodies, but the lowercase flag differs from the file-reading one by a single character and fails silently. In scripted or agent-driven workflows the result is a literal @path string posted to a public thread, logged as success by the caller.
Suggestion (non-breaking)
When a -f/--raw-field value starts with @, print a stderr warning, but only when the remainder names an existing file:
warning: -f value "[email protected]" starts with "@"; -f/--raw-field sends values literally, did you mean -F/--field?
Restricting the warning to values that resolve to an existing file avoids false positives for ordinary @mention-style values. Optionally add a matching note in the help text under -f/--raw-field (file reading is currently documented only under -F/--field).
Happy to adjust scope; this is a UX suggestion, not a behavior change.
Thanks for the detailed write-up! No duplicates found for this. I'm suggesting the enhancement label since this is a clear, well-reasoned UX improvement request (warn when -f/--raw-field is given an @file value that resolves to an existing file, since -f doesn't read files unlike -F). A maintainer can weigh in on scope/implementation details.
Thank 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 wantedContributions 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.
Hi, I'd like to work on this one. Per CONTRIBUTING I wanted to check first: would you accept the non-breaking direction suggested here (stderr warning only when a -f value starts with @ and the remainder names an existing file, plus a short help-text note)? @cli/code-reviewers, happy to shape it to whatever acceptance criteria you'd prefer. Thanks!
Activity
cli-triage commentedon Aug 20, 2026
Thanks for the detailed write-up! No duplicates found for this. I'm suggesting the
enhancementlabel since this is a clear, well-reasoned UX improvement request (warn when-f/--raw-fieldis given an@filevalue that resolves to an existing file, since-fdoesn't read files unlike-F). A maintainer can weigh in on scope/implementation details.github-actions commentedon Aug 26, 2026
Thank 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 wantedContributions 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.
mmustafasenoglu commentedon Sep 16, 2026
Hi, I'd like to work on this one. Per CONTRIBUTING I wanted to check first: would you accept the non-breaking direction suggested here (stderr warning only when a -f value starts with @ and the remainder names an existing file, plus a short help-text note)? @cli/code-reviewers, happy to shape it to whatever acceptance criteria you'd prefer. Thanks!